[Libreoffice-commits] core.git: vcl/CppunitTest_vcl_backend_test.mk vcl/qa vcl/skia

2021-11-30 Thread Luboš Luňák (via logerrit)
 vcl/CppunitTest_vcl_backend_test.mk |1 
 vcl/qa/cppunit/BackendTest.cxx  |   96 
 vcl/skia/gdiimpl.cxx|   30 ++-
 3 files changed, 124 insertions(+), 3 deletions(-)

New commits:
commit cdebd76284204f6a34df2a01d4eaedbd540c5fe6
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 18:05:20 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 22:06:15 2021 +0100

fix Skia copyArea() not coping with coordinates outside (tdf#145811)

Apparently the call is expected to handle even copies that are
partially outside of the area, e.g. window scrolling seems to do
this occassionally.

Change-Id: I9a06c047f00d6b5b920d61f577baa9181bdc5a2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126147
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/CppunitTest_vcl_backend_test.mk 
b/vcl/CppunitTest_vcl_backend_test.mk
index 5a886224034a..53338c3490a6 100644
--- a/vcl/CppunitTest_vcl_backend_test.mk
+++ b/vcl/CppunitTest_vcl_backend_test.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_CppunitTest_use_vcl,vcl_backend_test))
 
 $(eval $(call gb_CppunitTest_use_externals,vcl_backend_test,\
 boost_headers\
+harfbuzz \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,vcl_backend_test,\
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 7badb40464be..619e377194c9 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -18,6 +18,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1395,6 +1396,100 @@ public:
 #endif
 }
 
+void testTdf145811()
+{
+// TODO: This unit test is not executed for macOS unless bitmap scaling is 
implemented
+#ifndef MACOSX
+// VCL may call copyArea()/copyBits() of backends even with 
coordinates partially
+// outside of the device, so try various copying like that.
+ScopedVclPtr device1 = 
VclPtr::Create(DeviceFormat::DEFAULT);
+device1->SetOutputSizePixel(Size(100, 100));
+device1->SetBackground(Wallpaper(COL_YELLOW));
+device1->Erase();
+device1->SetLineColor(COL_BLUE);
+device1->DrawPixel(Point(0, 0), COL_BLUE);
+device1->DrawPixel(Point(99, 99), COL_BLUE);
+
+// Plain 1:1 copy device1->device2.
+ScopedVclPtr device2 = 
VclPtr::Create(DeviceFormat::DEFAULT);
+device2->SetOutputSizePixel(Size(100, 100));
+device2->DrawOutDev(Point(0, 0), Size(100, 100), Point(0, 0), 
Size(100, 100), *device1);
+exportDevice("tdf145811-1.png", device2);
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(0, 0)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(1, 1)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(98, 98)));
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(99, 99)));
+
+// For the rest call directly SalGraphics, because OutputDevice does 
range checking,
+// but other code may call copyArea()/copyBits() of SalGraphics 
directly without range checking.
+SalGraphics* graphics1 = device1->GetGraphics();
+SalGraphics* graphics2 = device2->GetGraphics();
+
+device2->DrawOutDev(Point(0, 0), Size(100, 100), Point(0, 0), 
Size(100, 100), *device1);
+// Copy device1->device2 offset by 10,10.
+graphics2->CopyBits(SalTwoRect(0, 0, 100, 100, 10, 10, 100, 100), 
*graphics1, *device2,
+*device1);
+exportDevice("tdf145811-2.png", device2);
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(0, 0))); // 
unmodified
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(9, 9)));
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(10, 10)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(11, 11)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(99, 99)));
+
+device2->DrawOutDev(Point(0, 0), Size(100, 100), Point(0, 0), 
Size(100, 100), *device1);
+// Copy area of device2 offset by 10,10.
+graphics2->CopyArea(10, 10, 0, 0, 100, 100, *device1);
+exportDevice("tdf145811-3.png", device2);
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(0, 0))); // 
unmodified
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(9, 9)));
+CPPUNIT_ASSERT_EQUAL(COL_BLUE, device2->GetPixel(Point(10, 10)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(11, 11)));
+CPPUNIT_ASSERT_EQUAL(COL_YELLOW, device2->GetPixel(Point(99, 99)));
+
+device2->DrawOutDev(Point(0, 0), Size(100, 100), Point(0, 0), 
Size(100, 100), *device1);
+// Copy device1->device2 offset by -20,-20.
+graphics2->CopyBits(SalTwoRect(0, 0, 100, 100, -20, -20, 100, 100), 
*graphics1, *device2,
+  

[Libreoffice-commits] core.git: include/basic

2021-11-30 Thread Luboš Luňák (via logerrit)
 include/basic/modsizeexceeded.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a49cd1cebde3853aca839dc6dc0df7845585480f
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 18:34:09 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 21:43:00 2021 +0100

fix clang-cl build with -Zc:dllexportInlines-

This hack causes undefined references to those dllimport symbols,
and it doesn't seem to be necessary for clang-cl (I've checked
both normal and mergelibs build with -Zc:dllexportInlines-).

Change-Id: Iaa33698950732b59cec2e6c5078f91a42980
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126149
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/basic/modsizeexceeded.hxx 
b/include/basic/modsizeexceeded.hxx
index 7403b398e777..8910be30b767 100644
--- a/include/basic/modsizeexceeded.hxx
+++ b/include/basic/modsizeexceeded.hxx
@@ -28,7 +28,7 @@
 
 namespace com::sun::star::task { class XInteractionContinuation; }
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(__clang__)
 // MSVC automatically applies dllexport to template instantiations if they are 
a base class
 // of a dllexport class, and this template instantiation is a case of that. If 
we don't
 // dllimport here, MSVC will complain about duplicate symbols in a mergelibs 
build.


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-30 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/platform/com_MSC_class.mk |9 +
 solenv/gbuild/platform/com_MSC_defs.mk  |7 +++
 2 files changed, 16 insertions(+)

New commits:
commit da2d40bb2b0b81cb891e2a334d672bb2790a7c23
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 11:22:11 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 15:44:49 2021 +0100

use -fno-pch-timestamp also with clang-cl

Change-Id: Ib985a22040a3cebea5ccb303576065a48f73d3ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126112
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index 2ca7466836b5..55a35f9ba661 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -116,6 +116,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(EXTERNAL_CODE),$(if 
$(COM_IS_CLANG),-Wno-undef),$(gb_DEFS_INTERNAL)) \
$(if $(filter YES,$(LIBRARY_X64)), ,$(gb_LTOFLAGS)) \
$(gb_COMPILERDEPFLAGS) \
+   $(gb_NO_PCH_TIMESTAMP) \
$(5) \
-c $(3) \
-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -I$(dir $(patsubst 
%.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) \
@@ -123,6 +124,13 @@ $(call gb_Helper_abbreviate_dirs,\
$(call gb_Trace_EndRange,$(2),PCH)
 endef
 
+ifeq ($(COM_IS_CLANG),TRUE)
+# Clang has -fno-pch-timestamp, just checksum the file for CCACHE_PCH_EXTSUM
+# $(call 
gb_PrecompiledHeader__sum_command,pchfile,pchtarget,source,cxxflags,includes,linktargetmakefilename,compiler)
+define gb_PrecompiledHeader__sum_command
+   $(SHA256SUM) $(1) >$(1).sum
+endef
+else
 # MSVC does not generate the same .pch for the same input, so checksum the 
(preprocessed) input
 # $(call 
gb_PrecompiledHeader__sum_command,pchfile,pchtarget,source,cxxflags,includes,linktargetmakefilename,compiler)
 define gb_PrecompiledHeader__sum_command
@@ -139,6 +147,7 @@ $(call gb_Helper_abbreviate_dirs,\
2>&1 | $(SHA256SUM) >$(1).sum \
)
 endef
+endif
 
 # When building a PCH, MSVC also creates a .pdb file with debug info. So for 
reuse
 # add the .pdb to the PCH's files and then use the .pdb also for linktargets 
that reuse the PCH.
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk 
b/solenv/gbuild/platform/com_MSC_defs.mk
index c7f302c0b5d1..08e799033eb5 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -210,6 +210,13 @@ gb_LinkTarget_EXCEPTIONFLAGS := \
 
 gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
 
+ifneq ($(gb_ENABLE_PCH),)
+ifeq ($(COM_IS_CLANG),TRUE)
+# the same as in com_GCC_defs.mk
+gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp
+endif
+endif
+
 gb_LinkTarget_LDFLAGS := \
$(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-nologo,) \
$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst 
\,/,$(ILIB) \


[Libreoffice-commits] core.git: vcl/skia

2021-11-30 Thread Luboš Luňák (via logerrit)
 vcl/skia/osx/bitmap.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit afdfc9bb5d56fde866882e7d87869ecafed1e3d0
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 14:13:53 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 15:44:11 2021 +0100

handle Skia not drawing GPU-backend shader to a bitmap (tdf#145797)

https: //bugs.chromium.org/p/skia/issues/detail?id=12685
Change-Id: I4de51b154e270df470102c357c25bdfa430a4488
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126118
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/osx/bitmap.cxx b/vcl/skia/osx/bitmap.cxx
index 77e34697aa50..16d32191a627 100644
--- a/vcl/skia/osx/bitmap.cxx
+++ b/vcl/skia/osx/bitmap.cxx
@@ -66,9 +66,18 @@ CGImageRef createCGImage(const Image& rImage)
 
assert(dynamic_cast(alphaBitmap.ImplGetSalBitmap().get()) != 
nullptr);
 SkiaSalBitmap* skiaAlpha
 = 
static_cast(alphaBitmap.ImplGetSalBitmap().get());
+#if 0
+// Drawing to a bitmap using a shader from a GPU-backed image fails 
silently.
+// https://bugs.chromium.org/p/skia/issues/detail?id=12685
 paint.setShader(SkShaders::Blend(SkBlendMode::kDstOut,
  
skiaBitmap->GetSkShader(SkSamplingOptions()),
  
skiaAlpha->GetAlphaSkShader(SkSamplingOptions(;
+#else
+sk_sp imB = skiaBitmap->GetSkImage()->makeNonTextureImage();
+sk_sp imA = 
skiaAlpha->GetAlphaSkImage()->makeNonTextureImage();
+paint.setShader(SkShaders::Blend(SkBlendMode::kDstOut, 
imB->makeShader(SkSamplingOptions()),
+ 
imA->makeShader(SkSamplingOptions(;
+#endif
 SkCanvas canvas(targetBitmap);
 canvas.concat(matrix);
 canvas.drawPaint(paint);


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/source

2021-11-30 Thread Luboš Luňák (via logerrit)
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx |   29 +
 1 file changed, 2 insertions(+), 27 deletions(-)

New commits:
commit 20029f713f2cb07b27d7be9bb4df5c2cec4723da
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 11:02:46 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Nov 30 14:46:07 2021 +0100

use DrawGradient() instead of doing it manually (tdf#145796)

Change-Id: Ib771eb2ae35f68c81ef1fdcb1e4e3bf5d24a0dcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126109
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 53486d831784285b42860882a6b270eb847ff7aa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126103
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx 
b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 7b22240abfdd..feaf5a5fa36a 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -384,33 +384,8 @@ void PageObjectPainter::PaintBackgroundDetail (
 const Color aBottomColor(mpTheme->GetGradientColor(eColorType, 
Theme::GradientColorClass::Fill2));
 if (aTopColor != aBottomColor)
 {
-const sal_Int32 nHeight (aPageObjectBox.GetHeight());
-const sal_Int32 nDefaultConstantSize(nHeight/4);
-const sal_Int32 nMinimalGradientSize(40);
-const sal_Int32 nY1 (
-::std::max(
-0,
-::std::min(
-nDefaultConstantSize,
-(nHeight - nMinimalGradientSize)/2)));
-const sal_Int32 nY2 (nHeight-nY1);
-const sal_Int32 nTop (aPageObjectBox.Top());
-for (sal_Int32 nY=0; nY=nY2)
-rDevice.SetLineColor(aBottomColor);
-else
-{
-Color aColor (aTopColor);
-aColor.Merge(aBottomColor, 255 * (nY2-nY) / (nY2-nY1));
-rDevice.SetLineColor(aColor);
-}
-rDevice.DrawLine(
-Point(aPageObjectBox.Left(), nY+nTop),
-Point(aPageObjectBox.Right(), nY+nTop));
-}
+Gradient gradient(GradientStyle::Linear, aTopColor, aBottomColor);
+rDevice.DrawGradient(aPageObjectBox, gradient);
 }
 else
 {


[Libreoffice-commits] core.git: sd/source

2021-11-30 Thread Luboš Luňák (via logerrit)
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx |   29 +
 1 file changed, 2 insertions(+), 27 deletions(-)

New commits:
commit 53486d831784285b42860882a6b270eb847ff7aa
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 11:02:46 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 12:58:06 2021 +0100

use DrawGradient() instead of doing it manually (tdf#145796)

Change-Id: Ib771eb2ae35f68c81ef1fdcb1e4e3bf5d24a0dcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126109
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx 
b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 7b22240abfdd..feaf5a5fa36a 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -384,33 +384,8 @@ void PageObjectPainter::PaintBackgroundDetail (
 const Color aBottomColor(mpTheme->GetGradientColor(eColorType, 
Theme::GradientColorClass::Fill2));
 if (aTopColor != aBottomColor)
 {
-const sal_Int32 nHeight (aPageObjectBox.GetHeight());
-const sal_Int32 nDefaultConstantSize(nHeight/4);
-const sal_Int32 nMinimalGradientSize(40);
-const sal_Int32 nY1 (
-::std::max(
-0,
-::std::min(
-nDefaultConstantSize,
-(nHeight - nMinimalGradientSize)/2)));
-const sal_Int32 nY2 (nHeight-nY1);
-const sal_Int32 nTop (aPageObjectBox.Top());
-for (sal_Int32 nY=0; nY=nY2)
-rDevice.SetLineColor(aBottomColor);
-else
-{
-Color aColor (aTopColor);
-aColor.Merge(aBottomColor, 255 * (nY2-nY) / (nY2-nY1));
-rDevice.SetLineColor(aColor);
-}
-rDevice.DrawLine(
-Point(aPageObjectBox.Left(), nY+nTop),
-Point(aPageObjectBox.Right(), nY+nTop));
-}
+Gradient gradient(GradientStyle::Linear, aTopColor, aBottomColor);
+rDevice.DrawGradient(aPageObjectBox, gradient);
 }
 else
 {


[Libreoffice-commits] core.git: vcl/inc vcl/unx

2021-11-30 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/x11/gdiimpl.hxx|6 +-
 vcl/unx/generic/app/salinst.cxx |   16 
 vcl/unx/generic/gdi/salgdi.cxx  |   14 +++---
 3 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit cab4a0166a81749ba025be6e1ab39203bdee1e10
Author: Luboš Luňák 
AuthorDate: Tue Nov 30 09:04:00 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 11:18:35 2021 +0100

workaround gcc bug #55776 about enum class shadowing a global

GCC warns that 'enum class XorMode { None }' shadows 'constexpr int
None = 0' for a workaround for X11 headers, even though there's
no case for confusion here. So instead of a workaround for X11
headers work this around by placing the enum first, and then GCC
does not complain.

Change-Id: I3e7cfaced957d47dee8cc4f10ee74e8dd97a5cc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126083
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/x11/gdiimpl.hxx b/vcl/inc/skia/x11/gdiimpl.hxx
index c2cb69649dab..f7198671b4d6 100644
--- a/vcl/inc/skia/x11/gdiimpl.hxx
+++ b/vcl/inc/skia/x11/gdiimpl.hxx
@@ -12,13 +12,9 @@
 
 #include 
 
+#include 
 #include 
 #include 
-// X11 headers
-constexpr int XNone = None;
-#undef None
-constexpr int None = XNone;
-#include 
 
 class VCL_PLUGIN_PUBLIC X11SkiaSalGraphicsImpl final : public 
SkiaSalGraphicsImpl,
public X11GraphicsImpl
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 54d20d2a8e7a..437614f35177 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -19,6 +19,14 @@
 
 #include 
 
+#include 
+#include 
+#include 
+#if HAVE_FEATURE_SKIA
+#include 
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -33,14 +41,6 @@
 
 #include 
 
-#include 
-#include 
-#include 
-#if HAVE_FEATURE_SKIA
-#include 
-#include 
-#endif
-
 // plugin factory function
 extern "C"
 {
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index fd930bd10cfd..d65313843155 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -17,6 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
+#if HAVE_FEATURE_SKIA
+#include 
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -50,13 +57,6 @@
 #include "cairo_xlib_cairo.hxx"
 #include 
 
-#include 
-#include 
-#if HAVE_FEATURE_SKIA
-#include 
-#include 
-#endif
-
 X11SalGraphics::X11SalGraphics():
 m_pFrame(nullptr),
 m_pVDev(nullptr),


[Libreoffice-commits] core.git: include/tools unotools/source

2021-11-30 Thread Luboš Luňák (via logerrit)
 include/tools/stream.hxx   |2 +-
 unotools/source/ucbhelper/ucblockbytes.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 93b04984518dbfed9e39d093b844113e81fda735
Author: Luboš Luňák 
AuthorDate: Mon Nov 29 22:23:25 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 10:38:57 2021 +0100

remove unnecessary virtual inheritance

SvLockBytes is only inherited by UcbLockBytes, and that one is not
inherited by anything, so there's no diamond inheritance, so there's
no point. Probably a case of somebody not really understanding
virtual inheritance and using it "just in case".

Change-Id: I2c01f29634c4f1ff2b55d7552fc571b653878ace
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126074
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 884b95f07290..5e78f6d259af 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -96,7 +96,7 @@ struct SvLockBytesStat
 SvLockBytesStat() : nSize(0) {}
 };
 
-class TOOLS_DLLPUBLIC SvLockBytes: public virtual SvRefBase
+class TOOLS_DLLPUBLIC SvLockBytes: public SvRefBase
 {
 SvStream * m_pStream;
 bool m_bOwner;
diff --git a/unotools/source/ucbhelper/ucblockbytes.hxx 
b/unotools/source/ucbhelper/ucblockbytes.hxx
index 6345ead51ba7..adc6d7f7ac5b 100644
--- a/unotools/source/ucbhelper/ucblockbytes.hxx
+++ b/unotools/source/ucbhelper/ucblockbytes.hxx
@@ -59,7 +59,7 @@ namespace utl
 class UcbLockBytes;
 typedef tools::SvRef UcbLockBytesRef;
 
-class UcbLockBytes : public virtual SvLockBytes
+class UcbLockBytes : public SvLockBytes
 {
 osl::Condition  m_aInitialized;
 osl::Condition  m_aTerminated;


[Libreoffice-commits] core.git: vcl/inc

2021-11-30 Thread Luboš Luňák (via logerrit)
 vcl/inc/impglyphitem.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8883fd63e2b5a4bd5d3c8a364c0fa725db5920cb
Author: Luboš Luňák 
AuthorDate: Mon Nov 29 18:54:14 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 10:38:31 2021 +0100

remove duplicated VCL_DLLPUBLIC

The class itself is already VCL_DLLPUBLIC.

Change-Id: Ic1c352ebce8fbee4602ddc84b2db22eb0038b5e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126075
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx
index ca9f7cf5c052..b33ccbd37d7c 100644
--- a/vcl/inc/impglyphitem.hxx
+++ b/vcl/inc/impglyphitem.hxx
@@ -94,14 +94,14 @@ public:
 int xOffset() const { return m_nXOffset; }
 };
 
-VCL_DLLPUBLIC bool GlyphItem::GetGlyphBoundRect(const LogicalFontInstance* 
pFontInstance,
-tools::Rectangle& rRect) const
+bool GlyphItem::GetGlyphBoundRect(const LogicalFontInstance* pFontInstance,
+  tools::Rectangle& rRect) const
 {
 return pFontInstance->GetGlyphBoundRect(m_aGlyphId, rRect, IsVertical());
 }
 
-VCL_DLLPUBLIC bool GlyphItem::GetGlyphOutline(const LogicalFontInstance* 
pFontInstance,
-  basegfx::B2DPolyPolygon& rPoly) 
const
+bool GlyphItem::GetGlyphOutline(const LogicalFontInstance* pFontInstance,
+basegfx::B2DPolyPolygon& rPoly) const
 {
 return pFontInstance->GetGlyphOutline(m_aGlyphId, rPoly, IsVertical());
 }


[Libreoffice-commits] core.git: configure.ac

2021-11-30 Thread Luboš Luňák (via logerrit)
 configure.ac |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit c73aa8bd54ca5d1aba5fa0c1e15837b77c673861
Author: Luboš Luňák 
AuthorDate: Mon Nov 29 20:11:37 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 30 10:38:10 2021 +0100

try to find clang-cl also in C:/Program Files/LLVM

That's where the LLVM installer puts it by default.

Change-Id: Ia20979a4ae97eca8686b7a82a372264750066f63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126081
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 140ee52e675f..2c5a8808a9ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12069,6 +12069,12 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != 
TRUE; then
 AC_MSG_CHECKING([for clang-cl])
 if test -x "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"; then
 LO_CLANG_CC=`win_short_path_for_make 
"$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"`
+elif test -n "$PROGRAMFILES" -a -x 
"$PROGRAMFILES/LLVM/bin/clang-cl.exe"; then
+LO_CLANG_CC=`win_short_path_for_make 
"$PROGRAMFILES/LLVM/bin/clang-cl.exe"`
+elif test -x "c:/Program Files/LLVM/bin/clang-cl.exe"; then
+LO_CLANG_CC=`win_short_path_for_make "c:/Program 
Files/LLVM/bin/clang-cl.exe"`
+fi
+if test -n "$LO_CLANG_CC"; then
 dnl explicitly set -m32/-m64
 LO_CLANG_CC="$LO_CLANG_CC -m$WIN_HOST_BITS"
 LO_CLANG_CXX="$LO_CLANG_CC"


[Libreoffice-commits] core.git: configure.ac

2021-11-29 Thread Luboš Luňák (via logerrit)
 configure.ac |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit e9332dcdc8f2ea268d1b17c73d43a8834cf75365
Author: Luboš Luňák 
AuthorDate: Mon Nov 29 16:07:52 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 22:54:01 2021 +0100

explicitly check also for -fno-pch-codegen

The catch is that clang-cl does not know it, it only understands
-Xclang -fpch-codegen. On Linux -fno-pch-codegen is handled by
the driver, but clang-cl doesn't know the options, so we pass
to the backend using -Xclang, but that one understands only
-fpch-codegen. So if not found, do not use that option, the cost
is only that compiling precompiled_skia.cxx will take longer.

Change-Id: Ie307f96b381b732517a5ab574c742a2ee0bfb687
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126067
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 65a38d685c73..140ee52e675f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6014,10 +6014,11 @@ if test -n "$BUILDING_PCH_WITH_OBJ"; then
 save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-codegen"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
-[
-PCH_CODEGEN="${fpch_prefix}-fpch-codegen"
-PCH_NO_CODEGEN="${fpch_prefix}-fno-pch-codegen"
-],[])
+[ PCH_CODEGEN="${fpch_prefix}-fpch-codegen" ],[])
+CFLAGS=$save_CFLAGS
+CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fno-pch-codegen"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
+[ PCH_NO_CODEGEN="${fpch_prefix}-fno-pch-codegen" ],[])
 CFLAGS=$save_CFLAGS
 if test -n "$PCH_CODEGEN"; then
 AC_MSG_RESULT(yes)


[Libreoffice-commits] core.git: external/skia vcl/inc vcl/skia vcl/unx

2021-11-29 Thread Luboš Luňák (via logerrit)
 external/skia/UnpackedTarball_skia.mk  |1 
 external/skia/allow-no-es2restrictions.patch.1 |   13 ++
 vcl/inc/skia/gdiimpl.hxx   |  123 ++---
 vcl/inc/skia/utils.hxx |5 
 vcl/inc/skia/x11/gdiimpl.hxx   |4 
 vcl/skia/SkiaHelper.cxx|   64 +++
 vcl/skia/gdiimpl.cxx   |  143 -
 vcl/unx/generic/gdi/salgdi.cxx |2 
 8 files changed, 193 insertions(+), 162 deletions(-)

New commits:
commit f7a628f8efe037c1fd7e594eb4b8fc6a44573384
Author: Luboš Luňák 
AuthorDate: Fri Nov 26 09:10:57 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 21:49:10 2021 +0100

implement xor drawing directly using Skia (tdf#141090)

Up until now this has been implemented like in almost all other VCL
backends by manually xor-ing pixel values. But that required fetching
pixel values from the GPU in Vulkan mode, which is relatively slow.
Since some time Skia now has supported writing custom blending modes
using the SkBlender class, so it's now possible to drop the hack
and support xor drawing directly using a blender that does
the operation. This should be both faster and simpler.

Change-Id: Id751d0ed4034852ce68697ecf56cc6dfac95307f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126051
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/external/skia/UnpackedTarball_skia.mk 
b/external/skia/UnpackedTarball_skia.mk
index c6e27ecf4183..cbaa37895061 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -37,6 +37,7 @@ skia_patches := \
 disable-freetype-colrv1.1 \
 windows-libraries-system32.patch.1 \
 fix-graphite-ifdef.patch.1 \
+allow-no-es2restrictions.patch.1 \
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
 
diff --git a/external/skia/allow-no-es2restrictions.patch.1 
b/external/skia/allow-no-es2restrictions.patch.1
new file mode 100644
index ..0195ad3d2ac8
--- /dev/null
+++ b/external/skia/allow-no-es2restrictions.patch.1
@@ -0,0 +1,13 @@
+diff --git a/include/effects/SkRuntimeEffect.h 
b/include/effects/SkRuntimeEffect.h
+index b3f21b1d58..dddc8d16dc 100644
+--- a/include/effects/SkRuntimeEffect.h
 b/include/effects/SkRuntimeEffect.h
+@@ -97,7 +97,7 @@ public:
+ // run the inliner directly, but they still get an inlining pass once 
they are painted.)
+ bool forceNoInline = false;
+ 
+-private:
++//private:
+ friend class SkRuntimeEffect;
+ friend class SkRuntimeEffectPriv;
+ 
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index cc4cda4b2ebd..2473d0918284 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -221,8 +221,8 @@ protected:
 void preDraw();
 // To be called after any drawing.
 void postDraw();
-// The canvas to draw to. Will be diverted to a temporary for Xor mode.
-SkCanvas* getDrawCanvas() { return mXorMode ? getXorCanvas() : 
mSurface->getCanvas(); }
+// The canvas to draw to.
+SkCanvas* getDrawCanvas() { return mSurface->getCanvas(); }
 // Call before makeImageSnapshot(), ensures the content is up to date.
 void flushDrawing();
 
@@ -261,22 +261,10 @@ protected:
 // Get the global HiDPI scaling factor.
 virtual int getWindowScaling() const;
 
-SkCanvas* getXorCanvas();
-void applyXor();
-// NOTE: This must be called before the operation does any drawing.
 void addUpdateRegion(const SkRect& rect)
 {
 // Make slightly larger, just in case (rounding, antialiasing,...).
 SkIRect addedRect = rect.makeOutset(2, 2).round();
-if (mXorMode)
-{
-// Two xor operations should cancel each other out. We batch xor 
operations,
-// but if they can overlap, apply xor now, since applyXor() does 
the operation
-// just once.
-if (mXorRegion.intersects(addedRect))
-applyXor();
-mXorRegion.op(addedRect, SkRegion::kUnion_Op);
-}
 // Using SkIRect should be enough, SkRegion would be too slow with 
many operations
 // and swapping to the screen is not _that_slow.
 mDirtyRect.join(addedRect);
@@ -308,31 +296,22 @@ protected:
 void performDrawPolyPolygon(const basegfx::B2DPolyPolygon& polygon, double 
transparency,
 bool useAA);
 
+// Create SkPaint to use when drawing to the surface. It is not to be used
+// when doing internal drawing such as when merging two bitmaps together.
+// This may apply some default settings to the paint as necessary.
+SkPaint makePaintInternal() const;
 // Create SkPaint set up for drawing lines (using mLineColor etc.).
-SkPaint makeLinePaint(double transparency = 0) const
-{
-assert(mLineColor !=

[Libreoffice-commits] core.git: vcl/inc vcl/skia

2021-11-29 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/utils.hxx  |3 ---
 vcl/skia/SkiaHelper.cxx |   34 --
 vcl/skia/gdiimpl.cxx|7 ---
 3 files changed, 4 insertions(+), 40 deletions(-)

New commits:
commit 4a11c85baeb4998e12bc2ab45b0c23d7203bd5b0
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 22:38:55 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 21:48:53 2021 +0100

remove Skia kDifference workaround

I thought it was a driver problem, but now I'm actually not sure,
as I cannot reproduce it anymore and I don't know if it was a driver
update or Skia update. Either way, this works now.

Also switch to kExclusion, because the end result is the same,
but this formula is simpler (to understand primarily, the performance
is going to be probably the same).

Change-Id: I6ced098ca4a3361cf98d3f9b32968c128eb9f299
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126050
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
index 0583e9ceb624..ac8a185e711e 100644
--- a/vcl/inc/skia/utils.hxx
+++ b/vcl/inc/skia/utils.hxx
@@ -103,9 +103,6 @@ enum DirectImage
 No
 };
 
-// Do 'paint->setBlendMode(SkBlendMode::kDifference)' (workaround for buggy 
drivers).
-void setBlendModeDifference(SkPaint* paint);
-
 // Must be called in any VCL backend before any Skia functionality is used.
 // If not set, Skia will be disabled.
 VCL_DLLPUBLIC void
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 631e5b64fe52..d082b6799129 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -644,45 +644,11 @@ tools::Long maxImageCacheSize()
 return officecfg::Office::Common::Cache::Skia::ImageCacheSize::get();
 }
 
-static sk_sp differenceBlender;
-
-void setBlendModeDifference(SkPaint* paint)
-{
-// This should normally do 
'paint->setBlendMode(SkBlendMode::kDifference);'.
-// But some drivers have a problem with this, namely currently AMD on 
Windows
-// (e.g. 'Vulkan API version: 1.2.170, driver version: 2.0.179, vendor: 
0x1002 (AMD),
-// device: 0x15dd, type: integrated, name: AMD Radeon(TM) Vega 8 Graphics')
-// simply crashes when kDifference is used.
-// Intel also had repaint problems with kDifference (tdf#130430), but it 
seems
-// those do not(?) exist anymore.
-// Interestingly, explicitly writing a shader that does exactly the same 
works fine,
-// so do that.
-if (!differenceBlender)
-{
-const char* const diff = R"(
-vec4 main( vec4 src, vec4 dst )
-{
-return vec4(abs( src.r - dst.r ), abs( src.g - dst.g ), abs( 
src.b - dst.b ), dst.a );
-}
-)";
-auto effect = SkRuntimeEffect::MakeForBlender(SkString(diff));
-if (!effect.effect)
-{
-SAL_WARN("vcl.skia",
- "SKRuntimeEffect::MakeForBlender failed: " << 
effect.errorText.c_str());
-abort();
-}
-differenceBlender = effect.effect->makeBlender(nullptr);
-}
-paint->setBlender(differenceBlender);
-}
-
 void cleanup()
 {
 sharedWindowContext.reset();
 imageCache.clear();
 imageCacheSize = 0;
-differenceBlender.reset();
 }
 
 static SkSurfaceProps commonSurfaceProps;
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 3d7697c4dcfa..63d588aa913e 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1507,7 +1507,10 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 addUpdateRegion(aPath.getBounds());
 SkAutoCanvasRestore autoRestore(getDrawCanvas(), true);
 SkPaint aPaint;
-setBlendModeDifference();
+// There's no blend mode for inverting as such, but kExclusion is 's + d - 
2*s*d',
+// so with d = 1.0 (all channels) it becomes effectively '1 - s', i.e. 
inverted color.
+aPaint.setBlendMode(SkBlendMode::kExclusion);
+aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
 // TrackFrame just inverts a dashed path around the polygon
 if (eFlags == SalInvert::TrackFrame)
 {
@@ -1519,11 +1522,9 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 constexpr float intervals[] = { 4.0f, 4.0f };
 aPaint.setStyle(SkPaint::kStroke_Style);
 aPaint.setPathEffect(SkDashPathEffect::Make(intervals, 
SK_ARRAY_COUNT(intervals), 0));
-aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
 }
 else
 {
-aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
 aPaint.setStyle(SkPaint::kFill_Style);
 
 // N50 inverts in checker pattern


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-29 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/LinkTarget.mk|3 ++-
 solenv/gbuild/PrecompiledHeaders.mk|3 ++-
 solenv/gbuild/platform/com_GCC_defs.mk |2 ++
 solenv/gbuild/platform/com_MSC_defs.mk |5 +
 4 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit b2c5944d38f107d77d647bca114fae4e940edcbf
Author: Luboš Luňák 
AuthorDate: Mon Nov 29 14:44:17 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 19:46:48 2021 +0100

fix shared PCH with clang-cl

clang-cl does not understand -include CLI option. It also warns
about #define's differing in the shared PCH that do not matter,
so disable that.

Change-Id: I9f6d7a8a28a8d290a8bf783f68c629c06cefbf41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126053
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index b0b716ace55b..783f6022abe6 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1938,7 +1938,8 @@ endef
 # call 
gb_LinkTarget__reuse_precompiled_header_workarounds,linktarget,pchcxxfile,pchtarget,linktargetmakefilename
 define gb_LinkTarget__reuse_precompiled_header_workarounds
 ifeq ($(COM_IS_CLANG),TRUE)
-$(call gb_LinkTarget_add_defs,$(1),-include $(SRCDIR)/pch/inc/clangfix.hxx)
+$(call 
gb_LinkTarget_add_defs,$(1),$(gb_CXXFLAGS_include)$(SRCDIR)/pch/inc/clangfix.hxx)
+$(call gb_LinkTarget_add_defs,$(1),$(gb_CXXFLAGS_no_pch_warnings))
 endif
 $(if $(filter precompiled_system,$(3)), $(call 
gb_LinkTarget_add_defs,$(1),-DBOOST_ALL_NO_LIB))
 endef
diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index 3b81cc77f365..bc95f07b47e5 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -159,7 +159,8 @@ gb_PrecompiledHeader_ignore_flags_system := \
 -DGLM_FORCE_CTOR_INIT \
 -DVCL_INTERNALS \
 -DZLIB_CONST \
--include $(SRCDIR)/pch/inc/clangfix.hxx \
+$(gb_CXXFLAGS_include)$(SRCDIR)/pch/inc/clangfix.hxx \
+$(gb_CXXFLAGS_no_pch_warnings) \
 $(gb_PrecompiledHeader_ignore_flags_for_flags_file) \
 
 # Probably also update pch/inc/clangfix.hxx if you extend the list.
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk 
b/solenv/gbuild/platform/com_GCC_defs.mk
index 589c9eedc823..e0c9dfc3d58f 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -107,6 +107,8 @@ endif
 
 gb_CXXFLAGS_Wundef = -Wno-undef
 
+gb_CXXFLAGS_include := -include$(gb_SPACE)
+
 ifeq ($(strip $(gb_GCOV)),YES)
 gb_CFLAGS_COMMON += -fprofile-arcs -ftest-coverage
 gb_CXXFLAGS_COMMON += -fprofile-arcs -ftest-coverage
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk 
b/solenv/gbuild/platform/com_MSC_defs.mk
index 892fa3867ba8..c7f302c0b5d1 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -166,6 +166,11 @@ ifeq ($(HAVE_DLLEXPORTINLINES),TRUE)
 gb_CXXFLAGS += -Zc:dllexportInlines-
 endif
 
+gb_CXXFLAGS_include := -FI
+ifeq ($(COM_IS_CLANG),TRUE)
+gb_CXXFLAGS_no_pch_warnings := -Wno-clang-cl-pch
+endif
+
 ifneq ($(COM_IS_CLANG),TRUE)
 
 # clang-cl doesn't support -Wv:18 for now


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-29 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/platform/com_MSC_class.mk |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 973cf26280f80177f5e78d828ddf0cf69ce6a3a1
Author: Luboš Luňák 
AuthorDate: Sun Nov 28 19:21:18 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 19:46:23 2021 +0100

clang-cl: do not complain about precompiled_xxx.hxx include

It was complaining about the header being found using non-standard
Microsoft seach rules.

Change-Id: I1872515b638f4181b32126c8a932105fdcbdb9f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126023
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/platform/com_MSC_class.mk 
b/solenv/gbuild/platform/com_MSC_class.mk
index 16eb6c2ee4d3..2ca7466836b5 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -118,7 +118,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(gb_COMPILERDEPFLAGS) \
$(5) \
-c $(3) \
-   -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) 
$(call gb_create_deps,$(call 
gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(6)),$(1),$(3))
+   -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -I$(dir $(patsubst 
%.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) \
+   $(call gb_create_deps,$(call 
gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(6)),$(1),$(3))
$(call gb_Trace_EndRange,$(2),PCH)
 endef
 


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-29 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/platform/com_MSC_defs.mk |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c00b2c43c8f10755b1e7bfb32766e384d8964b3d
Author: Luboš Luňák 
AuthorDate: Sun Nov 28 19:11:50 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 13:52:51 2021 +0100

clang-cl says it doesn't know -Zc:inline

Change-Id: I2ace3011a533978d995898ed2dd588c728bac233
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126022
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/platform/com_MSC_defs.mk 
b/solenv/gbuild/platform/com_MSC_defs.mk
index 7760cefcab8a..892fa3867ba8 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -132,7 +132,6 @@ gb_CXXFLAGS := \
-Gs \
-GS \
-Gy \
-   -Zc:inline \
$(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \
-nologo \
-W4 \
@@ -148,7 +147,10 @@ gb_CXXFLAGS := \
-wd4706 \
-bigobj \
 
+ifneq ($(COM_IS_CLANG),TRUE)
+gb_CXXFLAGS += -Zc:inline
 gb_CXXFLAGS_ZCINLINE_OFF := -Zc:inline-
+endif
 
 ifeq ($(CPUNAME),INTEL)
 


[Libreoffice-commits] core.git: sc/inc sc/source

2021-11-29 Thread Luboš Luňák (via logerrit)
 sc/inc/queryentry.hxx  |2 -
 sc/inc/queryparam.hxx  |3 +
 sc/source/core/data/table3.cxx |4 +-
 sc/source/core/tool/queryparam.cxx |   66 -
 4 files changed, 28 insertions(+), 47 deletions(-)

New commits:
commit d4f1531b6d37153384e5a439dab6ab11ae3022ef
Author: Luboš Luňák 
AuthorDate: Sat Nov 27 22:03:28 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 29 13:52:28 2021 +0100

store ScQueryEntry simply by value

There's not much point in complicating this by allocating them
dynamically if they're always treated by value anyway.

Change-Id: I8325829201c0ad6c95858916a94c5b4d1d208b1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126024
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index 9b0b1cd98124..9798b83df785 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -30,7 +30,7 @@
 /**
  * Each instance of this struct represents a single filtering criteria.
  */
-struct SC_DLLPUBLIC ScQueryEntry
+struct SC_DLLPUBLIC ScQueryEntry final
 {
 enum QueryType
 {
diff --git a/sc/inc/queryparam.hxx b/sc/inc/queryparam.hxx
index e27399107f3f..8d9dbe01fe0f 100644
--- a/sc/inc/queryparam.hxx
+++ b/sc/inc/queryparam.hxx
@@ -21,6 +21,7 @@
 
 #include 
 #include "address.hxx"
+#include "queryentry.hxx"
 #include "types.hxx"
 
 #include 
@@ -65,7 +66,7 @@ struct SAL_DLLPUBLIC_RTTI ScQueryParamBase
 SvNumberFormatter* pFormatter );
 
 protected:
-typedef std::vector> EntriesType;
+typedef std::vector EntriesType;
 
 public:
 typedef EntriesType::const_iterator const_iterator;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 2eae384f397a..0b9e4b3ea082 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3185,9 +3185,9 @@ bool ScTable::ValidQuery(
 tools::LongnPos = -1;
 QueryEvaluator aEval(rDocument, *this, rParam, pbTestEqualCondition != 
nullptr, pValidQueryCache);
 ScQueryParam::const_iterator it, itBeg = rParam.begin(), itEnd = 
rParam.end();
-for (it = itBeg; it != itEnd && (*it)->bDoQuery; ++it)
+for (it = itBeg; it != itEnd && it->bDoQuery; ++it)
 {
-const ScQueryEntry& rEntry = **it;
+const ScQueryEntry& rEntry = *it;
 
 // Short-circuit the test at the end of the loop - if this is SC_AND
 // and the previous value is false, this value will not be needed.
diff --git a/sc/source/core/tool/queryparam.cxx 
b/sc/source/core/tool/queryparam.cxx
index 918bb0d5cdab..694f54226b5e 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -38,17 +38,17 @@ class FindByField
 SCCOLROW mnField;
 public:
 explicit FindByField(SCCOLROW nField) : mnField(nField) {}
-bool operator() (const std::unique_ptr& rpEntry) const
+bool operator() (const ScQueryEntry& rpEntry) const
 {
-return rpEntry->bDoQuery && rpEntry->nField == mnField;
+return rpEntry.bDoQuery && rpEntry.nField == mnField;
 }
 };
 
 struct FindUnused
 {
-bool operator() (const std::unique_ptr& rpEntry) const
+bool operator() (const ScQueryEntry& rpEntry) const
 {
-return !rpEntry->bDoQuery;
+return !rpEntry.bDoQuery;
 }
 };
 
@@ -73,18 +73,14 @@ ScQueryParamBase::ScQueryParamBase() :
 bDuplicate(false),
 mbRangeLookup(false)
 {
-for (size_t i = 0; i < MAXQUERY; ++i)
-m_Entries.push_back(std::make_unique());
+m_Entries.resize(MAXQUERY);
 }
 
 ScQueryParamBase::ScQueryParamBase(const ScQueryParamBase& r) :
 eSearchType(r.eSearchType), bHasHeader(r.bHasHeader), bByRow(r.bByRow), 
bInplace(r.bInplace),
-bCaseSens(r.bCaseSens), bDuplicate(r.bDuplicate), 
mbRangeLookup(r.mbRangeLookup)
+bCaseSens(r.bCaseSens), bDuplicate(r.bDuplicate), 
mbRangeLookup(r.mbRangeLookup),
+m_Entries(r.m_Entries)
 {
-for (auto const& it : r.m_Entries)
-{
-m_Entries.push_back(std::make_unique(*it));
-}
 }
 
 ScQueryParamBase& ScQueryParamBase::operator=(const ScQueryParamBase& r)
@@ -98,12 +94,7 @@ ScQueryParamBase& ScQueryParamBase::operator=(const 
ScQueryParamBase& r)
 bCaseSens = r.bCaseSens;
 bDuplicate = r.bDuplicate;
 mbRangeLookup = r.mbRangeLookup;
-
-m_Entries.clear();
-for (auto const& it : r.m_Entries)
-{
-m_Entries.push_back(std::make_unique(*it));
-}
+m_Entries = r.m_Entries;
 }
 return *this;
 }
@@ -124,12 +115,12 @@ SCSIZE ScQueryParamBase::GetEntryCount() const
 
 const ScQueryEntry& ScQueryParamBase::GetEntry(SCSIZE n) const
 {
-return *m_Entries[n];
+return m_Entries[n];
 }
 
 ScQueryEntry& ScQueryParamBase::Ge

Re: clang vs gcc build performance (executable not build time)

2021-11-26 Thread Luboš Luňák
On Friday 26 of November 2021, Miklos Vajna wrote:
> On Wed, Nov 24, 2021 at 10:58:12AM +0100, Stephan Bergmann 
 wrote:
> > There's the horribly outdated
> > <https://wiki.documentfoundation.org/Development/clang-cl> that Ilmari
> > already mentioned,  But setting up LLVM/Clang (which should only be
> > necessary if you want to --enable-compiler-plugins, which is my
> > motivation for doing those clang-cl builds; otherwise, the Clang bundled
> > with VS probably works fine) and doing a LO build with it has become much
> > simpler since when I wrote that.  (If there is demand, I could try and
> > update the wiki page, just ping me.)
>
> If you have a bit of time to update that, I would appreciate it.

 Last time I tried clang-cl I had to do quite some extra setup IIRC, things 
like having to add -m32/-m64. Since MSVC normally works out of the box, I 
think it'd be better to either have configure check these and add them if 
necessary, or alternatively have some kind of --enable-clang that'd find and 
select clang-cl instead of cl.

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - download.lst external/skia

2021-11-26 Thread Luboš Luňák (via logerrit)
 download.lst  |4 
 external/skia/Library_skia.mk |  132 ++
 external/skia/UnpackedTarball_skia.mk |4 
 external/skia/constexpr-debug-std-max.patch.1 |   32 --
 external/skia/fix-graphite-ifdef.patch.1  |   13 ++
 external/skia/fix-without-gl.patch.1  |   40 ++-
 external/skia/inc/pch/precompiled_skia.hxx|   10 +
 external/skia/make-api-visible.patch.1|   10 -
 external/skia/share-grcontext.patch.1 |   35 ++
 9 files changed, 130 insertions(+), 150 deletions(-)

New commits:
commit 5cb6c9c814e8675da181c8cfd623518da99d2b4a
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 17:09:53 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 26 10:49:42 2021 +0100

update Skia to chrome/m97

Change-Id: I55ab0b25389dcce3263b38a2de12c437b47751c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125821
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit e95a808020de12351714965f5656e893d94d50f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125830

diff --git a/download.lst b/download.lst
index df1aab85fc23..1cb460f01f66 100644
--- a/download.lst
+++ b/download.lst
@@ -237,8 +237,8 @@ export RHINO_SHA256SUM := 
1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131
 export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
 export SERF_SHA256SUM := 
549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc
 export SERF_TARBALL := serf-1.3.9.tar.bz2
-export SKIA_SHA256SUM := 
f69f9164ee982a8254722e1100aa7d31f78a5cd5e084418a3e202b55104fc3e2
-export SKIA_TARBALL := skia-m94-975fcdd755dfc5d57cddbb25857e0c4ac29abe98.tar.xz
+export SKIA_SHA256SUM := 
97e859e8467eca9d2441cd23079b61c2c3863b5687620f18cc31a9f966740177
+export SKIA_TARBALL := skia-m97-a7230803d64ae9d44f4e1282444801119a3ae967.tar.xz
 export STAROFFICE_SHA256SUM := 
f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db
 export STAROFFICE_VERSION_MICRO := 7
 export STAROFFICE_TARBALL := 
libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 92215b0935d2..d3c3dd2cae7c 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -169,6 +169,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/core/SkBlitter \
 UnpackedTarball/skia/src/core/SkBlitter_RGB565 \
 UnpackedTarball/skia/src/core/SkBlitter_Sprite \
+UnpackedTarball/skia/src/core/SkBlockAllocator \
 UnpackedTarball/skia/src/core/SkBlurMask \
 UnpackedTarball/skia/src/core/SkBlurMF \
 UnpackedTarball/skia/src/core/SkBuffer \
@@ -357,6 +358,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/effects/imagefilters/SkBlurImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkColorFilterImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkComposeImageFilter \
+UnpackedTarball/skia/src/effects/imagefilters/SkCropImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapImageFilter 
\
 UnpackedTarball/skia/src/effects/imagefilters/SkDropShadowImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkImageImageFilter \
@@ -466,6 +468,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/dsl/priv/DSLWriter \
 UnpackedTarball/skia/src/sksl/ir/SkSLBinaryExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLBlock \
+UnpackedTarball/skia/src/sksl/ir/SkSLChildCall \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructor \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArray \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArrayCast \
@@ -482,8 +485,10 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/ir/SkSLForStatement \
 UnpackedTarball/skia/src/sksl/ir/SkSLFunctionCall \
 UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDeclaration \
+UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDefinition \
 UnpackedTarball/skia/src/sksl/ir/SkSLIfStatement \
 UnpackedTarball/skia/src/sksl/ir/SkSLIndexExpression \
+UnpackedTarball/skia/src/sksl/ir/SkSLModifiers \
 UnpackedTarball/skia/src/sksl/ir/SkSLPrefixExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLPostfixExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLSetting \
@@ -492,10 +497,10 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/ir/SkSLSymbolTable \
 UnpackedTarball/skia/src/sksl/ir/SkSLTernaryExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLType \
+UnpackedTarball/skia/src/sksl/ir/SkSLTypeReference \
 UnpackedTarball/skia/src/sksl/ir/SkSLVarDeclarations \
 UnpackedTarball/skia/src/sksl/ir/SkSLVariable \
 UnpackedTarball/skia/src/sksl/ir

[Libreoffice-commits] core.git: download.lst external/skia

2021-11-25 Thread Luboš Luňák (via logerrit)
 download.lst  |4 
 external/skia/Library_skia.mk |  132 ++
 external/skia/UnpackedTarball_skia.mk |4 
 external/skia/constexpr-debug-std-max.patch.1 |   32 --
 external/skia/fix-graphite-ifdef.patch.1  |   13 ++
 external/skia/fix-without-gl.patch.1  |   40 ++-
 external/skia/inc/pch/precompiled_skia.hxx|   10 +
 external/skia/make-api-visible.patch.1|   10 -
 external/skia/share-grcontext.patch.1 |   35 ++
 9 files changed, 130 insertions(+), 150 deletions(-)

New commits:
commit e95a808020de12351714965f5656e893d94d50f4
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 17:09:53 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 20:48:40 2021 +0100

update Skia to chrome/m97

Change-Id: I55ab0b25389dcce3263b38a2de12c437b47751c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125821
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/download.lst b/download.lst
index df1aab85fc23..1cb460f01f66 100644
--- a/download.lst
+++ b/download.lst
@@ -237,8 +237,8 @@ export RHINO_SHA256SUM := 
1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131
 export RHINO_TARBALL := 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
 export SERF_SHA256SUM := 
549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc
 export SERF_TARBALL := serf-1.3.9.tar.bz2
-export SKIA_SHA256SUM := 
f69f9164ee982a8254722e1100aa7d31f78a5cd5e084418a3e202b55104fc3e2
-export SKIA_TARBALL := skia-m94-975fcdd755dfc5d57cddbb25857e0c4ac29abe98.tar.xz
+export SKIA_SHA256SUM := 
97e859e8467eca9d2441cd23079b61c2c3863b5687620f18cc31a9f966740177
+export SKIA_TARBALL := skia-m97-a7230803d64ae9d44f4e1282444801119a3ae967.tar.xz
 export STAROFFICE_SHA256SUM := 
f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db
 export STAROFFICE_VERSION_MICRO := 7
 export STAROFFICE_TARBALL := 
libstaroffice-0.0.$(STAROFFICE_VERSION_MICRO).tar.xz
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 92215b0935d2..d3c3dd2cae7c 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -169,6 +169,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/core/SkBlitter \
 UnpackedTarball/skia/src/core/SkBlitter_RGB565 \
 UnpackedTarball/skia/src/core/SkBlitter_Sprite \
+UnpackedTarball/skia/src/core/SkBlockAllocator \
 UnpackedTarball/skia/src/core/SkBlurMask \
 UnpackedTarball/skia/src/core/SkBlurMF \
 UnpackedTarball/skia/src/core/SkBuffer \
@@ -357,6 +358,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/effects/imagefilters/SkBlurImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkColorFilterImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkComposeImageFilter \
+UnpackedTarball/skia/src/effects/imagefilters/SkCropImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkDisplacementMapImageFilter 
\
 UnpackedTarball/skia/src/effects/imagefilters/SkDropShadowImageFilter \
 UnpackedTarball/skia/src/effects/imagefilters/SkImageImageFilter \
@@ -466,6 +468,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/dsl/priv/DSLWriter \
 UnpackedTarball/skia/src/sksl/ir/SkSLBinaryExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLBlock \
+UnpackedTarball/skia/src/sksl/ir/SkSLChildCall \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructor \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArray \
 UnpackedTarball/skia/src/sksl/ir/SkSLConstructorArrayCast \
@@ -482,8 +485,10 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/ir/SkSLForStatement \
 UnpackedTarball/skia/src/sksl/ir/SkSLFunctionCall \
 UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDeclaration \
+UnpackedTarball/skia/src/sksl/ir/SkSLFunctionDefinition \
 UnpackedTarball/skia/src/sksl/ir/SkSLIfStatement \
 UnpackedTarball/skia/src/sksl/ir/SkSLIndexExpression \
+UnpackedTarball/skia/src/sksl/ir/SkSLModifiers \
 UnpackedTarball/skia/src/sksl/ir/SkSLPrefixExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLPostfixExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLSetting \
@@ -492,10 +497,10 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 UnpackedTarball/skia/src/sksl/ir/SkSLSymbolTable \
 UnpackedTarball/skia/src/sksl/ir/SkSLTernaryExpression \
 UnpackedTarball/skia/src/sksl/ir/SkSLType \
+UnpackedTarball/skia/src/sksl/ir/SkSLTypeReference \
 UnpackedTarball/skia/src/sksl/ir/SkSLVarDeclarations \
 UnpackedTarball/skia/src/sksl/ir/SkSLVariable \
 UnpackedTarball/skia/src/sksl/ir/SkSLVariableReference \
-UnpackedTarball/skia/src/sksl/SkSLASTNode \
 UnpackedTarball/skia/src/sksl/SkSLAnalysis

[Libreoffice-commits] core.git: sc/source

2021-11-25 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/formulacell.cxx |5 -
 1 file changed, 5 deletions(-)

New commits:
commit a0e27322bebf5443ef895cb4c43d9288bcf13f9f
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 12:05:39 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 17:34:17 2021 +0100

use even hyper-thread cores for Calc threading

I assume the threading was originally limited only to real cores
because that's how many FPUs there are in the CPU. But Calc
dynamically allocates many data structures (ScFormulaCell most
notably), which means they end up scattered all over the memory,
and processing them often stalls on memory reads, leaving time
for other HT core to run. For data-heavy documents (such as using
VLOOKUP) using HT cores saves 30%, but I can see 10+% gains
even for compute-heavy documents.

Change-Id: I302b17e55f27541606d922a1f0b27005ce0f0ba8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125801
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 7299ba705ab6..44f0f7acdf2b 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4831,8 +4831,6 @@ bool 
ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope
 
 bDependencyComputed = true;
 
-const static bool bHyperThreadingActive = cpuid::hasHyperThreading();
-
 // Then do the threaded calculation
 
 class Executor : public comphelper::ThreadTask
@@ -4886,9 +4884,6 @@ bool 
ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope
 comphelper::ThreadPool& 
rThreadPool(comphelper::ThreadPool::getSharedOptimalPool());
 sal_Int32 nThreadCount = rThreadPool.getWorkerCount();
 
-if ( bHyperThreadingActive && nThreadCount >= 2 )
-nThreadCount /= 2;
-
 SAL_INFO("sc.threaded", "Running " << nThreadCount << " threads");
 
 o3tl::sorted_vector aFGSet;


[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source

2021-11-25 Thread Luboš Luňák (via logerrit)
 sc/inc/table.hxx   |4 ++
 sc/source/core/data/table3.cxx |   81 +
 2 files changed, 70 insertions(+), 15 deletions(-)

New commits:
commit 7b0aabe71d2455f6f643553a07f1056935cf190f
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 00:07:03 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 14:27:36 2021 +0100

sort, cache and binary search query items if they're many (tdf#136838)

This makes autofilter even with tdf#136838 almost instanteous.

Change-Id: I94b4b6d6ab6f8e73312d88c8b88c0f393707f117
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125795
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 332be67ee551..0bb6548d5dd9 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -959,6 +959,10 @@ public:
 struct ValidQueryCache
 {
 std::unordered_map 
mCachedSharedErrorStrings;
+std::vector mCachedSortedItemValues;
+std::vector mCachedSortedItemStrings;
+bool mCachedSortedItemValuesReady = false;
+bool mCachedSortedItemStringsReady = false;
 };
 bool ValidQuery(
 SCROW nRow, const ScQueryParam& rQueryParam, const ScRefCellValue* 
pCell = nullptr,
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 270c80b9ed73..4da4f23c59b4 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2971,7 +2971,7 @@ public:
 
 std::pair validQueryProcessEntry(SCROW nRow, SCCOL nCol, SCTAB 
nTab, const ScQueryParam& rParam,
 ScRefCellValue& aCell, bool* pbTestEqualCondition, const 
ScInterpreterContext* pContext, QueryEvaluator& aEval,
-const ScQueryEntry& rEntry )
+ScTable::ValidQueryCache* pValidQueryCache, const ScQueryEntry& rEntry )
 {
 std::pair aRes(false, false);
 const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
@@ -3007,14 +3007,35 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 valid = false;
 if(valid)
 {
-for (const auto& rItem : rItems)
+if(rItems.size() >= 100 && pValidQueryCache)
 {
-// For speed don't bother comparing approximately here, 
usually there either
-// will be an exact match or it wouldn't match anyway.
-if (rItem.meType == ScQueryEntry::ByValue
-&& value == rItem.mfVal)
+// Sort, cache and binary search for the value in items.
+// Don't bother comparing approximately.
+auto& values = pValidQueryCache->mCachedSortedItemValues;
+if(!pValidQueryCache->mCachedSortedItemValuesReady)
 {
+values.reserve(rItems.size());
+for (const auto& rItem : rItems)
+if (rItem.meType == ScQueryEntry::ByValue)
+values.push_back(rItem.mfVal);
+std::sort(values.begin(), values.end());
+pValidQueryCache->mCachedSortedItemValuesReady = true;
+}
+auto it = std::lower_bound(values.begin(), values.end(), 
value);
+if( it != values.end() && *it == value )
 return std::make_pair(true, true);
+}
+else
+{
+for (const auto& rItem : rItems)
+{
+// For speed don't bother comparing approximately here, 
usually there either
+// will be an exact match or it wouldn't match anyway.
+if (rItem.meType == ScQueryEntry::ByValue
+&& value == rItem.mfVal)
+{
+return std::make_pair(true, true);
+}
 }
 }
 }
@@ -3042,17 +3063,34 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 // generous as isQueryByString() but it should be enough and better be 
safe.
 if(cellSharedString != nullptr)
 {
-if (rParam.bCaseSens)
+if(rItems.size() >= 100 && pValidQueryCache)
 {
-for (const auto& rItem : rItems)
+// Sort, cache and binary search for the string in items.
+// Since each SharedString is identified by pointer value,
+// sorting by pointer value is enough.
+auto& values = pValidQueryCache->mCachedSortedItemStrings;
+if(!pValidQueryCache->mCachedSortedItemStringsReady)
 {
-if ((rItem.meType == ScQueryEntry::ByString
-|| (compareByValue && rItem.meType == 
ScQueryEntry::ByValue))
-   

[Libreoffice-commits] core.git: 2 commits - cui/inc cui/source extensions/inc extensions/source filter/source forms/source formula/inc fpicker/inc icon-themes/breeze icon-themes/breeze_dark icon-theme

2021-11-25 Thread Luboš Luňák (via logerrit)
 cui/inc/bitmaps.hlst  |   79 +--
 cui/source/tabpages/border.cxx|   82 ++--
 extensions/inc/bitmaps.hlst   |4 
 extensions/inc/helpids.h  |   13 -
 extensions/inc/propctrlr.h|4 
 extensions/source/propctrlr/defaultforminspection.cxx |2 
 extensions/source/propctrlr/formcomponenthandler.cxx  |4 
 extensions/source/propctrlr/formstrings.hxx   |5 
 filter/source/config/cache/constant.hxx   |1 
 forms/source/inc/frm_strings.hxx  |6 
 forms/source/inc/services.hxx |7 -
 formula/inc/bitmaps.hlst  |1 
 fpicker/inc/bitmaps.hlst  |1 
 icon-themes/breeze/links.txt  |2 
 icon-themes/breeze_dark/links.txt |2 
 icon-themes/colibre/links.txt |2 
 icon-themes/elementary/links.txt  |1 
 icon-themes/karasa_jaga/links.txt |1 
 icon-themes/sifr/links.txt|2 
 icon-themes/sifr_dark/links.txt   |2 
 icon-themes/sukapura/links.txt|2 
 sc/source/core/data/table3.cxx|  119 +++---
 22 files changed, 157 insertions(+), 185 deletions(-)

New commits:
commit 7270f6f485f7b1308992bda059b3f874705c38db
Author: Luboš Luňák 
AuthorDate: Wed Nov 24 12:33:06 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 14:27:08 2021 +0100

avoid repeated checks with same result on fast lookup path

Change the compareByString() function to a template with a bool
parameter that will disable all the checks, allowing the compiler
to effectively generate just a small inline function. And then
compute the bool value once and call the fast version if true.
With comment #2 in tdf#136838 this actually saves 40% of time.

Change-Id: I5a5190f19a1df163b28e527090ec880e6de5bbda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125768
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 6012deb77540..877aeede34d8 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2597,12 +2597,12 @@ public:
 }
 }
 
-// The value is placed inside one parameter: [pValueSource1] or 
[pValueSource2] but never in both.
-std::pair compareByString(const ScQueryEntry& rEntry, const 
ScQueryEntry::Item& rItem,
-const svl::SharedString* pValueSource1, const OUString * pValueSource2)
+bool isFastCompareByString(const ScQueryEntry& rEntry) const
 {
-bool bOk = false;
-bool bTestEqual = false;
+// If this is true, then there's a fast path in compareByString() which
+// can be selected using the template argument to get fast code
+// that will not check the same conditions every time. This makes a 
difference
+// in fast lookups that search for an exact value (case sensitive or 
not).
 bool bMatchWholeCell = mbMatchWholeCell;
 if (isPartialTextMatchOp(rEntry))
 // may have to do partial textural comparison.
@@ -2611,10 +2611,37 @@ public:
 const bool bRealWildOrRegExp = isRealWildOrRegExp(rEntry);
 const bool bTestWildOrRegExp = isTestWildOrRegExp(rEntry);
 
+// SC_EQUAL is part of isTextMatchOp(rEntry)
+return rEntry.eOp == SC_EQUAL && !bRealWildOrRegExp && 
!bTestWildOrRegExp && bMatchWholeCell;
+}
+
+// The value is placed inside one parameter: [pValueSource1] or 
[pValueSource2] but never in both.
+// For the template argument see isFastCompareByString().
+template
+std::pair compareByString(const ScQueryEntry& rEntry, const 
ScQueryEntry::Item& rItem,
+const svl::SharedString* pValueSource1, const OUString * pValueSource2)
+{
+bool bOk = false;
+bool bTestEqual = false;
+bool bMatchWholeCell;
+if(bFast)
+bMatchWholeCell = true;
+else
+{
+bMatchWholeCell = mbMatchWholeCell;
+if (isPartialTextMatchOp(rEntry))
+// may have to do partial textural comparison.
+bMatchWholeCell = false;
+}
+
+const bool bRealWildOrRegExp = !bFast && isRealWildOrRegExp(rEntry);
+const bool bTestWildOrRegExp = !bFast && isTestWildOrRegExp(rEntry);
+
+assert(!bFast || pValueSource1 != nullptr); // shared string for fast 
path
 // [pValueSource1] or [pValueSource2] but never both of them or none 
of them
 assert((pValueSource1 != nullptr) != (pValueSource2 != nullptr));
 
-if ( b

[Libreoffice-commits] core.git: sc/source

2021-11-25 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |  121 +
 1 file changed, 99 insertions(+), 22 deletions(-)

New commits:
commit 1d0cdc461c43f0ce0eda4961311a972edf9e78e2
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 20:48:02 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 14:26:42 2021 +0100

try to search efficiently with a query with many items (tdf#133867)

Autofilter with large documents can create queries that have thousands
of items. Searching all of those for every cell using the generic
algorithm can be quite slow. First try an optimized search for this
case that skips most of the complications and just tries to find
in the query items an exact match for the cell. This significantly
speeds up tdf#133867 or attachment from comment #2 in tdf#136838.

Change-Id: I2bba18da6a101c76398d8c42c4306c53682899c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125746
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 49c075121b61..6012deb77540 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2367,25 +2367,6 @@ class QueryEvaluator
 return false;
 }
 
-bool isRealWildOrRegExp(const ScQueryEntry& rEntry) const
-{
-if (mrParam.eSearchType == utl::SearchParam::SearchType::Normal)
-return false;
-
-return isTextMatchOp(rEntry);
-}
-
-bool isTestWildOrRegExp(const ScQueryEntry& rEntry) const
-{
-if (!mpTestEqualCondition)
-return false;
-
-if (mrParam.eSearchType == utl::SearchParam::SearchType::Normal)
-return false;
-
-return (rEntry.eOp == SC_LESS_EQUAL || rEntry.eOp == SC_GREATER_EQUAL);
-}
-
 void setupTransliteratorIfNeeded()
 {
 if (!mpTransliteration)
@@ -2414,6 +2395,25 @@ public:
 {
 }
 
+bool isRealWildOrRegExp(const ScQueryEntry& rEntry) const
+{
+if (mrParam.eSearchType == utl::SearchParam::SearchType::Normal)
+return false;
+
+return isTextMatchOp(rEntry);
+}
+
+bool isTestWildOrRegExp(const ScQueryEntry& rEntry) const
+{
+if (!mpTestEqualCondition)
+return false;
+
+if (mrParam.eSearchType == utl::SearchParam::SearchType::Normal)
+return false;
+
+return (rEntry.eOp == SC_LESS_EQUAL || rEntry.eOp == SC_GREATER_EQUAL);
+}
+
 static bool isQueryByValue(
 const ScQueryEntry::Item& rItem, ScRefCellValue& rCell)
 {
@@ -2937,7 +2937,7 @@ public:
 
 std::pair validQueryProcessEntry(SCROW nRow, SCCOL nCol, SCTAB 
nTab, const ScQueryParam& rParam,
 ScRefCellValue& aCell, bool* pbTestEqualCondition, const 
ScInterpreterContext* pContext, QueryEvaluator& aEval,
-const ScQueryEntry& rEntry )
+const ScDocument& rDoc, const ScQueryEntry& rEntry )
 {
 std::pair aRes(false, false);
 const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
@@ -2952,10 +2952,87 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 }
 return aRes;
 }
-// Generic handling.
+if( rEntry.eOp == SC_EQUAL && rItems.size() >= 10 )
+{
+// If there are many items to query for (autofilter does this), then 
try to search
+// efficiently in those items. So first search all the items of the 
relevant type,
+// If that does not find anything, fall back to the generic code.
+double value = 0;
+bool valid = true;
+// For ScQueryEntry::ByValue check that the cell either is a value or 
is a formula
+// that has a value and is not an error (those are compared as 
strings). This
+// is basically simplified isQueryByValue().
+if( aCell.meType == CELLTYPE_VALUE )
+value = aCell.mfValue;
+else if (aCell.meType == CELLTYPE_FORMULA && 
aCell.mpFormula->GetErrCode() != FormulaError::NONE
+&& aCell.mpFormula->IsValue())
+{
+value = aCell.mpFormula->GetValue();
+}
+else
+valid = false;
+if(valid)
+{
+for (const auto& rItem : rItems)
+{
+// For speed don't bother comparing approximately here, 
usually there either
+// will be an exact match or it wouldn't match anyway.
+if (rItem.meType == ScQueryEntry::ByValue
+&& value == rItem.mfVal)
+{
+return std::make_pair(true, true);
+}
+}
+}
+}
 const svl::SharedString* cellSharedString = nullptr;
 OUString cellString;
 bool cellStringSet = false;
+if( rEntry.eOp == SC_EQUAL && rItems.size() >= 10 )
+{
+// The same as above

[Libreoffice-commits] core.git: sc/source

2021-11-25 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

New commits:
commit 02f3157f75b654ef7648efdc3004b3f326d5af40
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 13:09:40 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 14:26:26 2021 +0100

don't fetch cell string content for each query item (tdf#133804)

When using autofilter, the query entry can have thousands of items,
and fetching of the cell string value is not trivial in some cases.

I'm not doing this for numeric values, as those depend on query
items and also seem fairly fast.

Change-Id: I01fa2e0cbce8f770d1ed079c0dba74830402a895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125735
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index c8ba5c882234..49c075121b61 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2561,9 +2561,8 @@ public:
 return std::pair(bOk, bTestEqual);
 }
 
-std::pair compareByString(
-const ScRefCellValue& rCell, SCROW nRow, const ScQueryEntry& rEntry, 
const ScQueryEntry::Item& rItem,
-const ScInterpreterContext* pContext)
+OUString getCellString(const ScRefCellValue& rCell, SCROW nRow, const 
ScQueryEntry& rEntry,
+const ScInterpreterContext* pContext, const svl::SharedString** 
sharedString)
 {
 if (rCell.meType == CELLTYPE_FORMULA && rCell.mpFormula->GetErrCode() 
!= FormulaError::NONE)
 {
@@ -2579,33 +2578,27 @@ public:
 assert(pos.second); // inserted
 it = pos.first;
 }
-const svl::SharedString& sharedError = it->second;
-return compareByStringComparator(rEntry, rItem, , 
nullptr);
+*sharedString = >second;
+return OUString();
 }
-const OUString aCellStr = 
ScGlobal::GetErrorString(rCell.mpFormula->GetErrCode());
-return compareByStringComparator(rEntry, rItem, nullptr, 
);
+return ScGlobal::GetErrorString(rCell.mpFormula->GetErrCode());
 }
 else if (rCell.meType == CELLTYPE_STRING)
 {
-return compareByStringComparator(rEntry, rItem, rCell.mpString, 
nullptr);
+*sharedString = rCell.mpString;
+return OUString();
 }
 else
 {
 sal_uInt32 nFormat = pContext ? mrTab.GetNumberFormat( *pContext, 
ScAddress(static_cast(rEntry.nField), nRow, mrTab.GetTab()) ) :
 mrTab.GetNumberFormat( static_cast(rEntry.nField), nRow 
);
 SvNumberFormatter* pFormatter = pContext ? 
pContext->GetFormatTable() : mrDoc.GetFormatTable();
-const svl::SharedString* sharedString = nullptr;
-OUString aStr = ScCellFormat::GetInputString(rCell, nFormat, 
*pFormatter, mrDoc, , rEntry.bDoQuery);
-// Use the shared string for less conversions, if available.
-if( sharedString != nullptr )
-return compareByStringComparator(rEntry, rItem, sharedString, 
nullptr);
-return compareByStringComparator(rEntry, rItem, nullptr, );
+return ScCellFormat::GetInputString(rCell, nFormat, *pFormatter, 
mrDoc, sharedString, rEntry.bDoQuery);
 }
 }
 
-// Called from compareByString() method, where different sources of 
strings are checked.
 // The value is placed inside one parameter: [pValueSource1] or 
[pValueSource2] but never in both.
-std::pair compareByStringComparator(const ScQueryEntry& rEntry, 
const ScQueryEntry::Item& rItem,
+std::pair compareByString(const ScQueryEntry& rEntry, const 
ScQueryEntry::Item& rItem,
 const svl::SharedString* pValueSource1, const OUString * pValueSource2)
 {
 bool bOk = false;
@@ -2960,6 +2953,9 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 return aRes;
 }
 // Generic handling.
+const svl::SharedString* cellSharedString = nullptr;
+OUString cellString;
+bool cellStringSet = false;
 for (const auto& rItem : rItems)
 {
 if (rItem.meType == ScQueryEntry::ByTextColor)
@@ -2985,8 +2981,14 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 }
 else if (QueryEvaluator::isQueryByString(rEntry, rItem, aCell))
 {
-std::pair aThisRes =
-aEval.compareByString(aCell, nRow, rEntry, rItem, pContext);
+if(!cellStringSet)
+{
+cellString = aEval.getCellString(aCell, nRow, rEntry, 
pContext, );
+cellStringSet = true;
+}
+std::pair aThisRes = cellSharedString
+? aEval.compareByString(rEntry, rItem, cellSharedString, 
nu

[Libreoffice-commits] core.git: configure.ac

2021-11-25 Thread Luboš Luňák (via logerrit)
 configure.ac |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit b041897b767ea4d6c64f4d22036d23f61d6907f5
Author: Luboš Luňák 
AuthorDate: Thu Nov 25 11:16:15 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 25 13:12:19 2021 +0100

fix windows ccache support

I accidentally pushed an older version of the commit.
PCHs work fine with ccache, so no need to disable one or another.
And $COM is not set yet at the time when ccache is detected, so
use $os instead.

Change-Id: I1802684d6bbdee940b7062be0b8010a887216834
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125800
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 593170c4572a..9a5df92f922f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3068,8 +3068,6 @@ elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" 
-a "$enable_icecream"
 AC_PATH_PROG([CCACHE],[ccache],[not found])
 if test "$CCACHE" != "not found" -a "$_os" = "WINNT"; then
 CCACHE=`win_short_path_for_make "$CCACHE"`
-fi
-if test "$CCACHE" != "not found" -a "$COM" = MSC; then
 # check that it has MSVC support (it should recognize it in 
CCACHE_COMPILERTYPE)
 rm -f conftest.txt
 AC_MSG_CHECKING([whether $CCACHE has MSVC support])
@@ -5928,8 +5926,8 @@ if test -z "$enable_pch"; then
 if test "$_os" = "WINNT"; then
 # Enabled by default on Windows.
 enable_pch=yes
-# never use [s]ccache on auto-enabled PCH builds, except if requested 
explicitly
-if test -z "$enable_ccache"; then
+# never use sccache on auto-enabled PCH builds, except if requested 
explicitely
+if test -z "$enable_ccache" -a "$SCCACHE"; then
 CCACHE=""
 fi
 else


Re: clang vs gcc build performance (executable not build time)

2021-11-24 Thread Luboš Luňák
On Tuesday 23 of November 2021, Luboš Luňák wrote:
> > >   OpenSUSE 7.2Clang + libc++  Clang + std Gcc + std
> > > Run 1 50,92304527545,45644158745,87827528749,487550577
>
>  Do you have more tests than this one? With the data you've provided that's
> good enough as an indicator that it should be investigated, but not much
> more, as there can be various factors that cause such results. Maybe Clang
> just happened to optimize better one function that's called often in this
> case, maybe one of the compilers is older than the older, maybe whatever
> else.
>
>  Can you try more different tests?

 By the way, if you're testing LO performance, you should use build settings 
that try to match what is used for release builds. You can find the setups in 
the distro-configs directory. In particular --enable-mergelibs --enable-lto 
are two flags that could have a significant impact on your results.

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   14 --
 1 file changed, 14 deletions(-)

New commits:
commit 071a3894013ea2281c157ba0a786e205c1119bba
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 12:44:20 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 24 08:21:54 2021 +0100

remove superfluous code that has a TODO note about it

The commits introducing this part of code have tests attached,
so it's fairly easy to check that this part of code is in fact
not necessary, but if in doubt there's the option of simply asking
the author of the code.

Change-Id: I3b754090ac462d3ae8e4676fc1643570ec53aac1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125695
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 0fe6b10b0ba3..42d74aece6b5 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2527,20 +2527,6 @@ public:
 }
 }
 }
-else if (rItem.mbRoundForFilter && fQueryVal != 0.0)
-{
-/* TODO: shouldn't rItem.mfVal (which fQueryVal is) already had
- * been stored as rounded in all cases if needed so this extra
- * rounding is superfluous? Or rather, if not, then rounding it
- * here may produce different roundings for different cell number
- * formats, which is odd. This all looks suspicious and the
- * intention of tdf#142910 commit
- * f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d isn't quite clear. */
-if (nNumFmt == NUMBERFORMAT_ENTRY_NOT_FOUND)
-nNumFmt = getNumFmt( nCol, nRow, pContext);
-if (nNumFmt)
-fQueryVal = mrDoc.RoundValueAsShown(fQueryVal, nNumFmt, 
pContext);
-}
 
 switch (rEntry.eOp)
 {


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit ed9eff7d91dcf7ffb87906422be61606e3117fae
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 19:09:43 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 23:40:11 2021 +0100

short-circut SC_AND lookup if left side is known to be false

Change-Id: Ia1badb975f4effca668a5c2a41cfef3beccf8e2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125739
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 9c926fadf4fb..0fe6b10b0ba3 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3043,6 +3043,18 @@ bool ScTable::ValidQuery(
 for (it = itBeg; it != itEnd && (*it)->bDoQuery; ++it)
 {
 const ScQueryEntry& rEntry = **it;
+
+// Short-circuit the test at the end of the loop - if this is SC_AND
+// and the previous value is false, this value will not be needed.
+// Disbable this if pbTestEqualCondition is present as that one may 
get set
+// even if the result is false (that also means pTest doesn't need to 
be
+// handled here).
+if (rEntry.eConnect == SC_AND && pbTestEqualCondition == nullptr
+ && nPos != -1 && !pPasst[nPos])
+{
+continue;
+}
+
 SCCOL nCol = static_cast(rEntry.nField);
 
 // We can only handle one single direct query passed as a known pCell,


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/tool/cellform.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 990d32dad6bdf5d92a14d8bc02ae2853facd9097
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 21:15:23 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 22:41:28 2021 +0100

allow matching of empty cells as svl::SharedString (tdf#133804)

This may speed up some lookups.

Change-Id: I13a39abc43c64eb758fa55a6cdbda3e83e179121
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125743
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index bc46c4567744..da81abba383c 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -174,6 +174,10 @@ OUString ScCellFormat::GetInputString(
 
 return str;
 }
+case CELLTYPE_NONE:
+if( pShared != nullptr )
+*pShared = ::SharedString::getEmptyString();
+return OUString();
 default:
 return OUString();
 }


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/tool/cellform.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 83f82cb6efa3ae40fe04f1180a3da64abe92980c
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 16:05:18 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 21:43:02 2021 +0100

set empty value if not returning a shared string

This is strictly speaking not necessary if callers would always
initialize to nullptr, but I guess this is better.

Change-Id: Ica88395e0f615afbd58efa71e5d64bfdd2a37319
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125734
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 9c77246e2286..bc46c4567744 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -131,6 +131,8 @@ OUString ScCellFormat::GetInputString(
 const ScRefCellValue& rCell, sal_uInt32 nFormat, SvNumberFormatter& 
rFormatter, const ScDocument& rDoc,
 const svl::SharedString** pShared, bool bFiltering )
 {
+if(pShared != nullptr)
+*pShared = nullptr;
 switch (rCell.meType)
 {
 case CELLTYPE_STRING:


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2e0d5203b0b8133ebc2e6f90c0e0a24962f144f2
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 13:35:58 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 20:54:44 2021 +0100

do not wait for condition that's not needed

When not querying for the test equal condition, it's pointless
to keep searching for it to become true only to throw it away.

Change-Id: Ie861bac141f80025e95753fb8b1202498df17383
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125733
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d0311e1d191e..9c926fadf4fb 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2957,7 +2957,7 @@ public:
 };
 
 std::pair validQueryProcessEntry(SCROW nRow, SCCOL nCol, SCTAB 
nTab, const ScQueryParam& rParam,
-ScRefCellValue& aCell, const ScInterpreterContext* pContext, 
QueryEvaluator& aEval,
+ScRefCellValue& aCell, bool* pbTestEqualCondition, const 
ScInterpreterContext* pContext, QueryEvaluator& aEval,
 const ScQueryEntry& rEntry )
 {
 std::pair aRes(false, false);
@@ -3012,7 +3012,7 @@ std::pair validQueryProcessEntry(SCROW nRow, 
SCCOL nCol, SCTAB nTab,
 aRes.second |= aThisRes.second;
 }
 
-if (aRes.first && aRes.second)
+if (aRes.first && (aRes.second || pbTestEqualCondition == nullptr))
 break;
 }
 return aRes;
@@ -3058,8 +3058,8 @@ bool ScTable::ValidQuery(
 else
 aCell = GetCellValue(nCol, nRow);
 
-std::pair aRes = validQueryProcessEntry(nRow, nCol, nTab, 
rParam, aCell, pContext,
-aEval, rEntry);
+std::pair aRes = validQueryProcessEntry(nRow, nCol, nTab, 
rParam, aCell,
+pbTestEqualCondition, pContext, aEval, rEntry);
 
 if (nPos == -1)
 {


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |  121 +
 1 file changed, 64 insertions(+), 57 deletions(-)

New commits:
commit f606ddd86ba402661e4989718e8b8b8e6e2c2f65
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 11:47:10 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 20:54:27 2021 +0100

move code to a separate function

To be extended in following commits.

Change-Id: I09eaf0f5cfdbbe0aff254231dbb983fd7f72cc5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125732
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 9455b3d2f856..d0311e1d191e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2956,6 +2956,68 @@ public:
 }
 };
 
+std::pair validQueryProcessEntry(SCROW nRow, SCCOL nCol, SCTAB 
nTab, const ScQueryParam& rParam,
+ScRefCellValue& aCell, const ScInterpreterContext* pContext, 
QueryEvaluator& aEval,
+const ScQueryEntry& rEntry )
+{
+std::pair aRes(false, false);
+const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
+if (rItems.size() == 1 && rItems.front().meType == ScQueryEntry::ByEmpty)
+{
+if (rEntry.IsQueryByEmpty())
+aRes.first = aCell.isEmpty();
+else
+{
+assert(rEntry.IsQueryByNonEmpty());
+aRes.first = !aCell.isEmpty();
+}
+return aRes;
+}
+// Generic handling.
+for (const auto& rItem : rItems)
+{
+if (rItem.meType == ScQueryEntry::ByTextColor)
+{
+std::pair aThisRes
+= aEval.compareByTextColor(nCol, nRow, nTab, rItem);
+aRes.first |= aThisRes.first;
+aRes.second |= aThisRes.second;
+}
+else if (rItem.meType == ScQueryEntry::ByBackgroundColor)
+{
+std::pair aThisRes =
+aEval.compareByBackgroundColor(nCol, nRow, nTab, rItem);
+aRes.first |= aThisRes.first;
+aRes.second |= aThisRes.second;
+}
+else if (QueryEvaluator::isQueryByValue(rItem, aCell))
+{
+std::pair aThisRes =
+aEval.compareByValue(aCell, nCol, nRow, rEntry, rItem, 
pContext);
+aRes.first |= aThisRes.first;
+aRes.second |= aThisRes.second;
+}
+else if (QueryEvaluator::isQueryByString(rEntry, rItem, aCell))
+{
+std::pair aThisRes =
+aEval.compareByString(aCell, nRow, rEntry, rItem, pContext);
+aRes.first |= aThisRes.first;
+aRes.second |= aThisRes.second;
+}
+else if (rParam.mbRangeLookup)
+{
+std::pair aThisRes =
+QueryEvaluator::compareByRangeLookup(aCell, rEntry, rItem);
+aRes.first |= aThisRes.first;
+aRes.second |= aThisRes.second;
+}
+
+if (aRes.first && aRes.second)
+break;
+}
+return aRes;
+}
+
 }
 
 bool ScTable::ValidQuery(
@@ -2996,63 +3058,8 @@ bool ScTable::ValidQuery(
 else
 aCell = GetCellValue(nCol, nRow);
 
-std::pair aRes(false, false);
-
-const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
-if (rItems.size() == 1 && rItems.front().meType == 
ScQueryEntry::ByEmpty)
-{
-if (rEntry.IsQueryByEmpty())
-aRes.first = aCell.isEmpty();
-else
-{
-assert(rEntry.IsQueryByNonEmpty());
-aRes.first = !aCell.isEmpty();
-}
-}
-else
-{
-for (const auto& rItem : rItems)
-{
-if (rItem.meType == ScQueryEntry::ByTextColor)
-{
-std::pair aThisRes
-= aEval.compareByTextColor(nCol, nRow, nTab, rItem);
-aRes.first |= aThisRes.first;
-aRes.second |= aThisRes.second;
-}
-else if (rItem.meType == ScQueryEntry::ByBackgroundColor)
-{
-std::pair aThisRes =
-aEval.compareByBackgroundColor(nCol, nRow, nTab, 
rItem);
-aRes.first |= aThisRes.first;
-aRes.second |= aThisRes.second;
-}
-else if (QueryEvaluator::isQueryByValue(rItem, aCell))
-{
-std::pair aThisRes =
-aEval.compareByValue(aCell, nCol, nRow, rEntry, rItem, 
pContext);
-aRes.first |= aThisRes.first;
-aRes.second |= aThisRes.second;
-}
-else if (QueryEvaluator::isQueryByString(rEntry, rItem, aCell))
-{
-std::pair aThisRes =
-aEv

[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 9f4934c6682697fa7e77953d9b0e558e1a88d017
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 11:18:53 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 20:53:59 2021 +0100

do not fetch cell data if ScRefValueCell can tell that

Change-Id: I2910231c9cf205ce697616e660e49056c221e89d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125731
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a0c3428b2c98..9455b3d2f856 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3001,20 +3001,12 @@ bool ScTable::ValidQuery(
 const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
 if (rItems.size() == 1 && rItems.front().meType == 
ScQueryEntry::ByEmpty)
 {
-bool hasData;
-if( pBlockPos )
-{
-ScColumn* column = FetchColumn(rEntry.nField);
-hasData = 
column->HasDataAt(*pBlockPos->getBlockPosition(rEntry.nField), nRow);
-}
-else
-hasData = aCol[rEntry.nField].HasDataAt(nRow);
 if (rEntry.IsQueryByEmpty())
-aRes.first = !hasData;
+aRes.first = aCell.isEmpty();
 else
 {
 assert(rEntry.IsQueryByNonEmpty());
-aRes.first = hasData;
+aRes.first = !aCell.isEmpty();
 }
 }
 else


Re: clang vs gcc build performance (executable not build time)

2021-11-23 Thread Luboš Luňák
On Tuesday 23 of November 2021, Mike Kaganski wrote:
> The only thing I would love to note is that besides performance, there's
> also usability of development tools that matters. If changing to Clang
> as compiler on Windows would mean we can't use Visual Studio's debugger
> (or its use would be less efficient), it would be a really sad thing.
> OTOH, I hope that today, Visual Studio works much better with
> clang-built binaries (it even suggests clang as part of its components
> when installing, which we use for Skia, so we already have it on Windows
> development systems).

 Since we already do use Clang for Skia, you can try. If I set a breakpoint 
e.g. on SkSurface::flushAndSubmit(), I can step there just fine (probably 
helped by building with --enable-skia=debug, which builds without 
optimizations, but I'd expect to work even with normal LO Skia build).

-- 
 Luboš Luňák
 l.lu...@collabora.com


Re: clang vs gcc build performance (executable not build time)

2021-11-23 Thread Luboš Luňák
On Tuesday 23 of November 2021, Michael Meeks wrote:
> On 22/11/2021 16:28, Arnaud Versini wrote:
> > There is no
> > significant difference between both clang builds (changing lib C++ from
> > libstdc++ to libc++) but gcc is slower than clang. Of course all builds
> > don't use system libraries in this case to compare between lib C++, and
> > builds are optimised and use LTO.
>
>   Looks interesting.
>
>   Lubos - what are our build defaults currently and do you have thoughts
> on changing them ? it would be great to poke at Arnaud's blog / work
> as/when it gets published =)

 That decision is not really up to me. AFAIK projects like Firefox or Chromium 
build exclusively using Clang. I wouldn't mind using Clang for everything, 
but I don't know how others would see that.

> > OpenSUSE 7.2Clang + libc++  Clang + std Gcc + std
> > Run 1   50,92304527545,45644158745,87827528749,487550577

 Do you have more tests than this one? With the data you've provided that's 
good enough as an indicator that it should be investigated, but not much 
more, as there can be various factors that cause such results. Maybe Clang 
just happened to optimize better one function that's called often in this 
case, maybe one of the compilers is older than the older, maybe whatever 
else.

 Can you try more different tests?

> > I also noticed that libengine12 is really bigger with GCC but I've not
> > have that data on me now.
>
>   That's interesting too - how much bigger? I would assume that we use
> -Os to optimize for size as well as for speed: since huge binaries may
> be more optimal in theory but can be much slower to load and kill your
> cache in practice: but it sounds like this is some combination of bigger
> & slower.

 We don't use -Os, at least my local optimized build doesn't. A bunch of 
solenv/gbuild/platform files do set it, but it doesn't get selected here. And 
if it's because my build uses Clang and those -Os get used only with GCC and 
not Clang, then incidentally that would solve the whole mystery. Checking 
what flags get used for both builds is certainly something that should be 
done. Arnaud?

 And according to logs those -Os come from at least 10 years ago, so if the 
idea is to use them, maybe it would be a good idea to re-check the effect 
they have. I'm personally sceptical that -Os would help on the desktop.

>   I wonder what the compile option difference is.

 Theoretically there shouldn't be any difference related to performance. There 
are differences in handling PCHs, some debuginfo options may be different and 
stuff like that, but AFAIK performance flags should be the same. Although, as 
said above, maybe that's not the case.

> > I hope this could be an idea of improvement ! Next crazy test I would
> > like to do is between MSVC and clang on windows ! But it seems harder !

 Stephan Bergmann does clang-cl builds on Windows, so it should work, although 
I don't remember how difficult it is to set up.

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: sc/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |  160 -
 1 file changed, 64 insertions(+), 96 deletions(-)

New commits:
commit 3bb2507a44ef57e02bb6008206ca29c57fb87048
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 09:24:18 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 16:11:36 2021 +0100

do not try to read table cell again on ScRefCellValue::isEmpty()

The ScRefCellValue is always initialized to point to the relevant
cell. Originally there used to be a cell pointer that could be
null, but since 43e50ec759200fe166dba59d3ff76af2a2e148c8 it's been
always set and so checking again is pointless.

Change-Id: Ib661ec5de73891ed3a5cd0346287324183721806
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125687
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 6ff12c4a25b5..a0c3428b2c98 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2414,27 +2414,22 @@ public:
 {
 }
 
-bool isQueryByValue(
-const ScQueryEntry::Item& rItem, SCCOL nCol, SCROW nRow, 
ScRefCellValue& rCell)
+static bool isQueryByValue(
+const ScQueryEntry::Item& rItem, ScRefCellValue& rCell)
 {
 if (rItem.meType == ScQueryEntry::ByString)
 return false;
 
-if (!rCell.isEmpty())
-{
-if (rCell.meType == CELLTYPE_FORMULA && 
rCell.mpFormula->GetErrCode() != FormulaError::NONE)
-// Error values are compared as string.
-return false;
-
-return rCell.hasNumeric();
-}
+if (rCell.meType == CELLTYPE_FORMULA && rCell.mpFormula->GetErrCode() 
!= FormulaError::NONE)
+// Error values are compared as string.
+return false;
 
-return mrTab.HasValueData(nCol, nRow);
+return rCell.hasNumeric();
 }
 
-bool isQueryByString(
+static bool isQueryByString(
 const ScQueryEntry& rEntry, const ScQueryEntry::Item& rItem,
-SCCOL nCol, SCROW nRow, const ScRefCellValue& rCell)
+const ScRefCellValue& rCell)
 {
 if (isTextMatchOp(rEntry))
 return true;
@@ -2442,10 +2437,7 @@ public:
 if (rItem.meType != ScQueryEntry::ByString)
 return false;
 
-if (!rCell.isEmpty())
-return rCell.hasString();
-
-return mrTab.HasStringData(nCol, nRow);
+return rCell.hasString();
 }
 
 sal_uInt32 getNumFmt( SCCOL nCol, SCROW nRow, const ScInterpreterContext* 
pContext )
@@ -2474,38 +2466,33 @@ public:
 // reason.
 sal_uInt32 nNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND;
 
-if (!rCell.isEmpty())
+switch (rCell.meType)
 {
-switch (rCell.meType)
-{
-case CELLTYPE_VALUE :
-nCellVal = rCell.mfValue;
-break;
-case CELLTYPE_FORMULA :
-nCellVal = rCell.mpFormula->GetValue();
-break;
-default:
-nCellVal = 0.0;
-}
-if (rItem.mbRoundForFilter && nCellVal != 0.0)
+case CELLTYPE_VALUE :
+nCellVal = rCell.mfValue;
+break;
+case CELLTYPE_FORMULA :
+nCellVal = rCell.mpFormula->GetValue();
+break;
+default:
+nCellVal = 0.0;
+}
+if (rItem.mbRoundForFilter && nCellVal != 0.0)
+{
+nNumFmt = getNumFmt( nCol, nRow, pContext);
+if (nNumFmt)
 {
-nNumFmt = getNumFmt( nCol, nRow, pContext);
-if (nNumFmt)
+switch (rCell.meType)
 {
-switch (rCell.meType)
-{
-case CELLTYPE_VALUE :
-case CELLTYPE_FORMULA :
-nCellVal = mrDoc.RoundValueAsShown(nCellVal, 
nNumFmt, pContext);
-break;
-default:
-assert(!"can't be");
-}
+case CELLTYPE_VALUE :
+case CELLTYPE_FORMULA :
+nCellVal = mrDoc.RoundValueAsShown(nCellVal, nNumFmt, 
pContext);
+break;
+default:
+assert(!"can't be");
 }
 }
 }
-else
-nCellVal = mrTab.GetValue(nCol, nRow);
 
 /* NOTE: lcl_PrepareQuery() prepares a filter query such that if a
  * date+time format was queried rEntry.bQueryByDate is not set. In
@@ -2592,49 +2579,38 @@ public:
 const ScRefCellValue& rCell, SCROW nRow, const ScQueryEntry& rEntry, 
const ScQu

[Libreoffice-commits] core.git: include/svl svl/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 include/svl/sharedstring.hxx |   83 +++
 svl/source/misc/sharedstring.cxx |   83 ---
 2 files changed, 83 insertions(+), 83 deletions(-)

New commits:
commit 3f66e00c937f787129bac034798b74d5b72ef76f
Author: Luboš Luňák 
AuthorDate: Tue Nov 23 14:05:20 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 16:07:53 2021 +0100

make a bunch of svl::SharedString functions inline

They are tiny and they are used in performance-critical parts
of Calc.

Change-Id: If227b11ac7929dd1369545a590d8ef1a977185f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125698
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/svl/sharedstring.hxx b/include/svl/sharedstring.hxx
index f74824adeec2..050bd8dd9e55 100644
--- a/include/svl/sharedstring.hxx
+++ b/include/svl/sharedstring.hxx
@@ -50,6 +50,89 @@ public:
 sal_Int32 getLength() const;
 };
 
+inline SharedString::SharedString() : mpData(nullptr), 
mpDataIgnoreCase(nullptr) {}
+
+inline SharedString::SharedString( rtl_uString* pData, rtl_uString* 
pDataIgnoreCase ) :
+mpData(pData), mpDataIgnoreCase(pDataIgnoreCase)
+{
+if (mpData)
+rtl_uString_acquire(mpData);
+if (mpDataIgnoreCase)
+rtl_uString_acquire(mpDataIgnoreCase);
+}
+
+inline SharedString::SharedString( const OUString& rStr ) : 
mpData(rStr.pData), mpDataIgnoreCase(nullptr)
+{
+rtl_uString_acquire(mpData);
+}
+
+inline SharedString::SharedString( const SharedString& r ) : mpData(r.mpData), 
mpDataIgnoreCase(r.mpDataIgnoreCase)
+{
+if (mpData)
+rtl_uString_acquire(mpData);
+if (mpDataIgnoreCase)
+rtl_uString_acquire(mpDataIgnoreCase);
+}
+
+inline SharedString::SharedString(SharedString&& r) noexcept : 
mpData(r.mpData), mpDataIgnoreCase(r.mpDataIgnoreCase)
+{
+r.mpData = nullptr;
+r.mpDataIgnoreCase = nullptr;
+}
+
+inline SharedString::~SharedString()
+{
+if (mpData)
+rtl_uString_release(mpData);
+if (mpDataIgnoreCase)
+rtl_uString_release(mpDataIgnoreCase);
+}
+
+inline bool SharedString::operator!= ( const SharedString& r ) const
+{
+return !operator== (r);
+}
+
+inline OUString SharedString::getString() const
+{
+return mpData ? OUString(mpData) : OUString();
+}
+
+inline rtl_uString* SharedString::getData()
+{
+return mpData;
+}
+
+inline const rtl_uString* SharedString::getData() const
+{
+return mpData;
+}
+
+inline rtl_uString* SharedString::getDataIgnoreCase()
+{
+return mpDataIgnoreCase;
+}
+
+inline const rtl_uString* SharedString::getDataIgnoreCase() const
+{
+return mpDataIgnoreCase;
+}
+
+inline bool SharedString::isValid() const
+{
+return mpData != nullptr;
+}
+
+inline bool SharedString::isEmpty() const
+{
+return mpData == nullptr || mpData->length == 0;
+}
+
+inline sal_Int32 SharedString::getLength() const
+{
+return mpData ? mpData->length : 0;
+}
+
 }
 
 #endif
diff --git a/svl/source/misc/sharedstring.cxx b/svl/source/misc/sharedstring.cxx
index d3b2cac051ce..e1f2d4feed0f 100644
--- a/svl/source/misc/sharedstring.cxx
+++ b/svl/source/misc/sharedstring.cxx
@@ -22,44 +22,6 @@ const SharedString & SharedString::getEmptyString()
 return EMPTY_SHARED_STRING;
 }
 
-SharedString::SharedString() : mpData(nullptr), mpDataIgnoreCase(nullptr) {}
-
-SharedString::SharedString( rtl_uString* pData, rtl_uString* pDataIgnoreCase ) 
:
-mpData(pData), mpDataIgnoreCase(pDataIgnoreCase)
-{
-if (mpData)
-rtl_uString_acquire(mpData);
-if (mpDataIgnoreCase)
-rtl_uString_acquire(mpDataIgnoreCase);
-}
-
-SharedString::SharedString( const OUString& rStr ) : mpData(rStr.pData), 
mpDataIgnoreCase(nullptr)
-{
-rtl_uString_acquire(mpData);
-}
-
-SharedString::SharedString( const SharedString& r ) : mpData(r.mpData), 
mpDataIgnoreCase(r.mpDataIgnoreCase)
-{
-if (mpData)
-rtl_uString_acquire(mpData);
-if (mpDataIgnoreCase)
-rtl_uString_acquire(mpDataIgnoreCase);
-}
-
-SharedString::SharedString(SharedString&& r) noexcept : mpData(r.mpData), 
mpDataIgnoreCase(r.mpDataIgnoreCase)
-{
-r.mpData = nullptr;
-r.mpDataIgnoreCase = nullptr;
-}
-
-SharedString::~SharedString()
-{
-if (mpData)
-rtl_uString_release(mpData);
-if (mpDataIgnoreCase)
-rtl_uString_release(mpDataIgnoreCase);
-}
-
 SharedString& SharedString::operator= ( const SharedString& r )
 {
 if(this == )
@@ -118,51 +80,6 @@ bool SharedString::operator== ( const SharedString& r ) 
const
 return !r.mpData;
 }
 
-bool SharedString::operator!= ( const SharedString& r ) const
-{
-return !operator== (r);
-}
-
-OUString SharedString::getString() const
-{
-return mpData ? OUString(mpData) : OUString();
-}
-
-rtl_uString* SharedString::getData()
-{
-return mpData;
-}
-
-const rtl_uString* SharedString::getData() const
-{
-ret

[Libreoffice-commits] core.git: vcl/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 vcl/source/window/paint.cxx |   35 +--
 1 file changed, 5 insertions(+), 30 deletions(-)

New commits:
commit 1728367684602bb897fd9a8518c40b071cb55a22
Author: Luboš Luňák 
AuthorDate: Mon Nov 22 18:17:10 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 23 14:31:16 2021 +0100

avoid only painting to windows in LOK mode, not invalidations

9b73d3e8926d5f9b10464d19b539eef3eb088f50 disabled painting
to windows in LOK mode, because it doesn't make sense as
those windows are not even visible, but it tried to do it
by avoiding even invalidations. That can trigger problems
because some dialogs actually are forwarded to clients in LOK
mode, and apparently they need the invalidations to proceed
normally (the Format->Cell dialog in Online didn't repaint
scrolling of the Date listbox, I don't know what exactly
the actual problem was, but mnPaintFlags were different
than when not avoiding invalidations).

So revert most of the relevant commits and keep only avoiding
actual drawing, which is what 057968bbce406efe6564347329df45b7e
did.

Change-Id: I4e212966830f4c690e6143b9d5fedbc24619e1ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125674
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 1c983ff7b37a..b2b7db7b6557 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -647,13 +647,6 @@ void Window::ImplCallOverlapPaint()
 
 IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, idle paint does not need to do anything.
-mpWindowImpl->mpFrameData->maPaintIdle.Stop();
-return;
-}
-
 comphelper::ProfileZone aZone("VCL idle re-paint");
 
 // save paint events until layout is done
@@ -672,6 +665,9 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 else if ( mpWindowImpl->mbReallyVisible )
 {
 ImplCallOverlapPaint();
+if (comphelper::LibreOfficeKit::isActive() &&
+mpWindowImpl->mpFrameData->maPaintIdle.IsActive())
+mpWindowImpl->mpFrameData->maPaintIdle.Stop();
 }
 }
 
@@ -692,12 +688,6 @@ IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, 
void)
 
 void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, 
InvalidateFlags nFlags )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 // set PAINTCHILDREN for all parent windows till the first OverlapWindow
 if ( !ImplIsOverlapWindow() )
 {
@@ -759,12 +749,6 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* 
pRegion, InvalidateFl
 
 void Window::ImplInvalidateOverlapFrameRegion( const vcl::Region& rRegion )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 vcl::Region aRegion = rRegion;
 
 ImplClipBoundaries( aRegion, true, true );
@@ -795,12 +779,6 @@ void Window::ImplInvalidateParentFrameRegion( const 
vcl::Region& rRegion )
 
 void Window::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags 
nFlags )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 // check what has to be redrawn
 bool bInvalidateAll = !pRegion;
 
@@ -1180,11 +1158,8 @@ void Window::Invalidate( const tools::Rectangle& rRect, 
InvalidateFlags nFlags )
 tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
 if ( !aRect.IsEmpty() )
 {
-if (!comphelper::LibreOfficeKit::isActive())
-{   // ImplInvalidate() immediately returns in LOK mode, skip useless 
Region construction
-vcl::Region aRegion( aRect );
-ImplInvalidate( , nFlags );
-}
+vcl::Region aRegion( aRect );
+ImplInvalidate( , nFlags );
 tools::Rectangle aLogicRectangle(rRect);
 LogicInvalidate();
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

2021-11-23 Thread Luboš Luňák (via logerrit)
 vcl/source/window/paint.cxx |   35 +--
 1 file changed, 5 insertions(+), 30 deletions(-)

New commits:
commit 6b37e455a1ffbf2bc020e166642ad20a5f776bc1
Author: Luboš Luňák 
AuthorDate: Mon Nov 22 18:17:10 2021 +0100
Commit: Jan Holesovsky 
CommitDate: Tue Nov 23 13:03:25 2021 +0100

avoid only painting to windows in LOK mode, not invalidations

9b73d3e8926d5f9b10464d19b539eef3eb088f50 disabled painting
to windows in LOK mode, because it doesn't make sense as
those windows are not even visible, but it tried to do it
by avoiding even invalidations. That can trigger problems
because some dialogs actually are forwarded to clients in LOK
mode, and apparently they need the invalidations to proceed
normally (the Format->Cell dialog in Online didn't repaint
scrolling of the Date listbox, I don't know what exactly
the actual problem was, but mnPaintFlags were different
than when not avoiding invalidations).

So revert most of the relevant commits and keep only avoiding
actual drawing, which is what 057968bbce406efe6564347329df45b7e
did.

Change-Id: I4e212966830f4c690e6143b9d5fedbc24619e1ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125673
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 29f34de4f53c..425c6c19118c 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -646,13 +646,6 @@ void Window::ImplCallOverlapPaint()
 
 IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, idle paint does not need to do anything.
-mpWindowImpl->mpFrameData->maPaintIdle.Stop();
-return;
-}
-
 comphelper::ProfileZone aZone("VCL idle re-paint");
 
 // save paint events until layout is done
@@ -671,6 +664,9 @@ IMPL_LINK_NOARG(Window, ImplHandlePaintHdl, Timer *, void)
 else if ( mpWindowImpl->mbReallyVisible )
 {
 ImplCallOverlapPaint();
+if (comphelper::LibreOfficeKit::isActive() &&
+mpWindowImpl->mpFrameData->maPaintIdle.IsActive())
+mpWindowImpl->mpFrameData->maPaintIdle.Stop();
 }
 }
 
@@ -691,12 +687,6 @@ IMPL_LINK_NOARG(Window, ImplHandleResizeTimerHdl, Timer *, 
void)
 
 void Window::ImplInvalidateFrameRegion( const vcl::Region* pRegion, 
InvalidateFlags nFlags )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 // set PAINTCHILDREN for all parent windows till the first OverlapWindow
 if ( !ImplIsOverlapWindow() )
 {
@@ -758,12 +748,6 @@ void Window::ImplInvalidateFrameRegion( const vcl::Region* 
pRegion, InvalidateFl
 
 void Window::ImplInvalidateOverlapFrameRegion( const vcl::Region& rRegion )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 vcl::Region aRegion = rRegion;
 
 ImplClipBoundaries( aRegion, true, true );
@@ -794,12 +778,6 @@ void Window::ImplInvalidateParentFrameRegion( vcl::Region& 
rRegion )
 
 void Window::ImplInvalidate( const vcl::Region* pRegion, InvalidateFlags 
nFlags )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-// Tiled rendering is used, so there's no need to invalidate for idle 
painting.
-return;
-}
-
 // check what has to be redrawn
 bool bInvalidateAll = !pRegion;
 
@@ -1203,11 +1181,8 @@ void Window::Invalidate( const tools::Rectangle& rRect, 
InvalidateFlags nFlags )
 tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
 if ( !aRect.IsEmpty() )
 {
-if (!comphelper::LibreOfficeKit::isActive())
-{   // ImplInvalidate() immediatelly returns in LOK mode, skip useless 
Region construction
-vcl::Region aRegion( aRect );
-ImplInvalidate( , nFlags );
-}
+vcl::Region aRegion( aRect );
+ImplInvalidate( , nFlags );
 tools::Rectangle aLogicRectangle(rRect);
 LogicInvalidate();
 }


[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source

2021-11-22 Thread Luboš Luňák (via logerrit)
 sc/inc/global.hxx   |1 -
 sc/inc/table.hxx|9 -
 sc/source/core/data/dociter.cxx |6 --
 sc/source/core/data/global.cxx  |6 ++
 sc/source/core/data/table3.cxx  |   28 +++-
 5 files changed, 37 insertions(+), 13 deletions(-)

New commits:
commit 1a32af4192291ea5cfe7c4c143144a5dab1f156e
Author: Luboš Luňák 
AuthorDate: Mon Nov 22 13:16:43 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 22 15:46:46 2021 +0100

cache error strings for ScTable::validQuery()  (tdf#133835)

Avoid calling SharedStringPool::intern() on values that are
repeatedly the same.

Change-Id: I094f2e777a4ca24536e0c25e6a1c6358ccf49f61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125660
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 40806e70f31a..332be67ee551 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -954,10 +954,17 @@ public:
 
 void Reorder( const sc::ReorderParam& rParam );
 
+// Internal cache that can be repeatedly used for a sequence of related 
ValidQuery()
+// calls (related meaning done in a loop for the same document and query 
data).
+struct ValidQueryCache
+{
+std::unordered_map 
mCachedSharedErrorStrings;
+};
 bool ValidQuery(
 SCROW nRow, const ScQueryParam& rQueryParam, const ScRefCellValue* 
pCell = nullptr,
 bool* pbTestEqualCondition = nullptr, const ScInterpreterContext* 
pContext = nullptr,
-sc::TableColumnBlockPositionSet* pBlockPos = nullptr );
+sc::TableColumnBlockPositionSet* pBlockPos = nullptr,
+ValidQueryCache* pQueryCache = nullptr );
 voidTopTenQuery( ScQueryParam& );
 voidPrepareQuery( ScQueryParam& rQueryParam );
 SCSIZE  Query(const ScQueryParam& rQueryParam, bool bKeepSub);
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 378d867b4e55..91cc0a2c213c 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1117,6 +1117,7 @@ bool ScQueryCellIterator::GetThis()
 !maParam.bHasHeader && rItem.meType == ScQueryEntry::ByString &&
 ((maParam.bByRow && nRow == maParam.nRow1) ||
  (!maParam.bByRow && nCol == maParam.nCol1));
+ScTable::ValidQueryCache validQueryCache;
 
 ScColumn* pCol = &(rDoc.maTabs[nTab])->aCol[nCol];
 while (true)
@@ -1183,7 +1184,7 @@ bool ScQueryCellIterator::GetThis()
 if ( rDoc.maTabs[nTab]->ValidQuery( nRow, maParam,
 (nCol == static_cast(nFirstQueryField) ?  : 
nullptr),
 (nTestEqualCondition ?  : nullptr),
-) )
+, nullptr, ) )
 {
 if ( nTestEqualCondition && bTestEqualCondition )
 nTestEqualCondition |= nTestEqualConditionMatched;
@@ -1506,6 +1507,7 @@ int ScCountIfCellIterator::GetCount()
 const ScQueryEntry::Item& rItem = rEntry.GetQueryItem();
 const bool bSingleQueryItem = rEntry.GetQueryItems().size() == 1;
 int count = 0;
+ScTable::ValidQueryCache validQueryCache;
 
 ScColumn* pCol = &(rDoc.maTabs[nTab])->aCol[nCol];
 while (true)
@@ -1561,7 +1563,7 @@ int ScCountIfCellIterator::GetCount()
 if ( rDoc.maTabs[nTab]->ValidQuery( nRow, maParam,
 (nCol == static_cast(rEntry.nField) ?  : nullptr),
 nullptr,
-) )
+, nullptr, ) )
 {
 if (aCell.isEmpty())
 return count;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 0ef833511dba..6ff12c4a25b5 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2330,6 +2330,7 @@ class QueryEvaluator
 CollatorWrapper* mpCollator;
 const bool mbMatchWholeCell;
 const bool mbCaseSensitive;
+ScTable::ValidQueryCache* mpValidQueryCache;
 
 static bool isPartialTextMatchOp(const ScQueryEntry& rEntry)
 {
@@ -2399,7 +2400,7 @@ class QueryEvaluator
 
 public:
 QueryEvaluator(ScDocument& rDoc, const ScTable& rTab, const ScQueryParam& 
rParam,
-   bool pTestEqualCondition) :
+   bool pTestEqualCondition, ScTable::ValidQueryCache* 
pValidQueryCache) :
 mrDoc(rDoc),
 mrStrPool(rDoc.GetSharedStringPool()),
 mrTab(rTab),
@@ -2408,7 +2409,8 @@ public:
 mpTransliteration(nullptr),
 mpCollator(nullptr),
 mbMatchWholeCell(rDoc.GetDocOptions().IsMatchWholeCell()),
-mbCaseSensitive( rParam.bCaseSens )
+mbCaseSensitive( rParam.bCaseSens ),
+mpValidQueryCache( pValidQueryCache )
 {
 }
 
@@ -2595,6 +2597,20 @@ public:
 if (rCell.meType == CELLTYPE_FORMULA && 
rCell.mpFormula->Ge

[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/skia

2021-11-22 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/gdiimpl.hxx |   28 
 vcl/inc/skia/utils.hxx   |   22 +++
 vcl/skia/gdiimpl.cxx |   54 ++-
 vcl/skia/salbmp.cxx  |5 
 4 files changed, 62 insertions(+), 47 deletions(-)

New commits:
commit 6b2d8e2d88a67d446827ed0ab968f0a06e297d18
Author: Luboš Luňák 
AuthorDate: Fri Nov 19 11:15:00 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 22 13:49:14 2021 +0100

handle filling and stroking at the same time if possible

All tests still pass, so the end result should be the same, but
this way it's done in one call.

Change-Id: If5da34837a45ad600ae30568e4ba7651ac5838bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125644
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index aeaef186ca44..cc4cda4b2ebd 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -327,7 +327,10 @@ protected:
 paint.setColor(transparency == 0
? SkiaHelper::toSkColor(mFillColor)
: SkiaHelper::toSkColorWithTransparency(mFillColor, 
transparency));
-paint.setStyle(SkPaint::kFill_Style);
+if (mLineColor == mFillColor)
+paint.setStyle(SkPaint::kStrokeAndFill_Style);
+else
+paint.setStyle(SkPaint::kFill_Style);
 return paint;
 }
 
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 6f326d6c5aa8..3d7697c4dcfa 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -853,7 +853,7 @@ void SkiaSalGraphicsImpl::privateDrawAlphaRect(tools::Long 
nX, tools::Long nY, t
 paint.setStyle(SkPaint::kStroke_Style);
 canvas->drawIRect(SkIRect::MakeXYWH(nX, nY, nWidth, nHeight), paint);
 }
-if (mLineColor != SALCOLOR_NONE)
+if (mLineColor != SALCOLOR_NONE && mLineColor != mFillColor) // otherwise 
handled by fill
 {
 SkPaint paint = makeLinePaint(fTransparency);
 paint.setAntiAlias(!blockAA && mParent.getAntiAlias());
@@ -992,7 +992,7 @@ void SkiaSalGraphicsImpl::performDrawPolyPolygon(const 
basegfx::B2DPolyPolygon&
 aPaint.setStyle(SkPaint::kStroke_Style);
 getDrawCanvas()->drawPath(polygonPath, aPaint);
 }
-if (mLineColor != SALCOLOR_NONE)
+if (mLineColor != SALCOLOR_NONE && mLineColor != mFillColor) // otherwise 
handled by fill
 {
 SkPaint aPaint = makeLinePaint(fTransparency);
 aPaint.setAntiAlias(useAA);
commit 53ce0e3af4dcb1c70380016b3824da71548cdc60
Author: Luboš Luňák 
AuthorDate: Fri Nov 19 11:09:51 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 22 13:49:01 2021 +0100

move code to helper functions

I'll want some common extra functionality there later.

Change-Id: I249f9ca4662fc8e8d52c58b1bd33293f363464d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125643
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 9cf14f176185..aeaef186ca44 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -27,6 +27,8 @@
 
 #include 
 
+#include 
+
 class SkiaFlushIdle;
 class GenericSalLayout;
 class SkFont;
@@ -306,6 +308,29 @@ protected:
 void performDrawPolyPolygon(const basegfx::B2DPolyPolygon& polygon, double 
transparency,
 bool useAA);
 
+// Create SkPaint set up for drawing lines (using mLineColor etc.).
+SkPaint makeLinePaint(double transparency = 0) const
+{
+assert(mLineColor != SALCOLOR_NONE);
+SkPaint paint;
+paint.setColor(transparency == 0
+   ? SkiaHelper::toSkColor(mLineColor)
+   : SkiaHelper::toSkColorWithTransparency(mLineColor, 
transparency));
+paint.setStyle(SkPaint::kStroke_Style);
+return paint;
+}
+// Create SkPaint set up for filling (using mFillColor etc.).
+SkPaint makeFillPaint(double transparency = 0) const
+{
+assert(mFillColor != SALCOLOR_NONE);
+SkPaint paint;
+paint.setColor(transparency == 0
+   ? SkiaHelper::toSkColor(mFillColor)
+   : SkiaHelper::toSkColorWithTransparency(mFillColor, 
transparency));
+paint.setStyle(SkPaint::kFill_Style);
+return paint;
+}
+
 template 
 friend inline std::basic_ostream&
 operator<<(std::basic_ostream& stream, const 
SkiaSalGraphicsImpl* graphics)
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
index 92df0325c870..0583e9ceb624 100644
--- a/vcl/inc/skia/utils.hxx
+++ b/vcl/inc/skia/utils.hxx
@@ -73,6 +73,28 @@ VCL_DLLPUBLIC sk_sp 
makeCheckedImageSnapshot(sk_sp surface,
 
 inline Size imageSize(const sk_sp& image) { return 
Size(image->width(), image->height

Re: Windows build gets stuck, if parallelism greater than 1

2021-11-20 Thread Luboš Luňák
On Saturday 20 of November 2021, Ilmari Lauhakangas wrote:
> My mentee is having an issue, where plain make gets stuck in
>
> [build ECH] CustomTarget/instsetoo_native/setup/version.ini
>
> or
>
> [build MOD] instsetoo_native
>
> if parallelism is 2 or more. Default would be "-j 8" on his machine. He
> has 16GB RAM available. Windows is on bare metal. Any tips for
> troubleshooting?

 The last line printed by parallel make is usually irrelevant, it can be stuck 
by another job that started before. So it's necessary to check processes 
launched by make (on Linux I'd do 'pstree -pal', I don't know if that works 
in cygwin).

 But first I'd check if this isn't the recent cygwin problem that was causing 
make getting stuck.

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/qa sc/source

2021-11-19 Thread Luboš Luňák (via logerrit)
 sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods |   22 +++
 sc/source/core/data/table3.cxx   |9 --
 2 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 12bda3a60ea0b23668c26f275e970775e3fc68c2
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 01:30:24 2021 +0100
Commit: Michael Meeks 
CommitDate: Fri Nov 19 16:44:10 2021 +0100

revert "vlookup - optimize SC_EQUAL and NOT_EQUAL." (tdf#139612)

That commit breaks lookup when the  "Search criteria = and <> must
apply to whole cells" option is disabled, as it enforces whole cell
checking regardless of the option. Given that the option is enabled
by default in LO ('SearchCriteria' in Calc.xcs) and it's what
MSOffice does as well, and this default gives good performance
regardless of the option, I don't understand the purpose
of the commit. Possibly it was based on a document where somebody
disabled the option and then indeed got worse performance.
Solution: Don't do that :).

This reverts the code parts of a953fa1c0f6a40a08859570516c511f3a841 .
The test I've kept but switched to ensure that partial matching
does work if the option to match whole cells is disabled. I've
also changed the tooltip for the option to mention performance
and not suggest that off is the default.

7.2: UI string change not included.

Change-Id: I56d7b6e7b8e9f0622f7ad6d447daf56c3b705a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125267
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
    Reviewed-by: Luboš Luňák 
(cherry picked from commit 8dec2a98ce29251936cd45ebf864a89ff767ee50)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125351
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
index d47779d928a1..fd228881a7cb 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
@@ -1017,14 +1017,14 @@
   TRUE
  
  
-  VLOOKUP tests that ensure there is no partial matching of cell 
contents
+  VLOOKUP tests that ensure there is partial matching of cell 
contents
  
 
 
  
  
  
-  even though the document option of “search on whole cell” is 
turned off.
+  when the document option of “search on whole cell” is turned 
off.
  
 
 
@@ -1095,10 +1095,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1122,10 +1122,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1149,10 +1149,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 17d28013a680..8a92e17c3977 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2593,11 +2593,6 @@ public:
 
 if (nIndex < 0)
 nStrPos = -1;
-else if (rEntry.eOp == SC_EQUAL ||
- rEntry.eOp == SC_NOT_EQUAL)
-{
-nStrPos = pCellStr == pQuer ? 0 : -1;
-}
 else
 { // OUString::indexOf
 nStrPos = rtl_ustr_indexOfStr_WithLength(
@@ -2629,14 +2624,10 @@ public:
 switch (rEntry.eOp)
 {
 case SC_EQUAL:
-bOk = ( nStrPos == 0 );
-break;
 case SC_CONTAINS:
 bOk = ( nStrPos != -1 );
 break;
 case SC_NOT_EQUAL:
-bOk = ( nStrPos != 0 );
-break;
 case SC_DOES_NOT_CONTAIN:
 bOk = ( nStrPos == -1 );
 break;


Re: FYI: ccache for MSVC/Windows

2021-11-18 Thread Luboš Luňák
On Wednesday 17 of November 2021, Thorsten Behrens wrote:
> Note that ccache performs surprisingly poor on io-starved Windows
> setups [1], which possibly is true for the Jenkins VMs.

 If I run 'CCACHE_DEBUG=1 make -C starmath -j8 -rs Library_sm', most of the 
ccache log files claim the full ccache invocation took roughly 50ms. With ~50 
source files in Library_sm that should be ~2.5s CPU time, and if we count 
only non-HT cores, that should take less than a second. Yet the time spent by 
building .cxx files is roughly 3 seconds. So I wouldn't be that certain in 
claiming it's about ccache performing poorly, maybe it's gbuild or poor 
Windows performance when invoking executables or whatever.

 And if I run the above with GBUILD_TRACE set, I get what's attached. 
Apparently even outputting those log 109 lines pretty much doubles the CXX 
time, for whatever strange reason, and there are quite some empty spaces 
between the compilations (they are also in a log created on linux, but there 
they are tiny). I guess that's the reason why we used to have a gmake version 
patched for Windows.

> Along the same line, I've also recently added support for sccache, but
> YMMV there, too (I'd choose ccache over sccache for local caches any
> time). Might be interesting for our dev mentoring team though, since
> sccache enables sharing of cache content via hyperscaler blob storage
> [2].

 Recent ccache versions have support for shared remote storage too, although 
I've never tried it. I've never tried sccache either, but just from looking 
at it ccache seems generally superior, for example sccache can't handle PCHs, 
so it's basically trading one speedup for another.

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: distro-configs/Jenkins

2021-11-18 Thread Luboš Luňák (via logerrit)
 distro-configs/Jenkins/MacOSX_dev_master.conf |2 +-
 distro-configs/Jenkins/Win32_dev_master.conf  |2 +-
 distro-configs/Jenkins/Win64_dev_master.conf  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f4d59ec73682f06fff9f718b3347726f1d53d263
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 11:55:12 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 18 16:46:18 2021 +0100

make Jenkins dev builds use --enable-dbgutil, not just debug

It's the "more debug" option that each developer ideally should
use unless binary compatibility is wanted. Jenkins builds done
with these settings are reportedly not published, so this is
just tinderbox builds, and there's it's better to verify
the extra dbgutil stuff too.

Change-Id: Ia2f86ff9394e155b247a6e5e1583d0681399b99b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125381
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/distro-configs/Jenkins/MacOSX_dev_master.conf 
b/distro-configs/Jenkins/MacOSX_dev_master.conf
index 1718b7fd3439..3960c4e5bf23 100644
--- a/distro-configs/Jenkins/MacOSX_dev_master.conf
+++ b/distro-configs/Jenkins/MacOSX_dev_master.conf
@@ -1,3 +1,3 @@
---enable-debug
+--enable-dbgutil
 --enable-odk
 --disable-online-update
diff --git a/distro-configs/Jenkins/Win32_dev_master.conf 
b/distro-configs/Jenkins/Win32_dev_master.conf
index e81e0cfef628..7ccda1beb829 100644
--- a/distro-configs/Jenkins/Win32_dev_master.conf
+++ b/distro-configs/Jenkins/Win32_dev_master.conf
@@ -1,4 +1,4 @@
 --host=i686-pc-cygwin
---enable-debug
+--enable-dbgutil
 --enable-odk
 --disable-online-update
diff --git a/distro-configs/Jenkins/Win64_dev_master.conf 
b/distro-configs/Jenkins/Win64_dev_master.conf
index 1718b7fd3439..3960c4e5bf23 100644
--- a/distro-configs/Jenkins/Win64_dev_master.conf
+++ b/distro-configs/Jenkins/Win64_dev_master.conf
@@ -1,3 +1,3 @@
---enable-debug
+--enable-dbgutil
 --enable-odk
 --disable-online-update


[Libreoffice-commits] core.git: vcl/source

2021-11-18 Thread Luboš Luňák (via logerrit)
 vcl/source/window/decoview.cxx |  294 +++--
 1 file changed, 138 insertions(+), 156 deletions(-)

New commits:
commit a7a700de4b6191d97c9addf528dce218b237e868
Author: Luboš Luňák 
AuthorDate: Thu Nov 18 14:49:01 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 18 16:44:46 2021 +0100

draw symbols using polygons instead of raster of lines

On HiDPI those lines become obvious.

Change-Id: I2b0cce3950abb4d06a56ba022100bc74026b5de7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125481
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index f9ccb59f6ee1..71481200d9f0 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -72,86 +72,98 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle 
nRect, const SymbolTyp
 switch ( eType )
 {
 case SymbolType::ARROW_UP:
-pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
-for ( tools::Long i=1; i <= n2; ++i )
-{
-nRect.AdjustTop( 1 );
-pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ),
-Point( aCenter.X()+i, nRect.Top() ) );
-pDev->DrawPixel( Point( aCenter.X()-i, nRect.Top() ) );
-pDev->DrawPixel( Point( aCenter.X()+i, nRect.Top() ) );
-}
-pDev->DrawRect( tools::Rectangle( aCenter.X()-n8, nRect.Top()+1,
-   aCenter.X()+n8, nRect.Bottom() ) );
+{
+tools::Polygon arrow(7);
+arrow.SetPoint( Point( aCenter.X(), nRect.Top()), 0 );
+arrow.SetPoint( Point( aCenter.X() - n2, nRect.Top() + n2 ), 1 );
+arrow.SetPoint( Point( aCenter.X() - n8, nRect.Top() + n2 ), 2 );
+arrow.SetPoint( Point( aCenter.X() - n8, nRect.Bottom()), 3 );
+arrow.SetPoint( Point( aCenter.X() + n8, nRect.Bottom()), 4 );
+arrow.SetPoint( Point( aCenter.X() + n8, nRect.Top() + n2 ), 5 );
+arrow.SetPoint( Point( aCenter.X() + n2, nRect.Top() + n2 ), 6 );
+pDev->Push(vcl::PushFlags::LINECOLOR);
+pDev->SetLineColor();
+pDev->DrawPolygon( arrow );
+pDev->Pop();
 break;
+}
 
 case SymbolType::ARROW_DOWN:
-pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) );
-for ( tools::Long i=1; i <= n2; ++i )
-{
-nRect.AdjustBottom( -1 );
-pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ),
-Point( aCenter.X()+i, nRect.Bottom() ) );
-pDev->DrawPixel( Point( aCenter.X()-i, nRect.Bottom() ) );
-pDev->DrawPixel( Point( aCenter.X()+i, nRect.Bottom() ) );
-}
-pDev->DrawRect( tools::Rectangle( aCenter.X()-n8, nRect.Top(),
-   aCenter.X()+n8, nRect.Bottom()-1 ) );
+{
+tools::Polygon arrow(7);
+arrow.SetPoint( Point( aCenter.X(), nRect.Bottom()), 0 );
+arrow.SetPoint( Point( aCenter.X() - n2, nRect.Bottom() - n2 ), 1 
);
+arrow.SetPoint( Point( aCenter.X() - n8, nRect.Bottom() - n2 ), 2 
);
+arrow.SetPoint( Point( aCenter.X() - n8, nRect.Top()), 3 );
+arrow.SetPoint( Point( aCenter.X() + n8, nRect.Top()), 4 );
+arrow.SetPoint( Point( aCenter.X() + n8, nRect.Bottom() - n2 ), 5 
);
+arrow.SetPoint( Point( aCenter.X() + n2, nRect.Bottom() - n2 ), 6 
);
+pDev->Push(vcl::PushFlags::LINECOLOR);
+pDev->SetLineColor();
+pDev->DrawPolygon( arrow );
+pDev->Pop();
 break;
+}
 
 case SymbolType::ARROW_LEFT:
-pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) );
-for ( tools::Long i=1; i <= n2; ++i )
-{
-nRect.AdjustLeft( 1 );
-pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ),
-Point( nRect.Left(), aCenter.Y()+i ) );
-pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()-i ) );
-pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()+i ) );
-}
-pDev->DrawRect( tools::Rectangle( nRect.Left()+1, aCenter.Y()-n8,
-   nRect.Right(), aCenter.Y()+n8 ) );
+{
+tools::Polygon arrow(7);
+arrow.SetPoint( Point( nRect.Left(), aCenter.Y()), 0 );
+arrow.SetPoint( Point( nRect.Left() + n2, aCenter.Y() - n2 ), 1 );
+arrow.SetPoint( Point( nRect.Left() + n2, aCenter.Y() - n8 ), 2 );
+arrow.SetPoint( Point( nRect.Right(), aCenter.Y() - n8 ), 3 );
+arrow.SetPoint( Point( nRect.Ri

[Libreoffice-commits] core.git: 2 commits - vcl/skia

2021-11-18 Thread Luboš Luňák (via logerrit)
 vcl/skia/osx/gdiimpl.cxx |   33 +++--
 1 file changed, 27 insertions(+), 6 deletions(-)

New commits:
commit 899deee84589306764a19383e3518e66714ca5e5
Author: Luboš Luňák 
AuthorDate: Thu Nov 18 12:23:11 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 18 16:44:18 2021 +0100

add an extra margin to native control drawing on Skia/Mac

Some controls draw outside of their given area, which would get cropped
when first drawing to a temporary context limited to just that size.
I haven't managed to find a way to calculate the proper marging, so
just add something that's hopefully enough but not too big.

Change-Id: I1a15a3ab8cbd26cbe4fb52628b300ee70c8d51ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125469
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx
index 58e03e16f3be..126f43bb6ac3 100644
--- a/vcl/skia/osx/gdiimpl.cxx
+++ b/vcl/skia/osx/gdiimpl.cxx
@@ -187,9 +187,19 @@ bool 
AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
 const tools::Rectangle& 
rControlRegion,
 ControlState nState, const 
ImplControlValue& aValue)
 {
+// rControlRegion is not the whole area that the control should be painted 
to (e.g. highlight
+// around focused lineedit is outside of it). Since we draw to a temporary 
bitmap, we need tofind out
+// the real size. Using getNativeControlRegion() might seem like the 
function to call, but we need
+// the other direction - what is called rControlRegion here is 
rNativeContentRegion in that function
+// what's called rControlRegion there is what we need here. Moreover 
getNativeControlRegion()
+// in some cases returns a fixed size that does not depend on its input, 
so we have no way to
+// actually find out what the original size was (or maybe the function is 
kind of broken, I don't know).
+// So, add a generous margin and hope it's enough.
+tools::Rectangle boundingRegion(rControlRegion);
+boundingRegion.expand(50 * mScaling);
 // Do a scaled bitmap in HiDPI in order not to lose precision.
-const tools::Long width = rControlRegion.GetWidth() * mScaling;
-const tools::Long height = rControlRegion.GetHeight() * mScaling;
+const tools::Long width = boundingRegion.GetWidth() * mScaling;
+const tools::Long height = boundingRegion.GetHeight() * mScaling;
 const size_t bytes = width * height * 4;
 std::unique_ptr data(new sal_uInt8[bytes]);
 memset(data.get(), 0, bytes);
@@ -211,7 +221,9 @@ bool AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType 
nType, ControlPart n
 CGContextSetRGBFillColor(context, fillColor.GetRed(), 
fillColor.GetGreen(), fillColor.GetBlue(),
  fillColor.GetAlpha());
 // Adjust for our drawn-to coordinates in the bitmap.
-tools::Rectangle movedRegion(Point(0, 0), rControlRegion.GetSize());
+tools::Rectangle movedRegion(Point(rControlRegion.getX() - 
boundingRegion.getX(),
+   rControlRegion.getY() - 
boundingRegion.getY()),
+ rControlRegion.GetSize());
 // Flip drawing upside down.
 CGContextTranslateCTM(context, 0, height);
 CGContextScaleCTM(context, 1, -1);
@@ -232,15 +244,15 @@ bool 
AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
 preDraw();
 SAL_INFO("vcl.skia.trace", "drawnativecontrol(" << this << "): " << 
rControlRegion << ":"
 << int(nType) << "/" 
<< int(nPart));
-tools::Rectangle updateRect = rControlRegion;
+tools::Rectangle updateRect = boundingRegion;
 // For background update only part that is not clipped, the same
 // as in AquaGraphicsBackend::drawNativeControl().
 if (nType == ControlType::WindowBackground)
 updateRect.Intersection(mClipRegion.GetBoundRect());
 addUpdateRegion(SkRect::MakeXYWH(updateRect.getX(), updateRect.getY(),
  updateRect.GetWidth(), 
updateRect.GetHeight()));
-SkRect drawRect = SkRect::MakeXYWH(rControlRegion.getX(), 
rControlRegion.getY(),
-   rControlRegion.GetWidth(), 
rControlRegion.GetHeight());
+SkRect drawRect = SkRect::MakeXYWH(boundingRegion.getX(), 
boundingRegion.getY(),
+   boundingRegion.GetWidth(), 
boundingRegion.GetHeight());
 assert(drawRect.width() * mScaling == bitmap.width()); // no scaling 
should be needed
 getDrawCanvas()->drawImageRect(bitmap.asImage(), drawRect, 
SkSamplingOptions());
 ++mPendingOperationsToFlush; // 

[Libreoffice-commits] core.git: vcl/skia

2021-11-18 Thread Luboš Luňák (via logerrit)
 vcl/skia/osx/gdiimpl.cxx |   25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

New commits:
commit 07a9d2f60dabac5b8f9d10acb73a8eade1593aae
Author: Luboš Luňák 
AuthorDate: Thu Nov 18 10:17:54 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 18 16:43:46 2021 +0100

draw Mac widget controls at proper size when HiDPI

This code was drawing them at non-HiDPI size and then scaling up.

Change-Id: I90abfd36adaff4e7c4929cd28d0aa50d919449a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125467
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx
index 73e5e09d20d0..0f451f8916df 100644
--- a/vcl/skia/osx/gdiimpl.cxx
+++ b/vcl/skia/osx/gdiimpl.cxx
@@ -187,21 +187,27 @@ bool 
AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
 const tools::Rectangle& 
rControlRegion,
 ControlState nState, const 
ImplControlValue& aValue)
 {
-const tools::Long width = rControlRegion.GetWidth();
-const tools::Long height = rControlRegion.GetHeight();
+// Do a scaled bitmap in HiDPI in order not to lose precision.
+const tools::Long width = rControlRegion.GetWidth() * mScaling;
+const tools::Long height = rControlRegion.GetHeight() * mScaling;
 const size_t bytes = width * height * 4;
 std::unique_ptr data(new sal_uInt8[bytes]);
 memset(data.get(), 0, bytes);
 CGContextRef context = CGBitmapContextCreate(
 data.get(), width, height, 8, width * 4, GetSalData()->mxRGBSpace,
 toCGBitmapType(mSurface->imageInfo().colorType(), 
kPremul_SkAlphaType));
-assert(context); // TODO
-// Flip upside down.
+if (!context)
+{
+SAL_WARN("vcl.skia", "drawNativeControl(): Failed to allocate bitmap 
context");
+return false;
+}
+// Adjust for our drawn-to coordinates in the bitmap.
+tools::Rectangle movedRegion(Point(0, 0), rControlRegion.GetSize());
+// Flip drawing upside down.
 CGContextTranslateCTM(context, 0, height);
 CGContextScaleCTM(context, 1, -1);
-// Adjust for our drawn-to coordinates in the bitmap.
-tools::Rectangle movedRegion = rControlRegion;
-movedRegion.SetPos(Point(0, 0));
+// And possibly scale the native drawing.
+CGContextScaleCTM(context, mScaling, mScaling);
 bool bOK = performDrawNativeControl(nType, nPart, movedRegion, nState, 
aValue, context,
 mrShared.mpFrame);
 CGContextRelease(context);
@@ -224,7 +230,10 @@ bool 
AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
 updateRect.Intersection(mClipRegion.GetBoundRect());
 addUpdateRegion(SkRect::MakeXYWH(updateRect.getX(), updateRect.getY(),
  updateRect.GetWidth(), 
updateRect.GetHeight()));
-getDrawCanvas()->drawImage(bitmap.asImage(), rControlRegion.getX(), 
rControlRegion.getY());
+SkRect drawRect = SkRect::MakeXYWH(rControlRegion.getX(), 
rControlRegion.getY(),
+   rControlRegion.GetWidth(), 
rControlRegion.GetHeight());
+assert(drawRect.width() * mScaling == bitmap.width()); // no scaling 
should be needed
+getDrawCanvas()->drawImageRect(bitmap.asImage(), drawRect, 
SkSamplingOptions());
 ++mPendingOperationsToFlush; // tdf#136369
 postDraw();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-11-18 Thread Luboš Luňák (via logerrit)
 sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods |   22 +++
 sc/source/core/data/table3.cxx   |9 --
 2 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 4967ac966be3bc84e5db210f6d5d96d45c877db7
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 01:30:24 2021 +0100
Commit: Xisco Fauli 
CommitDate: Thu Nov 18 09:48:56 2021 +0100

revert "vlookup - optimize SC_EQUAL and NOT_EQUAL." (tdf#139612)

That commit breaks lookup when the  "Search criteria = and <> must
apply to whole cells" option is disabled, as it enforces whole cell
checking regardless of the option. Given that the option is enabled
by default in LO ('SearchCriteria' in Calc.xcs) and it's what
MSOffice does as well, and this default gives good performance
regardless of the option, I don't understand the purpose
of the commit. Possibly it was based on a document where somebody
disabled the option and then indeed got worse performance.
Solution: Don't do that :).

This reverts the code parts of a953fa1c0f6a40a08859570516c511f3a841 .
The test I've kept but switched to ensure that partial matching
does work if the option to match whole cells is disabled. I've
also changed the tooltip for the option to mention performance
and not suggest that off is the default.

7.2: UI string change not included.

Change-Id: I56d7b6e7b8e9f0622f7ad6d447daf56c3b705a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125267
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
    Reviewed-by: Luboš Luňák 
(cherry picked from commit 8dec2a98ce29251936cd45ebf864a89ff767ee50)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125350
Tested-by: Luboš Luňák 
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
index d47779d928a1..fd228881a7cb 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
@@ -1017,14 +1017,14 @@
   TRUE
  
  
-  VLOOKUP tests that ensure there is no partial matching of cell 
contents
+  VLOOKUP tests that ensure there is partial matching of cell 
contents
  
 
 
  
  
  
-  even though the document option of “search on whole cell” is 
turned off.
+  when the document option of “search on whole cell” is turned 
off.
  
 
 
@@ -1095,10 +1095,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1122,10 +1122,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1149,10 +1149,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d315de4768cb..d57f405111a8 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2761,11 +2761,6 @@ public:
 
 if (nIndex < 0)
 nStrPos = -1;
-else if (rEntry.eOp == SC_EQUAL ||
- rEntry.eOp == SC_NOT_EQUAL)
-{
-nStrPos = pCellStr == pQuer ? 0 : -1;
-}
 else
 { // OUString::indexOf
 nStrPos = rtl_ustr_indexOfStr_WithLength(
@@ -2797,14 +2792,10 @@ public:
 switch (rEntry.eOp)
 {
 case SC_EQUAL:
-bOk = ( nStrPos == 0 );
-break;
 case SC_CONTAINS:
 bOk = ( nStrPos != -1 );
 break;
 case SC_NOT_EQUAL:
-bOk = ( nStrPos != 0 );
-break;
 case SC_DOES_NOT_CONTAIN:
 bOk = ( nStrPos == -1 );
 break;


[Libreoffice-commits] core.git: vcl/skia

2021-11-17 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   47 ++-
 1 file changed, 22 insertions(+), 25 deletions(-)

New commits:
commit 5e6e45eb4247bf8bd57d157b44f49577dde38716
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 16:35:31 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 18 08:01:12 2021 +0100

handle also curved lines for nojoin skia polylines (tdf#143837)

Change-Id: I2f5aa12eb656f6b337843d81a2a30de277dff7b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125410
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 6a01601662a4..f15954f95117 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -55,33 +55,28 @@ namespace
 // bottom-most line of pixels of the bounding rectangle (see
 // 
https://lists.freedesktop.org/archives/libreoffice/2019-November/083709.html).
 // So be careful with rectangle->polygon conversions (generally avoid them).
-void addPolygonToPath(const basegfx::B2DPolygon& rPolygon, SkPath& rPath,
-  bool* hasOnlyOrthogonal = nullptr)
+void addPolygonToPath(const basegfx::B2DPolygon& rPolygon, SkPath& rPath, 
sal_uInt32 nFirstIndex,
+  sal_uInt32 nLastIndex, const sal_uInt32 nPointCount, 
const bool bClosePath,
+  const bool bHasCurves, bool* hasOnlyOrthogonal = nullptr)
 {
-const sal_uInt32 nPointCount(rPolygon.count());
+assert(nFirstIndex < nPointCount);
+assert(nLastIndex <= nPointCount);
 
 if (nPointCount <= 1)
 return;
 
-const bool bClosePath(rPolygon.isClosed());
-const bool bHasCurves(rPolygon.areControlPointsUsed());
-
 bool bFirst = true;
+sal_uInt32 nPreviousIndex = nFirstIndex == 0 ? nPointCount - 1 : 
nFirstIndex - 1;
+basegfx::B2DPoint aPreviousPoint = rPolygon.getB2DPoint(nPreviousIndex);
 
-sal_uInt32 nCurrentIndex = 0;
-sal_uInt32 nPreviousIndex = nPointCount - 1;
-
-basegfx::B2DPoint aCurrentPoint;
-basegfx::B2DPoint aPreviousPoint;
-
-for (sal_uInt32 nIndex = 0; nIndex <= nPointCount; nIndex++)
+for (sal_uInt32 nIndex = nFirstIndex; nIndex <= nLastIndex; nIndex++)
 {
 if (nIndex == nPointCount && !bClosePath)
 continue;
 
 // Make sure we loop the last point to first point
-nCurrentIndex = nIndex % nPointCount;
-aCurrentPoint = rPolygon.getB2DPoint(nCurrentIndex);
+sal_uInt32 nCurrentIndex = nIndex % nPointCount;
+basegfx::B2DPoint aCurrentPoint = rPolygon.getB2DPoint(nCurrentIndex);
 
 if (bFirst)
 {
@@ -132,12 +127,19 @@ void addPolygonToPath(const basegfx::B2DPolygon& 
rPolygon, SkPath& rPath,
 aPreviousPoint = aCurrentPoint;
 nPreviousIndex = nCurrentIndex;
 }
-if (bClosePath)
+if (bClosePath && nFirstIndex == 0 && nLastIndex == nPointCount)
 {
 rPath.close();
 }
 }
 
+void addPolygonToPath(const basegfx::B2DPolygon& rPolygon, SkPath& rPath,
+  bool* hasOnlyOrthogonal = nullptr)
+{
+addPolygonToPath(rPolygon, rPath, 0, rPolygon.count(), rPolygon.count(), 
rPolygon.isClosed(),
+ rPolygon.areControlPointsUsed(), hasOnlyOrthogonal);
+}
+
 void addPolyPolygonToPath(const basegfx::B2DPolyPolygon& rPolyPolygon, SkPath& 
rPath,
   bool* hasOnlyOrthogonal = nullptr)
 {
@@ -1246,7 +1248,6 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectToDev
 {
 SkPath aPath;
 aPath.incReserve(aPolyLine.count() * 3); // because cubicTo is 3 
elements
-aPath.setFillType(SkPathFillType::kEvenOdd);
 addPolygonToPath(aPolyLine, aPath);
 aPath.offset(toSkX(0) + posFix, toSkY(0) + posFix, nullptr);
 addUpdateRegion(aPath.getBounds());
@@ -1256,16 +1257,12 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectToDev
 {
 sal_uInt32 nPoints = aPolyLine.count();
 bool bClosed = aPolyLine.isClosed();
-for (sal_uInt32 j = 0; j < (bClosed ? nPoints : nPoints - 1); ++j)
+bool bHasCurves = aPolyLine.areControlPointsUsed();
+for (sal_uInt32 j = 0; j < nPoints; ++j)
 {
-sal_uInt32 index1 = (j + 0) % nPoints;
-sal_uInt32 index2 = (j + 1) % nPoints;
 SkPath aPath;
-aPath.moveTo(aPolyLine.getB2DPoint(index1).getX(),
- aPolyLine.getB2DPoint(index1).getY());
-aPath.lineTo(aPolyLine.getB2DPoint(index2).getX(),
- aPolyLine.getB2DPoint(index2).getY());
-
+aPath.incReserve(2 * 3); // because cubicTo is 3 elements
+addPolygonToPath(aPolyLine, aPath, j, j + 1, nPoints, bClosed, 
bHasCurves);
 aPath.offset(toSkX(0) + posFix, toSkY(0) + posFix, nullptr);
 addUpdateRegion(aPath.getBounds());
 getDrawCanvas()->drawPath(aPath, aPaint);


FYI: ccache for MSVC/Windows

2021-11-17 Thread Luboš Luňák


 Hello,

 current master now can build also Windows builds using ccache. MSVC support 
in ccache is a work in progress and so currently it's necessary to use a 
patched ccache, either from [1] or get a binary from [2]. You can put it 
in /opt/lo/bin and configure should find it.

 It doesn't help as much as on Linux due to generally worse Windows build 
performance, but it still can help.

 Given that AFAIK Windows bots are now the Jenkins bottleneck, I suppose it 
could help there too, but I'll leave it to the admins to decide when it's a 
good idea to use a random WIP patched ccache.

[1] https://github.com/llunak/ccache/tree/msvc
[2] https://people.collabora.com/~llunak/download/ccache.exe

-- 
 Luboš Luňák
 l.lu...@collabora.com


[Libreoffice-commits] core.git: config_host.mk.in configure.ac external/curl external/openssl solenv/gbuild solenv/gcc-wrappers

2021-11-17 Thread Luboš Luňák (via logerrit)
 config_host.mk.in  |1 
 configure.ac   |  112 +++--
 external/curl/ExternalProject_curl.mk  |1 
 external/curl/UnpackedTarball_curl.mk  |1 
 external/curl/configurable-z-option.patch.0|   20 
 external/openssl/ExternalProject_openssl.mk|1 
 external/openssl/UnpackedTarball_openssl.mk|1 
 external/openssl/configurable-z-option.patch.0 |   34 +++
 solenv/gbuild/PrecompiledHeaders.mk|2 
 solenv/gbuild/gbuild.mk|   18 
 solenv/gbuild/platform/com_GCC_class.mk|6 -
 solenv/gbuild/platform/com_GCC_defs.mk |   14 ---
 solenv/gbuild/platform/com_MSC_class.mk|   18 +++-
 solenv/gbuild/platform/com_MSC_defs.mk |   13 ++
 solenv/gcc-wrappers/wrapper.cxx|   50 ---
 solenv/gcc-wrappers/wrapper.hxx|3 
 16 files changed, 234 insertions(+), 61 deletions(-)

New commits:
commit c48a5f2653f7e76421c140cbd6018deffefccaf9
Author: Luboš Luňák 
AuthorDate: Sat Nov 13 16:20:46 2021 +
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 15:21:44 2021 +0100

support ccache for MSVC too

There's no official MSVC support in ccache yet, but there are patches
in progress of getting upstreamed. So right now it's necessary
to get a patched ccache.
Ccache cannot work with -Zi option, since sharing debuginfo in a .PDB
cannot be cached. Added --enable-z7-symbols that gets enabled
by default if ccache is detected.
It works even with PCHs enabled, and externals seem to work too.
I get almost 100% hit rate on a rebuild, although such a rebuild
is slower than on Linux.

Change-Id: I1d230ee1fccc441b9d9bec794cc2e1ec13161999
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125179
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/config_host.mk.in b/config_host.mk.in
index ec22f695d782..a03ac19747bc 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -209,6 +209,7 @@ export ENABLE_SYMBOLS_FOR=@ENABLE_SYMBOLS_FOR@
 export ENABLE_VALGRIND=@ENABLE_VALGRIND@
 export ENABLE_WASM_STRIP=@ENABLE_WASM_STRIP@
 export ENABLE_WERROR=@ENABLE_WERROR@
+export ENABLE_Z7_DEBUG=@ENABLE_Z7_DEBUG@
 export ENDIANNESS=@ENDIANNESS@
 export EPM=@EPM@
 export EPM_FLAGS=@EPM_FLAGS@
diff --git a/configure.ac b/configure.ac
index 7ebeeaf6e62f..0ee46bed9c74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1758,7 +1758,7 @@ libo_FUZZ_ARG_ENABLE(cups,
 AC_ARG_ENABLE(ccache,
 AS_HELP_STRING([--disable-ccache],
 [Do not try to use ccache automatically.
- By default, unless on Windows, we will try to detect if ccache is 
available; in that case if
+ By default we will try to detect if ccache is available; in that case 
if
  CC/CXX are not yet set, and --enable-icecream is not given, we
  attempt to use ccache. --disable-ccache disables ccache completely.
  Additionally ccache's depend mode is enabled if possible,
@@ -1766,6 +1766,12 @@ AC_ARG_ENABLE(ccache,
 ]),
 ,)
 
+AC_ARG_ENABLE(z7-debug,
+AS_HELP_STRING([--enable-z7-debug],
+[Makes the MSVC compiler use -Z7 for debugging instead of the default 
-Zi. Using this option takes
+ more disk spaces but allows to use ccache. Final PDB files are 
created even with this option enabled.
+ Enabled by default if ccache is detected.]))
+
 libo_FUZZ_ARG_ENABLE(online-update,
 AS_HELP_STRING([--enable-online-update],
 [Enable the online update service that will check for new versions of
@@ -3029,26 +3035,6 @@ dnl 
===
 CCACHE_DEPEND_MODE=
 if test "$enable_ccache" = "no"; then
 CCACHE=""
-elif test "$_os" = "WINNT"; then
-# on windows/VC build do not use ccache - but perhaps sccache is around?
-case "%$CC%$CXX%" in
-# If $CC and/or $CXX already contain "sccache" (possibly suffixed with 
some version number etc),
-# assume that's good then
-*%sccache[[-_' ']]*|*/sccache[[-_' ']]*)
-AC_MSG_NOTICE([sccache seems to be included in a pre-defined CC and/or 
CXX])
-CCACHE_DEPEND_MODE=1
-;;
-*)
-# for sharing code below, reuse CCACHE env var
-AC_PATH_PROG([CCACHE],[sccache],[not found])
-if test "$CCACHE" = "not found"; then
-CCACHE=""
-else
-CCACHE=`win_short_path_for_make "$CCACHE"`
-CCACHE_DEPEND_MODE=1
-fi
-;;
-esac
 elif test -n "$enable_ccache" -o \( "$enable_ccache" = "" -a 
"$enable_icecream" != "yes" \); then
 case "%$CC%$CXX%" in
 # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some 
version number et

[Libreoffice-commits] core.git: canvas/source

2021-11-17 Thread Luboš Luňák (via logerrit)
 canvas/source/vcl/canvashelper.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b4f03a95db84c1d18c9435d13f41787596d34b12
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 10:36:25 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 14:12:48 2021 +0100

stop vclcanvas from ruining alpha of bitmaps in Skia mode

According to the comment and tdf#45219 vclcanvas deliberately forces
alpha to be 1bpp because of poor performance. But that's not the case
with Skia, alpha is always 8bpp there, so all the hack does it make
animations look ugly and it also breaks caching capabilities of the
Skia backend because the hack always generates a new bitmap.

I don't know which VCL backend the original problem was related to,
so at least disable the hack for Skia.

Change-Id: I8a90c32dbe911cb79b617c0c447f3e9ced05f746
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125373
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index 69ef1922de5a..80a0dc2a8fa6 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -707,7 +708,7 @@ namespace vclcanvas
 // actually what mp2ndOutDev is...  well, here we do &
 // assume a 1bpp target - everything beyond 97%
 // transparency is fully transparent
-if( aBmpEx.IsAlpha() )
+if( aBmpEx.IsAlpha() && !SkiaHelper::isVCLSkiaEnabled())
 {
 BitmapFilter::Filter(aBmpEx, 
BitmapAlphaClampFilter(253));
 }
@@ -734,7 +735,7 @@ namespace vclcanvas
 // actually what mp2ndOutDev is...  well, here we do &
 // assume a 1bpp target - everything beyond 97%
 // transparency is fully transparent
-if( aBmpEx.IsAlpha() )
+if( aBmpEx.IsAlpha() && !SkiaHelper::isVCLSkiaEnabled())
 {
 BitmapFilter::Filter(aBmpEx, 
BitmapAlphaClampFilter(253));
 }


[Libreoffice-commits] core.git: vcl/skia

2021-11-17 Thread Luboš Luňák (via logerrit)
 vcl/skia/SkiaHelper.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 23b17e409976f3c106028cc6617ca3a841eb839d
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 10:20:33 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 14:12:29 2021 +0100

Skia dumping is no longer dbgutil-only

This is a mistake from f33b76b4e675818deae244427cef84c576a1a1f8.

Change-Id: Iae69ae0099a62451d156c80255f55b1f6aad4725
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125370
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index cc9303af39f5..631e5b64fe52 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -47,9 +47,7 @@ bool isVCLSkiaEnabled() { return false; }
 #include 
 #include 
 #include 
-#ifdef DBG_UTIL
 #include 
-#endif
 
 namespace SkiaHelper
 {


[Libreoffice-commits] core.git: configure.ac

2021-11-17 Thread Luboš Luňák (via logerrit)
 configure.ac |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 75450b3affc424cccfc68eae13a3271204108b09
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 11:43:00 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 14:11:57 2021 +0100

disable split debug if --enable-lto

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88389 is right that
split-debug doesn't make sense with LTO. Without -ffat-lto-objects
or with Clang .o files aren't even really object files that
would be normally usable. Since gcc complains if the combination
is used, explicitly avoid it.

Change-Id: I76992e94f4790238e5aaee691b5cec54fd0ef3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125379
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 1872faaafbd7..7ebeeaf6e62f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4557,8 +4557,16 @@ AC_SUBST(LD_GC_SECTIONS)
 
 HAVE_GSPLIT_DWARF=
 if test "$enable_split_debug" != no; then
+use_split_debug=
+if test -n "$ENABLE_LTO"; then
+true # Inherently incompatible, since no debug info is created while 
compiling, GCC complains.
+elif test "$enable_split_debug" = yes; then
+use_split_debug=1
 dnl Currently by default enabled only on Linux, feel free to set 
test_split_debug above also for other platforms.
-if test "$enable_split_debug" = yes -o \( "$test_split_debug" = "yes" -a 
-n "$ENABLE_DEBUG$ENABLE_DBGUTIL" \); then
+elif test "$test_split_debug" = "yes" -a -n 
"$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
+use_split_debug=1
+fi
+if test -n "$use_split_debug"; then
 AC_MSG_CHECKING([whether $CC_BASE supports -gsplit-dwarf])
 save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
@@ -4574,7 +4582,7 @@ if test "$enable_split_debug" != no; then
 fi
 fi
 fi
-if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n 
"$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
+if test -z "$HAVE_GCC_SPLIT_DWARF" -a "$test_split_debug" = "yes" -a -n 
"$use_split_debug"; then
 AC_MSG_WARN([Compiler is not capable of creating split debug info, 
linking will require more time and disk space.])
 add_warning "Compiler is not capable of creating split debug info, 
linking will require more time and disk space."
 fi


[Libreoffice-commits] core.git: compilerplugins/clang solenv/clang-format solenv/CompilerTest_compilerplugins_clang.mk

2021-11-17 Thread Luboš Luňák (via logerrit)
 compilerplugins/clang/test/simplifybool.cxx  |  176 ---
 solenv/CompilerTest_compilerplugins_clang.mk |1 
 solenv/clang-format/excludelist  |2 
 3 files changed, 1 insertion(+), 178 deletions(-)

New commits:
commit eb515f11caae5d1b30f7c306fc32111a0cf617b2
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 10:02:06 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 12:48:36 2021 +0100

retire loplugin:simplifybool

The plugin was originally written to rewrite dumb old OOo code
like 'variable != 1 ? true : false'. All that code has already
been rewritten, and now this plugin just enforces matter-of-taste
stylistics on new code.

Change-Id: I8cd2accd7c0ac365b75dcba51a9049bf9e293869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125346
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/compilerplugins/clang/simplifybool.cxx 
b/compilerplugins/clang/store/simplifybool.cxx
similarity index 100%
rename from compilerplugins/clang/simplifybool.cxx
rename to compilerplugins/clang/store/simplifybool.cxx
diff --git a/compilerplugins/clang/test/simplifybool.cxx 
b/compilerplugins/clang/test/simplifybool.cxx
deleted file mode 100644
index a32acccd6c19..
--- a/compilerplugins/clang/test/simplifybool.cxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include 
-// expected-note@rtl/ustring.hxx:* 2 {{the presumed corresponding negated 
operator for 'rtl::OUString' and 'rtl::OUString' is declared here 
[loplugin:simplifybool]}}
-#include 
-// expected-note@rtl/string.hxx:* {{the presumed corresponding negated 
operator for 'rtl::OString' and 'rtl::OString' is declared here 
[loplugin:simplifybool]}}
-#include 
-// expected-note@basegfx/tuple/b3dtuple.hxx:* {{the presumed corresponding 
negated operator for 'basegfx::B3DVector' and 'basegfx::B3DVector' is declared 
here [loplugin:simplifybool]}}
-
-#include 
-
-#pragma clang diagnostic ignored "-Wunknown-warning-option" // for Clang < 13
-#pragma clang diagnostic ignored "-Wunused-but-set-variable"
-
-namespace group1
-{
-void f1(int a, int b)
-{
-if (!(a < b))
-{ // expected-error@-1 {{logical negation of comparison operator, can be 
simplified by inverting operator [loplugin:simplifybool]}}
-a = b;
-}
-};
-
-void f2(float a, float b)
-{
-// no warning expected
-if (!(a < b))
-{
-a = b;
-}
-};
-};
-
-// Consistently either warn about all or none of the below occurrences of "!!":
-namespace group2
-{
-enum E1
-{
-E1_1 = 1
-};
-
-enum E2
-{
-E2_1 = 1
-};
-E2 operator&(E2 e1, E2 e2);
-bool operator!(E2 e);
-
-enum class E3
-{
-E1 = 1
-};
-struct W
-{
-operator bool();
-};
-W operator&(E3 e1, E3 e2);
-
-bool f0(int n) { return !!(n & 1); }
-
-bool f1(E1 e) { return !!(e & E1_1); }
-
-bool f2(E2 e) { return !!(e & E2_1); }
-
-bool f3(E3 e) { return !!(e & E3::E1); }
-};
-
-// record types
-namespace group3
-{
-struct Record1
-{
-bool operator==(const Record1&) const;
-};
-
-struct Record2
-{
-bool operator==(const Record2&) const;
-bool operator!=(const Record2&) const;
-// expected-note@-1 {{the presumed corresponding negated operator for 
'group3::Record2' and 'group3::Record2' is declared here 
[loplugin:simplifybool]}}
-};
-
-struct Record3
-{
-};
-
-bool operator==(const Record3&, const Record3&);
-bool operator!=(const Record3&, const Record3&);
-// expected-note@-1 {{the presumed corresponding negated operator for 
'group3::Record3' and 'group3::Record3' is declared here 
[loplugin:simplifybool]}}
-
-void testRecord()
-{
-Record1 a1;
-Record1 a2;
-// no warning expected, because a negated operator does not exist
-bool v = !(a1 == a2);
-Record2 b1;
-Record2 b2;
-v = !(b1 == b2);
-// expected-error@-1 {{logical negation of comparison operator, can be 
simplified by inverting operator [loplugin:simplifybool]}}
-Record3 c1;
-Record3 c2;
-v = !(c1 == c2);
-// expected-error@-1 {{logical negation of comparison operator, can be 
simplified by inverting operator [loplugin:simplifybool]}}
-OUString d1;
-OUString d2;
-v = !(d1 == d2);
-// expected-error@-1 {{logical negation of comparison operator, can be 
simplified by inverting operator [loplugin:simplifybool]}}
-OString e1;
-OString e2;
-v = !(e1 == e2);
-// expected-error@-1 {{logical negation of comparison operator, can be 
simplified by inverting operator [loplugin:simplifybool]}}
-
-// the operator !

[Libreoffice-commits] core.git: compilerplugins/clang solenv/clang-format solenv/CompilerTest_compilerplugins_clang.mk

2021-11-17 Thread Luboš Luňák (via logerrit)
 compilerplugins/clang/test/finalprotected.cxx |   35 --
 solenv/CompilerTest_compilerplugins_clang.mk  |1 
 solenv/clang-format/excludelist   |2 -
 3 files changed, 1 insertion(+), 37 deletions(-)

New commits:
commit bfe589d13fafc0801d709a79144114d289958cae
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 10:04:35 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 12:48:20 2021 +0100

remove loplugin:finalprotected

It just forces a custom rule that serves no real purpose. There's
no technical difference. If one day a class gets inherited from
then this information will be lost/incorrect. And mixing access
on a virtual function is poor style.

Change-Id: I0c27db8d694ad191a118d4e1d3d4a240e00456fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125337
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/compilerplugins/clang/finalprotected.cxx 
b/compilerplugins/clang/store/finalprotected.cxx
similarity index 100%
rename from compilerplugins/clang/finalprotected.cxx
rename to compilerplugins/clang/store/finalprotected.cxx
diff --git a/compilerplugins/clang/test/finalprotected.cxx 
b/compilerplugins/clang/test/finalprotected.cxx
deleted file mode 100644
index c15564874447..
--- a/compilerplugins/clang/test/finalprotected.cxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-
-class S final {
-protected:
-void f(int f) { f1 = f; }  // expected-error {{final class should not have 
protected members - convert them to private [loplugin:finalprotected]}}
-int f1;  // expected-error {{final class should not have protected 
members - convert them to private [loplugin:finalprotected]}}
-public:
-void g();
-int g1;
-private:
-void h();
-int h1;
-};
-
-class S2 {
-protected:
-void f(int f) { f1 = f; }
-int f1;
-public:
-void g();
-int g1;
-private:
-void h();
-int h1;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/solenv/CompilerTest_compilerplugins_clang.mk 
b/solenv/CompilerTest_compilerplugins_clang.mk
index 53f51e0759ba..75afd793843e 100644
--- a/solenv/CompilerTest_compilerplugins_clang.mk
+++ b/solenv/CompilerTest_compilerplugins_clang.mk
@@ -38,7 +38,6 @@ $(eval $(call 
gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
 compilerplugins/clang/test/external \
 compilerplugins/clang/test/faileddyncast \
 compilerplugins/clang/test/fakebool \
-compilerplugins/clang/test/finalprotected \
 compilerplugins/clang/test/flatten \
 compilerplugins/clang/test/fragiledestructor \
 compilerplugins/clang/test/getstr \
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 2608eb588055..1fd086ffb285 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -1484,7 +1484,6 @@ compilerplugins/clang/externandnotdefined.cxx
 compilerplugins/clang/faileddyncast.cxx
 compilerplugins/clang/fakebool.cxx
 compilerplugins/clang/finalclasses.cxx
-compilerplugins/clang/finalprotected.cxx
 compilerplugins/clang/flatten.cxx
 compilerplugins/clang/fragiledestructor.cxx
 compilerplugins/clang/functionaddress.hxx
@@ -1541,6 +1540,7 @@ compilerplugins/clang/store/deadclass.cxx
 compilerplugins/clang/store/defaultparams.cxx
 compilerplugins/clang/store/deletedspecial.cxx
 compilerplugins/clang/store/derivedclass.cxx
+compilerplugins/clang/store/finalprotected.cxx
 compilerplugins/clang/store/findoncontainer.cxx
 compilerplugins/clang/store/fpcomparison.cxx
 compilerplugins/clang/store/lclstaticfix.cxx


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-17 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/PrecompiledHeaders.mk |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d72237ff21db37f0d8c97f47c8583cba99f141df
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 11:06:26 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 12:47:28 2021 +0100

fix system pch breaking after f22e5078cfac93c50ae5169f6545091

Change-Id: Ie7f63b52b77e821b92fcf6b09af6c8bf43ca9e9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125377
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index 312980265eca..9a8763657d2d 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -160,6 +160,7 @@ gb_PrecompiledHeader_ignore_flags_system := \
 -DVCL_INTERNALS \
 -DZLIB_CONST \
 -include $(SRCDIR)/pch/inc/clangfix.hxx \
+$(gb_PrecompiledHeader_ignore_flags_for_flags_file) \
 
 # Probably also update pch/inc/clangfix.hxx if you extend the list.
 


[Libreoffice-commits] core.git: vcl/qa

2021-11-17 Thread Luboš Luňák (via logerrit)
 vcl/qa/cppunit/skia/skia.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 22b930fefa68db0c581068045c68cad71879b901
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 09:55:35 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 11:00:49 2021 +0100

fix SkiaTest::testDrawDelayedScaleImage() with GPU+HiDPI

Change-Id: I0bdaf2679f1f20f6ba0c28641cd8cc6756e4316b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125369
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx
index f6920ccf1d8a..b94e2ede7eba 100644
--- a/vcl/qa/cppunit/skia/skia.cxx
+++ b/vcl/qa/cppunit/skia/skia.cxx
@@ -435,6 +435,8 @@ void SkiaTest::testDrawDelayedScaleImage()
 {
 if (!SkiaHelper::isVCLSkiaEnabled())
 return;
+if (SkiaHelper::renderMethodToUse() != SkiaHelper::RenderRaster)
+return; // This test tests caching that's done only in raster mode.
 ScopedVclPtr device = 
VclPtr::Create(DeviceFormat::DEFAULT);
 device->SetOutputSizePixel(Size(10, 10));
 device->SetBackground(Wallpaper(COL_WHITE));


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-17 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/PrecompiledHeaders.mk |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 46520710560e53c6d488d71824694bf5e460ee07
Author: Luboš Luňák 
AuthorDate: Wed Nov 17 09:38:26 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 10:58:05 2021 +0100

avoid a PCH build failing because of a directory missing

Change-Id: I3ff3c255d5707b6a802940bc4d96e1a729f1fcc2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125368
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index be0ae7950c4d..312980265eca 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -55,8 +55,10 @@ $(call gb_PrecompiledHeader_get_dep_target,$(1),$(3)) :
 # change, and make the PCH depend on it => the PCH will be rebuilt on any 
flags change
 .PHONY: force
 $(call gb_PrecompiledHeader_get_flags_file,$(1),$(3)) : force
-   echo $(gb_PrecompiledHeader_flags_for_flags_file) | cmp -s - $$@ \
-   || echo $(gb_PrecompiledHeader_flags_for_flags_file) > $$@
+   $$(call gb_Helper_abbreviate_dirs,\
+   mkdir -p $$(dir $$@) && \
+   echo $(gb_PrecompiledHeader_flags_for_flags_file) | cmp -s - 
$$@ \
+   || echo $(gb_PrecompiledHeader_flags_for_flags_file) > $$@)
 
 # despite this being only one .d file, need to run concat-deps on it to
 # re-write external headers from UnpackedTarball


[Libreoffice-commits] core.git: sc/qa sc/source sc/uiconfig

2021-11-17 Thread Luboš Luňák (via logerrit)
 sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods |   22 +++
 sc/source/core/data/table3.cxx   |9 --
 sc/uiconfig/scalc/ui/optcalculatepage.ui |2 -
 3 files changed, 12 insertions(+), 21 deletions(-)

New commits:
commit 8dec2a98ce29251936cd45ebf864a89ff767ee50
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 01:30:24 2021 +0100
Commit: Luboš Luňák 
CommitDate: Wed Nov 17 10:10:58 2021 +0100

revert "vlookup - optimize SC_EQUAL and NOT_EQUAL." (tdf#139612)

That commit breaks lookup when the  "Search criteria = and <> must
apply to whole cells" option is disabled, as it enforces whole cell
checking regardless of the option. Given that the option is enabled
by default in LO ('SearchCriteria' in Calc.xcs) and it's what
MSOffice does as well, and this default gives good performance
regardless of the option, I don't understand the purpose
of the commit. Possibly it was based on a document where somebody
disabled the option and then indeed got worse performance.
Solution: Don't do that :).

This reverts the code parts of a953fa1c0f6a40a08859570516c511f3a841 .
The test I've kept but switched to ensure that partial matching
does work if the option to match whole cells is disabled. I've
also changed the tooltip for the option to mention performance
and not suggest that off is the default.

Change-Id: I56d7b6e7b8e9f0622f7ad6d447daf56c3b705a7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125267
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
    Reviewed-by: Luboš Luňák 

diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods 
b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
index d47779d928a1..fd228881a7cb 100644
--- a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
+++ b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods
@@ -1017,14 +1017,14 @@
   TRUE
  
  
-  VLOOKUP tests that ensure there is no partial matching of cell 
contents
+  VLOOKUP tests that ensure there is partial matching of cell 
contents
  
 
 
  
  
  
-  even though the document option of “search on whole cell” is 
turned off.
+  when the document option of “search on whole cell” is turned 
off.
  
 
 
@@ -1095,10 +1095,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1122,10 +1122,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
@@ -1149,10 +1149,10 @@
  
   #N/A
  
- 
-  #N/A
+ 
+  2
  
- 
+ 
   TRUE
  
  
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 9c7417278658..0ef833511dba 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2767,11 +2767,6 @@ public:
 
 if (nIndex < 0)
 nStrPos = -1;
-else if (rEntry.eOp == SC_EQUAL ||
- rEntry.eOp == SC_NOT_EQUAL)
-{
-nStrPos = pCellStr == pQuer ? 0 : -1;
-}
 else
 { // OUString::indexOf
 nStrPos = rtl_ustr_indexOfStr_WithLength(
@@ -2803,14 +2798,10 @@ public:
 switch (rEntry.eOp)
 {
 case SC_EQUAL:
-bOk = ( nStrPos == 0 );
-break;
 case SC_CONTAINS:
 bOk = ( nStrPos != -1 );
 break;
 case SC_NOT_EQUAL:
-bOk = ( nStrPos != 0 );
-break;
 case SC_DOES_NOT_CONTAIN:
 bOk = ( nStrPos == -1 );
 break;
diff --git a/sc/uiconfig/scalc/ui/optcalculatepage.ui 
b/sc/uiconfig/scalc/ui/optcalculatepage.ui
index 1af846f48ff1..1c0c7f3c2928 100644
--- a/sc/uiconfig/scalc/ui/optcalculatepage.ui
+++ b/sc/uiconfig/scalc/ui/optcalculatepage.ui
@@ -131,7 +131,7 @@
 True
 True
 False
-Enable this for interoperability 
with Microsoft Excel
+Keep this enabled for 
interoperability with Microsoft Excel or for better performance
 True
 True
 


[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qa vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/gdiimpl.hxx |4 +
 vcl/inc/skia/salbmp.hxx  |   21 --
 vcl/inc/skia/utils.hxx   |8 ++
 vcl/qa/cppunit/skia/skia.cxx |   37 +++
 vcl/skia/gdiimpl.cxx |  144 ++-
 vcl/skia/salbmp.cxx  |   49 +++---
 6 files changed, 214 insertions(+), 49 deletions(-)

New commits:
commit 09dfad9565b37353acc0b31054639134f1a85ab9
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 14:01:04 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 18:37:36 2021 +0100

fix drawBitmap() unittests with Skia/HiDPI

Force non-smooth scaling to get exact pixel values. Introduced
in 6792e6e5e49d11a54256b75c4c5a476bb2f10b4a.

Change-Id: Iec2633e9ef8e930688c95ceb1037696456f344f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125312
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 13925700f31d..ac6f33ea7398 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1769,7 +1769,8 @@ sk_sp 
SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
 matrix.set(SkMatrix::kMScaleX, 1.0 * targetSize.Width() / 
sourceSize.Width());
 matrix.set(SkMatrix::kMScaleY, 1.0 * targetSize.Height() / 
sourceSize.Height());
 canvas->concat(matrix);
-samplingOptions = makeSamplingOptions(BmpScaleFlag::BestQuality, 
matrix, 1);
+if (!isUnitTestRunning()) // unittests want exact pixel values
+samplingOptions = makeSamplingOptions(BmpScaleFlag::BestQuality, 
matrix, 1);
 }
 if (alphaBitmap != nullptr)
 {
commit a0a4709eb4226ae15931999fc17afe5b5b9f8081
Author:     Luboš Luňák 
AuthorDate: Tue Nov 16 13:34:37 2021 +0100
Commit:     Luboš Luňák 
CommitDate: Tue Nov 16 18:37:21 2021 +0100

try to avoid scaling bitmaps twice in Skia when drawing

The scenario is that something scales a bitmap and then asks for it
to be drawn (possibly drawn scaled again). One example is
OutputDevice::DrawBitmap() subsampling the bitmap that according
to c0ce7ca4884f7f6d1 is supposed to improve quality with headless(?)
backend, but with Skia it's pointless and it breaks things like
caching during repeated drawing, because then GetSkImage() will need
to generate a new SkImage each time.
Since Skia backend uses delayed scaling, these cases can be sorted
out by checking the stored SkImage and using it if suitable, as
the original image is as good as the rescaled one, but often
it's better - it may be cached, sometimes the scaling operations
cancel each other out (often the case in HiDPI mode).

Change-Id: I0af32f7abdf057a3bdda75247d2dc374eaf1bc4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125311
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index abfa89ca8bfa..9cf14f176185 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -284,6 +284,10 @@ protected:
 static void setCanvasClipRegion(SkCanvas* canvas, const vcl::Region& 
region);
 sk_sp mergeCacheBitmaps(const SkiaSalBitmap& bitmap, const 
SkiaSalBitmap* alphaBitmap,
  const Size& targetSize);
+using DirectImage = SkiaHelper::DirectImage;
+static OString makeCachedImageKey(const SkiaSalBitmap& bitmap, const 
SkiaSalBitmap* alphaBitmap,
+  const Size& targetSize, DirectImage 
bitmapType,
+  DirectImage alphaBitmapType);
 
 // Skia uses floating point coordinates, so when we use integer 
coordinates, sometimes
 // rounding results in off-by-one errors (down), especially when drawing 
using GPU,
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index aa8d245ce741..2959952a3442 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -70,17 +70,21 @@ public:
 // True if GetSkShader() should be preferred to GetSkImage() (or the Alpha 
variants).
 bool PreferSkShader() const;
 
+// Direct image means direct access to the stored SkImage, without checking
+// if its size is up to date. This should be used only in special cases 
with care.
+using DirectImage = SkiaHelper::DirectImage;
 // Returns the contents as SkImage (possibly GPU-backed).
-const sk_sp& GetSkImage() const;
-sk_sp GetSkShader(const SkSamplingOptions& samplingOptions) 
const;
-
+const sk_sp& GetSkImage(DirectImage direct = DirectImage::No) 
const;
+sk_sp GetSkShader(const SkSamplingOptions& samplingOptions,
+DirectImage direct = DirectImage::No) const;
 // Returns the contents as alpha SkImage (possibly GPU-backed)
-const sk_sp& GetAlphaSkImage() const;
-sk_sp GetAlphaSkShader(const SkSamplingOptions& samplingOptions) 
const;
+

[Libreoffice-commits] core.git: vcl/inc vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/gdiimpl.hxx |3 +--
 vcl/inc/skia/salbmp.hxx  |3 +--
 vcl/inc/skia/utils.hxx   |3 ++-
 vcl/skia/README  |3 ++-
 vcl/skia/SkiaHelper.cxx  |   31 +++
 vcl/skia/gdiimpl.cxx |2 --
 vcl/skia/salbmp.cxx  |3 +--
 7 files changed, 22 insertions(+), 26 deletions(-)

New commits:
commit f33b76b4e675818deae244427cef84c576a1a1f8
Author: Luboš Luňák 
AuthorDate: Sat Nov 13 08:30:36 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 18:37:06 2021 +0100

make SkiaHelper::dump() available also in non-dbgutil builds

They are just a set of small functions, and I sometimes need
to debug optimized builds too.

Change-Id: I6350476e8c7fef85460a88b9e3d56d02213764ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125310
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 942567fec0f6..abfa89ca8bfa 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -198,9 +198,8 @@ public:
 
 virtual bool supportsOperation(OutDevSupportType eType) const override;
 
-#ifdef DBG_UTIL
+// Dump contents to a file for debugging.
 void dump(const char* file) const;
-#endif
 
 // Default blend mode for SkPaint is SkBlendMode::kSrcOver
 void drawBitmap(const SalTwoRect& rPosAry, const SkiaSalBitmap& bitmap,
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index b2f452c82979..aa8d245ce741 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -88,9 +88,8 @@ public:
 // Alpha type best suitable for the content.
 SkAlphaType alphaType() const;
 
-#ifdef DBG_UTIL
+// Dump contents to a file for debugging.
 void dump(const char* file) const;
-#endif
 
 // These are to be used only by unittests.
 bool unittestHasBuffer() const { return mBuffer.get(); }
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
index ed404f7cc3eb..0a17ee81bc4d 100644
--- a/vcl/inc/skia/utils.hxx
+++ b/vcl/inc/skia/utils.hxx
@@ -194,10 +194,11 @@ inline SkIRect scaleRect(const SkIRect& rect, int scaling)
 
 #ifdef DBG_UTIL
 void prefillSurface(const sk_sp& surface);
+#endif
+
 VCL_DLLPUBLIC void dump(const SkBitmap& bitmap, const char* file);
 VCL_DLLPUBLIC void dump(const sk_sp& image, const char* file);
 VCL_DLLPUBLIC void dump(const sk_sp& surface, const char* file);
-#endif
 
 VCL_DLLPUBLIC extern uint32_t vendorId;
 
diff --git a/vcl/skia/README b/vcl/skia/README
index f2903d97fdd7..63f6073bac87 100644
--- a/vcl/skia/README
+++ b/vcl/skia/README
@@ -31,7 +31,8 @@ Debugging:
 
 Both SkiaSalBitmap and SkiaSalGraphicsImpl have a dump() method that writes a 
PNG
 with the current contents. There is also SkiaHelper::dump() for dumping 
contents
-of SkBitmap, SkImage and SkSurface.
+of SkBitmap, SkImage and SkSurface. You can use these in a debugger too, for 
example
+'p SkiaHelper::dump(image, "/tmp/a.png")'.
 
 If there is a drawing problem, you can use something like the following piece 
of code
 to dump an image after each relevant operation (or do it in postDraw() if you 
don't
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 57bde5abf919..cc9303af39f5 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -704,6 +704,21 @@ void prepareSkia(std::unique_ptr 
(*createGpuWindowContext
 skiaSupportedByBackend = true;
 }
 
+void dump(const SkBitmap& bitmap, const char* file) { 
dump(SkImage::MakeFromBitmap(bitmap), file); }
+
+void dump(const sk_sp& surface, const char* file)
+{
+surface->getCanvas()->flush();
+dump(makeCheckedImageSnapshot(surface), file);
+}
+
+void dump(const sk_sp& image, const char* file)
+{
+sk_sp data = image->encodeToData(SkEncodedImageFormat::kPNG, 1);
+std::ofstream ostream(file, std::ios::binary);
+ostream.write(static_cast(data->data()), data->size());
+}
+
 #ifdef DBG_UTIL
 void prefillSurface(const sk_sp& surface)
 {
@@ -724,22 +739,6 @@ void prefillSurface(const sk_sp& surface)
 bitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, 
SkSamplingOptions()));
 surface->getCanvas()->drawPaint(paint);
 }
-
-void dump(const SkBitmap& bitmap, const char* file) { 
dump(SkImage::MakeFromBitmap(bitmap), file); }
-
-void dump(const sk_sp& surface, const char* file)
-{
-surface->getCanvas()->flush();
-dump(makeCheckedImageSnapshot(surface), file);
-}
-
-void dump(const sk_sp& image, const char* file)
-{
-sk_sp data = image->encodeToData(SkEncodedImageFormat::kPNG, 1);
-std::ofstream ostream(file, std::ios::binary);
-ostream.write(static_cast(data->data()), data->size());
-}
-
 #endif
 
 } // namespace
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 4019c436d51d..f532e48528a9 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -2213,12 +221

[Libreoffice-commits] core.git: solenv/gbuild

2021-11-16 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/PrecompiledHeaders.mk|3 ++-
 solenv/gbuild/platform/com_GCC_defs.mk |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f22e5078cfac93c50ae5169f65450918b34b0e99
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 15:03:27 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 18:36:23 2021 +0100

do not rebuild PCHs on icecream/ccache change, take #2

It turns out $(gb_SPACE) is not just one space.

Change-Id: I8f5cd13d14d71f0a6dd7d8b89ee857f983d27d20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125309
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index 73cc86c88ee7..be0ae7950c4d 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -39,8 +39,9 @@ ifneq ($(gb_ENABLE_PCH),)
 # all cxxflags to use for compilation
 gb_PrecompiledHeader_cxxflags_includes := $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)
 # flags to save to the .flags file to check if they are the same as last time
+# (note: the leading space in sed is important, to remove the option and its 
separating space)
 gb_PrecompiledHeader_flags_for_flags_file := $$(sort 
$(gb_PrecompiledHeader_cxxflags_includes)) \
-$(if $(gb_PrecompiledHeader_ignore_flags_for_flags_file),| sed 
's/$(gb_PrecompiledHeader_ignore_flags_for_flags_file)//')
+$(if $(gb_PrecompiledHeader_ignore_flags_for_flags_file),| sed 's/ 
$(gb_PrecompiledHeader_ignore_flags_for_flags_file)//')
 
 # $(call 
gb_PrecompiledHeader_generate_rules,pchtarget,linktarget,linktargetmakefilename,pchcxxfile,compiler)
 define gb_PrecompiledHeader_generate_rules
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk 
b/solenv/gbuild/platform/com_GCC_defs.mk
index 4e82b607d8b9..c8f81ff15dc7 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -218,7 +218,7 @@ gb_PrecompiledHeader_EXCEPTIONFLAGS := 
$(gb_LinkTarget_EXCEPTIONFLAGS)
 # We turn on and off this one depending on whether icecream and/or ccache are 
used,
 # and changing cxxflags cause PCH rebuilds, so e.g. a plain temporary 
'CCACHE_DISABLE=1'
 # would cause a rebuild. Ignore the flag there, it's irrelevant for PCH use 
anyway.
-gb_PrecompiledHeader_ignore_flags_for_flags_file := $(gb_SPACE)-Wunused-macros
+gb_PrecompiledHeader_ignore_flags_for_flags_file := -Wunused-macros
 
 # optimization level
 gb_COMPILERNOOPTFLAGS := -O0 -fstrict-aliasing -fstrict-overflow


[Libreoffice-commits] core.git: include/vcl vcl/backendtest vcl/inc vcl/qa

2021-11-16 Thread Luboš Luňák (via logerrit)
 include/vcl/test/GraphicsRenderTests.hxx |1 
 vcl/backendtest/GraphicsRenderTests.cxx  |   22 
 vcl/backendtest/VisualBackendTest.cxx|7 ++
 vcl/backendtest/outputdevice/bitmap.cxx  |   73 ---
 vcl/backendtest/outputdevice/common.cxx  |   81 +++
 vcl/inc/test/outputdevice.hxx|3 +
 vcl/qa/cppunit/BackendTest.cxx   |   19 ++-
 7 files changed, 152 insertions(+), 54 deletions(-)

New commits:
commit ae4a9d5cc50d94f3180ce3e5d3793c0a403074cd
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 12:57:52 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 14:36:13 2021 +0100

add a vcl backend test that draws a sheared bitmap

Change-Id: I06838e01ed41ac41c8b578fd6c7d984f1c073e31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125298
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/vcl/test/GraphicsRenderTests.hxx 
b/include/vcl/test/GraphicsRenderTests.hxx
index 86266eebe317..480cd73f5358 100644
--- a/include/vcl/test/GraphicsRenderTests.hxx
+++ b/include/vcl/test/GraphicsRenderTests.hxx
@@ -83,6 +83,7 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests
 void testDrawDropShapeAAWithPolygon();
 void testDrawBitmap24bpp();
 void testDrawTransformedBitmap24bpp();
+void testComplexDrawTransformedBitmap24bpp();
 void testDrawBitmapExWithAlpha24bpp();
 void testDrawMask24bpp();
 void testDrawBlend24bpp();
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx 
b/vcl/backendtest/GraphicsRenderTests.cxx
index 794910b0f045..1c794b246669 100644
--- a/vcl/backendtest/GraphicsRenderTests.cxx
+++ b/vcl/backendtest/GraphicsRenderTests.cxx
@@ -804,6 +804,27 @@ void GraphicsRenderTests::testDrawTransformedBitmap24bpp()
 }
 }
 
+void GraphicsRenderTests::testComplexDrawTransformedBitmap24bpp()
+{
+vcl::test::OutputDeviceTestBitmap aOutDevTest;
+Bitmap aBitmap = 
aOutDevTest.setupComplexDrawTransformedBitmap(vcl::PixelFormat::N24_BPP);
+OUString aTestName = "testComplexDrawTransformedBitmap24bpp";
+if (!SHOULD_ASSERT)
+{
+appendTestResult(aTestName, "SKIPPED");
+return;
+}
+vcl::test::TestResult eResult
+= 
vcl::test::OutputDeviceTestBitmap::checkComplexTransformedBitmap(aBitmap);
+appendTestResult(aTestName, returnTestStatus(eResult),
+ (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
+if (m_aStoreResultantBitmap)
+{
+BitmapEx aBitmapEx(aBitmap);
+exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", 
aBitmapEx);
+}
+}
+
 void GraphicsRenderTests::testDrawBitmapExWithAlpha24bpp()
 {
 vcl::test::OutputDeviceTestBitmap aOutDevTest;
@@ -2230,6 +2251,7 @@ void GraphicsRenderTests::runALLTests()
 testDrawBezierAAWithPolylineB2D();
 testDrawBitmap24bpp();
 testDrawTransformedBitmap24bpp();
+testComplexDrawTransformedBitmap24bpp();
 testDrawBitmapExWithAlpha24bpp();
 testDrawMask24bpp();
 testDrawBlend24bpp();
diff --git a/vcl/backendtest/VisualBackendTest.cxx 
b/vcl/backendtest/VisualBackendTest.cxx
index 4ba2cf63897b..f7da5e182d57 100644
--- a/vcl/backendtest/VisualBackendTest.cxx
+++ b/vcl/backendtest/VisualBackendTest.cxx
@@ -490,6 +490,13 @@ public:
 drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
 }
 aRectangle = aRegions[index++];
+{
+vcl::test::OutputDeviceTestBitmap aOutDevTest;
+Bitmap aBitmap = 
aOutDevTest.setupComplexDrawTransformedBitmap(vcl::PixelFormat::N24_BPP);
+
assertAndSetBackground(vcl::test::OutputDeviceTestBitmap::checkComplexTransformedBitmap(aBitmap),
 aRectangle, rRenderContext);
+drawBitmapScaledAndCentered(aRectangle, aBitmap, rRenderContext);
+}
+aRectangle = aRegions[index++];
 {
 vcl::test::OutputDeviceTestBitmap aOutDevTest;
 Bitmap aBitmap = 
aOutDevTest.setupDrawBitmapExWithAlpha(vcl::PixelFormat::N24_BPP);
diff --git a/vcl/backendtest/outputdevice/bitmap.cxx 
b/vcl/backendtest/outputdevice/bitmap.cxx
index 066355c53f14..5b491badf587 100644
--- a/vcl/backendtest/outputdevice/bitmap.cxx
+++ b/vcl/backendtest/outputdevice/bitmap.cxx
@@ -43,6 +43,28 @@ Bitmap 
OutputDeviceTestBitmap::setupDrawTransformedBitmap(vcl::PixelFormat aBitm
 }
 
 
+Bitmap 
OutputDeviceTestBitmap::setupComplexDrawTransformedBitmap(vcl::PixelFormat 
aBitmapFormat,bool isBitmapGreyScale)
+{
+Size aBitmapSize(6, 6);
+Bitmap aBitmap(aBitmapSize, aBitmapFormat);
+aBitmap.Erase(constFillColor);
+
+if (isBitmapGreyScale)
+aBitmap.Convert(BmpConversion::N8BitGreys);
+
+initialSetup(17, 14, constBackgroundColor);
+
+basegfx::B2DHomMatrix aTransform;
+aTransform.shearX(0.25);
+aTransform.scale(aBitmapSize.Width() * 2, aBitmapSize.Height() * 2);
+aTransform.translate(1, 1);
+
+mpVirtualDevice->D

[Libreoffice-commits] core.git: configure.ac

2021-11-16 Thread Luboš Luňák (via logerrit)
 configure.ac |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a0f35cd270fa486deb75e1c2c0516d55723cd04a
Author: Luboš Luňák 
AuthorDate: Mon Sep 20 00:26:29 2021 +
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 13:00:02 2021 +0100

hard-require Clang for Skia also on Mac

Since Skia is now the default on Mac too. Clang on Mac should
be the given, but check for consistency.

Change-Id: I490d5434374d98b1d7a219c2bca48747e31eecac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122337
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index f0a4b641edab..4ef19213c15d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12048,10 +12048,10 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != 
TRUE; then
 fi
 fi
 if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
-# Skia is the default on Windows, so hard-require Clang.
+# Skia is the default on Windows and Mac, so hard-require Clang.
 # Elsewhere it's used just by the 'gen' VCL backend which is rarely 
used.
-if test "$_os" = "WINNT"; then
-AC_MSG_ERROR([Clang compiler not found. The Skia library needs to 
be built using Clang.])
+if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
+AC_MSG_ERROR([Clang compiler not found. The Skia library needs to 
be built using Clang, or use --disable-skia.])
 else
 AC_MSG_WARN([Clang compiler not found.])
 fi


[Libreoffice-commits] core.git: officecfg/registry

2021-11-16 Thread Luboš Luňák (via logerrit)
 officecfg/registry/data/org/openoffice/Office/Common.xcu |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7ee24b7358295bf9be323ad177ea00aa8b1588a7
Author: Luboš Luňák 
AuthorDate: Mon Aug 30 11:35:41 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 12:59:44 2021 +0100

make Skia the default now on Mac too (again)

This is a re-land of commit 2489edcbe0f5dc77649fc2e801c1bbffb71692b8,
now that HiDPI support (tdf#144214) has been implemented properly.
Originally coming from the ESC decision from Aug 26th.

Change-Id: I4d397282adeeac50ff19ba651b920c73080d3dfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125273
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu 
b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index b00c5f3d1c18..f543b6ebb3c9 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -51,7 +51,7 @@
   
   
 
-  false
+  true
   false
   true
 


[Libreoffice-commits] core.git: vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   27 +--
 1 file changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 621430208d29e40ab95509a4e94da6e8313ed389
Author: Luboš Luňák 
AuthorDate: Tue Nov 16 08:03:06 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:41:36 2021 +0100

optimize Skia's copyArea() to copy less data

Change-Id: Ia1cd0522643b58ea1be3ad974c1fc5f7fed657d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125268
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b97d2f28c428..4019c436d51d 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1347,17 +1347,32 @@ void SkiaSalGraphicsImpl::privateCopyBits(const 
SalTwoRect& rPosAry, SkiaSalGrap
  rPosAry.mnDestHeight));
 SkPaint paint;
 paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
-SkRect srcRect
-= SkRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY, rPosAry.mnSrcWidth, 
rPosAry.mnSrcHeight);
+SkIRect srcRect = SkIRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY, 
rPosAry.mnSrcWidth,
+rPosAry.mnSrcHeight);
 SkRect destRect = SkRect::MakeXYWH(rPosAry.mnDestX, rPosAry.mnDestY, 
rPosAry.mnDestWidth,
rPosAry.mnDestHeight);
 // Scaling for source coordinates must be done manually.
 if (src->mScaling != 1)
 srcRect = scaleRect(srcRect, src->mScaling);
-// Do not use makeImageSnapshot(rect), as that one may make a needless 
data copy.
-getDrawCanvas()->drawImageRect(makeCheckedImageSnapshot(src->mSurface), 
srcRect, destRect,
-   makeSamplingOptions(rPosAry, mScaling, 
src->mScaling), ,
-   SkCanvas::kFast_SrcRectConstraint);
+if (src == this)
+{
+// Copy-to-self means that we'd take a snapshot, which would refcount 
the data,
+// and then drawing would result in copy in write, copying the entire 
surface.
+// Try to copy less by making a snapshot of only what is needed.
+sk_sp image = makeCheckedImageSnapshot(src->mSurface, 
srcRect);
+srcRect.offset(-srcRect.x(), -srcRect.y());
+getDrawCanvas()->drawImageRect(image, SkRect::Make(srcRect), destRect,
+   makeSamplingOptions(rPosAry, mScaling, 
src->mScaling),
+   , 
SkCanvas::kFast_SrcRectConstraint);
+}
+else
+{
+// Do not use makeImageSnapshot(rect), as that one may make a needless 
data copy.
+getDrawCanvas()->drawImageRect(makeCheckedImageSnapshot(src->mSurface),
+   SkRect::Make(srcRect), destRect,
+   makeSamplingOptions(rPosAry, mScaling, 
src->mScaling),
+   , 
SkCanvas::kFast_SrcRectConstraint);
+}
 }
 
 bool SkiaSalGraphicsImpl::blendBitmap(const SalTwoRect& rPosAry, const 
SalBitmap& rBitmap)


[Libreoffice-commits] core.git: vcl/inc

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/salbmp.hxx |   24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit adba50494e11ca799ce6a794195ff844dfac7cd3
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 22:18:46 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:40:19 2021 +0100

log also whether SkiaSalBitmap has any pending scaling

Change-Id: I09a1921e203e1088577abf75350c8b41e4c78381
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125265
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index 455414fdd7fa..b2f452c82979 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -21,12 +21,13 @@
 #define INCLUDED_VCL_INC_SKIA_SALBMP_H
 
 #include 
-
-#include 
+#include 
 
 #include 
 
-#include 
+#include 
+
+#include 
 
 class VCL_PLUGIN_PUBLIC SkiaSalBitmap final : public SalBitmap
 {
@@ -139,8 +140,8 @@ private:
 #endif
 
 template 
-friend inline std::basic_ostream&
-operator<<(std::basic_ostream& stream, const SkiaSalBitmap* 
bitmap)
+friend std::basic_ostream& 
operator<<(std::basic_ostream& stream,
+ const SkiaSalBitmap* 
bitmap)
 {
 if (bitmap == nullptr)
 return stream << "(null)";
@@ -149,19 +150,32 @@ private:
 // A/a - has alpha SkImage (on GPU/CPU)
 // E - has erase color
 // B - has pixel buffer
+// (wxh) - has pending scaling (after each item)
 stream << static_cast(bitmap) << " " << bitmap->GetSize() 
<< "x"
<< bitmap->GetBitCount();
 if (bitmap->GetBitCount() <= 8 && 
!bitmap->Palette().IsGreyPalette8Bit())
 stream << "p";
 stream << "/";
 if (bitmap->mImage)
+{
 stream << (bitmap->mImage->isTextureBacked() ? "I" : "i");
+if (SkiaHelper::imageSize(bitmap->mImage) != bitmap->mSize)
+stream << "(" << SkiaHelper::imageSize(bitmap->mImage) << ")";
+}
 if (bitmap->mAlphaImage)
+{
 stream << (bitmap->mAlphaImage->isTextureBacked() ? "A" : "a");
+if (SkiaHelper::imageSize(bitmap->mAlphaImage) != bitmap->mSize)
+stream << "(" << SkiaHelper::imageSize(bitmap->mAlphaImage) << 
")";
+}
 if (bitmap->mEraseColorSet)
 stream << "E" << bitmap->mEraseColor;
 if (bitmap->mBuffer)
+{
 stream << "B";
+if (bitmap->mSize != bitmap->mPixelsSize)
+stream << "(" << bitmap->mPixelsSize << ")";
+}
 return stream;
 }
 


[Libreoffice-commits] core.git: vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 07e5e9f4c4318c19dd553459132efa71d456eaef
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 20:07:51 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:40:00 2021 +0100

don't bother caching bitmaps that prefer shaders

Change-Id: Ibc78371f9e2ba92470714847bb6a5b8b96d1037f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125264
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index de1e8c47cb12..b97d2f28c428 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1611,6 +1611,9 @@ sk_sp 
SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
 return image;
 if (alphaBitmap && alphaBitmap->IsFullyOpaqueAsAlpha())
 alphaBitmap = nullptr; // the alpha can be ignored
+if (bitmap.PreferSkShader() && (!alphaBitmap || 
alphaBitmap->PreferSkShader()))
+return image;
+
 // Probably not much point in caching of just doing a copy.
 if (alphaBitmap == nullptr && targetSize == bitmap.GetSize())
 return image;
@@ -1730,7 +1733,8 @@ bool SkiaSalGraphicsImpl::drawAlphaBitmap(const 
SalTwoRect& rPosAry, const SalBi
 = mergeCacheBitmaps(rSkiaSourceBitmap, , imageSize * 
mScaling);
 if (image)
 drawImage(imagePosAry, image, mScaling);
-else if (rSkiaAlphaBitmap.IsFullyOpaqueAsAlpha()) // alpha can be ignored
+else if (rSkiaAlphaBitmap.IsFullyOpaqueAsAlpha()
+ && !rSkiaSourceBitmap.PreferSkShader()) // alpha can be ignored
 drawBitmap(rPosAry, rSkiaSourceBitmap);
 else
 drawShader(rPosAry,
@@ -1744,11 +1748,6 @@ bool SkiaSalGraphicsImpl::drawAlphaBitmap(const 
SalTwoRect& rPosAry, const SalBi
 void SkiaSalGraphicsImpl::drawBitmap(const SalTwoRect& rPosAry, const 
SkiaSalBitmap& bitmap,
  SkBlendMode blendMode)
 {
-if (bitmap.PreferSkShader())
-{
-drawShader(rPosAry, bitmap.GetSkShader(makeSamplingOptions(rPosAry, 
mScaling)), blendMode);
-return;
-}
 // Use mergeCacheBitmaps(), which may decide to cache the result, avoiding 
repeated
 // scaling.
 SalTwoRect imagePosAry(rPosAry);
@@ -1766,6 +1765,8 @@ void SkiaSalGraphicsImpl::drawBitmap(const SalTwoRect& 
rPosAry, const SkiaSalBit
 sk_sp image = mergeCacheBitmaps(bitmap, nullptr, imageSize * 
mScaling);
 if (image)
 drawImage(imagePosAry, image, mScaling, blendMode);
+else if (bitmap.PreferSkShader())
+drawShader(rPosAry, bitmap.GetSkShader(makeSamplingOptions(rPosAry, 
mScaling)), blendMode);
 else
 drawImage(rPosAry, bitmap.GetSkImage(), 1, blendMode);
 }


[Libreoffice-commits] core.git: vcl/inc vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/gdiimpl.hxx |4 +--
 vcl/skia/gdiimpl.cxx |   61 +--
 2 files changed, 40 insertions(+), 25 deletions(-)

New commits:
commit 6792e6e5e49d11a54256b75c4c5a476bb2f10b4a
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 18:19:27 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:39:43 2021 +0100

when caching bitmaps in skia, take into account HiDPI

Since the image will be actually eventually drawn twice as big,
cache an image that is twice as big.

Change-Id: Iea0340cd92c102e453330723c797659c742feb63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125263
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 70bbcf5c4dcc..942567fec0f6 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -206,7 +206,7 @@ public:
 void drawBitmap(const SalTwoRect& rPosAry, const SkiaSalBitmap& bitmap,
 SkBlendMode blendMode = SkBlendMode::kSrcOver);
 
-void drawImage(const SalTwoRect& rPosAry, const sk_sp& aImage,
+void drawImage(const SalTwoRect& rPosAry, const sk_sp& aImage, 
int srcScaling = 1,
SkBlendMode eBlendMode = SkBlendMode::kSrcOver);
 
 void drawShader(const SalTwoRect& rPosAry, const sk_sp& shader,
@@ -284,7 +284,7 @@ protected:
 void resetCanvasScalingAndClipping();
 static void setCanvasClipRegion(SkCanvas* canvas, const vcl::Region& 
region);
 sk_sp mergeCacheBitmaps(const SkiaSalBitmap& bitmap, const 
SkiaSalBitmap* alphaBitmap,
- const Size targetSize);
+ const Size& targetSize);
 
 // Skia uses floating point coordinates, so when we use integer 
coordinates, sometimes
 // rounding results in off-by-one errors (down), especially when drawing 
using GPU,
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index ebd1389c5970..de1e8c47cb12 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1604,9 +1604,8 @@ bool SkiaSalGraphicsImpl::drawEPS(tools::Long, 
tools::Long, tools::Long, tools::
 // Especially in raster mode scaling and alpha blending may be expensive if 
done repeatedly.
 sk_sp SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& 
bitmap,
   const SkiaSalBitmap* 
alphaBitmap,
-  const Size targetSize)
+  const Size& targetSize)
 {
-// TODO This should take into account mScaling!=1, and callers should use 
that too.
 sk_sp image;
 if (targetSize.IsEmpty())
 return image;
@@ -1631,7 +1630,7 @@ sk_sp 
SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
 // In some cases (tdf#134237) the target size may be very large. In that 
case it's
 // better to rely on Skia to clip and draw only the necessary, rather than 
prepare
 // a very large image only to not use most of it.
-const Size drawAreaSize = mClipRegion.GetBoundRect().GetSize();
+const Size drawAreaSize = mClipRegion.GetBoundRect().GetSize() * mScaling;
 if (targetSize.Width() > drawAreaSize.Width() || targetSize.Height() > 
drawAreaSize.Height())
 {
 // This is a bit tricky. The condition above just checks that at least 
a part of the resulting
@@ -1727,9 +1726,10 @@ bool SkiaSalGraphicsImpl::drawAlphaBitmap(const 
SalTwoRect& rPosAry, const SalBi
 imagePosAry.mnSrcHeight = imagePosAry.mnDestHeight;
 imageSize = Size(imagePosAry.mnSrcWidth, imagePosAry.mnSrcHeight);
 }
-sk_sp image = mergeCacheBitmaps(rSkiaSourceBitmap, 
, imageSize);
+sk_sp image
+= mergeCacheBitmaps(rSkiaSourceBitmap, , imageSize * 
mScaling);
 if (image)
-drawImage(imagePosAry, image);
+drawImage(imagePosAry, image, mScaling);
 else if (rSkiaAlphaBitmap.IsFullyOpaqueAsAlpha()) // alpha can be ignored
 drawBitmap(rPosAry, rSkiaSourceBitmap);
 else
@@ -1763,18 +1763,20 @@ void SkiaSalGraphicsImpl::drawBitmap(const SalTwoRect& 
rPosAry, const SkiaSalBit
 imagePosAry.mnSrcHeight = imagePosAry.mnDestHeight;
 imageSize = Size(imagePosAry.mnSrcWidth, imagePosAry.mnSrcHeight);
 }
-sk_sp image = mergeCacheBitmaps(bitmap, nullptr, imageSize);
+sk_sp image = mergeCacheBitmaps(bitmap, nullptr, imageSize * 
mScaling);
 if (image)
-drawImage(imagePosAry, image, blendMode);
+drawImage(imagePosAry, image, mScaling, blendMode);
 else
-drawImage(rPosAry, bitmap.GetSkImage(), blendMode);
+drawImage(rPosAry, bitmap.GetSkImage(), 1, blendMode);
 }
 
 void SkiaSalGraphicsImpl::drawImage(const SalTwoRect& rPosAry, const 
sk_sp& aImage,
-SkBlendMode eBlendMod

[Libreoffice-commits] core.git: vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/skia/x11/gdiimpl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 29a2120fcf56ef7fcdb5c95e896e4366454b63bf
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 18:17:57 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:39:27 2021 +0100

apply SAL_FORCE_HIDPI_SCALING on X11 even while drawing

It'll draw double-sized 1/4 of the content in the topleft corner
of windows, but it's still useful for some tests.

Change-Id: I20c6d2382d704ddcd67b8cb81eb7abf37b57a92f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125262
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/x11/gdiimpl.cxx b/vcl/skia/x11/gdiimpl.cxx
index 03211d8050dd..fa0f81176a5d 100644
--- a/vcl/skia/x11/gdiimpl.cxx
+++ b/vcl/skia/x11/gdiimpl.cxx
@@ -46,9 +46,10 @@ void 
X11SkiaSalGraphicsImpl::createWindowSurfaceInternal(bool forceRaster)
 assert(!mSurface);
 assert(mX11Parent.GetDrawable() != None);
 RenderMethod renderMethod = forceRaster ? RenderRaster : 
renderMethodToUse();
+mScaling = getWindowScaling();
 mWindowContext = createWindowContext(mX11Parent.GetXDisplay(), 
mX11Parent.GetDrawable(),
- (), GetWidth(), 
GetHeight(),
- renderMethod, false);
+ (), GetWidth() * 
mScaling,
+ GetHeight() * mScaling, renderMethod, 
false);
 if (mWindowContext)
 {
 // See flushSurfaceToWindowContext().


[Libreoffice-commits] core.git: vcl/backendtest vcl/inc vcl/osx vcl/README.vars.md vcl/skia

2021-11-16 Thread Luboš Luňák (via logerrit)
 vcl/README.vars.md  |4 
 vcl/backendtest/outputdevice/common.cxx |2 
 vcl/inc/skia/gdiimpl.hxx|   20 ++
 vcl/inc/skia/osx/gdiimpl.hxx|3 
 vcl/inc/skia/utils.hxx  |   61 +++-
 vcl/osx/salgdiutils.cxx |5 
 vcl/skia/gdiimpl.cxx|  235 
 vcl/skia/osx/gdiimpl.cxx|   65 ++--
 vcl/skia/salbmp.cxx |   11 +
 9 files changed, 312 insertions(+), 94 deletions(-)

New commits:
commit b5983dbe2c41f38e653201574cf20cd4bd76e950
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 14:01:55 2021 +0100
Commit: Luboš Luňák 
CommitDate: Tue Nov 16 10:38:54 2021 +0100

implement HiDPI support for Skia/Mac (tdf#144214)

The basic idea is the same as the 'aqua' backend, simply set up
a scaling matrix for all drawing. That will take care of the basic
drawing everything twice as large, which is twice the resolution.
And then blit this data to the window, which expects data this way.

Converting back from backing surface needs explicit coordinate
conversions, and when converting to a bitmap the bitmap needs
to be scaled down in order to appear normally sized. Fortunately
I've already implemented delayed scaling, which means that if
the bitmap is drawn later again without any modifications, no
data would be lost (to be done in a follow-up commit).

Unittests occassionally need special handling, as such scaling
down to bitmap not being smoothed, because they expect exact
color values.

Change-Id: Ieadf2c3693f7c9676c31c7394d46299addf7880c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125060
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/README.vars.md b/vcl/README.vars.md
index cdf356f6a2e0..7e0c3c2db0ad 100644
--- a/vcl/README.vars.md
+++ b/vcl/README.vars.md
@@ -64,3 +64,7 @@ will be used to write the log under `instdir/uitest/`.
 ## Kf5
 
 * `SAL_VCL_KF5_USE_QFONT` - use `QFont` for text rendering (default for qt5, 
but not kf5)
+
+## Mac
+
+* `SAL_FORCE_HIDPI_SCALING` - set to 2 to fake HiDPI drawing (useful for 
unittests, windows may draw only top-left 1/4 of the content scaled)
diff --git a/vcl/backendtest/outputdevice/common.cxx 
b/vcl/backendtest/outputdevice/common.cxx
index 21a32635ab85..80408fac70fe 100644
--- a/vcl/backendtest/outputdevice/common.cxx
+++ b/vcl/backendtest/outputdevice/common.cxx
@@ -1370,7 +1370,7 @@ TestResult 
OutputDeviceTestCommon::checkRadialGradient(Bitmap& bitmap)
 int nNumberOfErrors = 0;
 // The default VCL implementation is off-center in the direction to the 
top-left.
 // This means not all corners will be pure white => quirks.
-checkValue(pAccess, 1, 1, COL_WHITE, nNumberOfQuirks, nNumberOfErrors, 255 
/ 10, 255 / 3);
+checkValue(pAccess, 1, 1, COL_WHITE, nNumberOfQuirks, nNumberOfErrors, 255 
/ 10, 255 / 2);
 checkValue(pAccess, 1, 10, COL_WHITE, nNumberOfQuirks, nNumberOfErrors, 
255 / 10, 255 / 5);
 checkValue(pAccess, 10, 1, COL_WHITE, nNumberOfQuirks, nNumberOfErrors, 
255 / 10, 255 / 5);
 checkValue(pAccess, 10, 10, COL_WHITE, nNumberOfQuirks, nNumberOfErrors, 
255 / 10, 255 / 5);
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 03a4d5cf0413..70bbcf5c4dcc 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -239,6 +239,7 @@ protected:
 
 void privateDrawAlphaRect(tools::Long nX, tools::Long nY, tools::Long 
nWidth,
   tools::Long nHeight, double nTransparency, bool 
blockAA = false);
+void privateCopyBits(const SalTwoRect& rPosAry, SkiaSalGraphicsImpl* src);
 
 void setProvider(SalGeometryProvider* provider) { mProvider = provider; }
 
@@ -256,6 +257,8 @@ protected:
 int GetWidth() const { return mProvider ? mProvider->GetWidth() : 1; }
 // get the height of the device
 int GetHeight() const { return mProvider ? mProvider->GetHeight() : 1; }
+// Get the global HiDPI scaling factor.
+virtual int getWindowScaling() const;
 
 SkCanvas* getXorCanvas();
 void applyXor();
@@ -277,6 +280,8 @@ protected:
 // and swapping to the screen is not _that_slow.
 mDirtyRect.join(addedRect);
 }
+void setCanvasScalingAndClipping();
+void resetCanvasScalingAndClipping();
 static void setCanvasClipRegion(SkCanvas* canvas, const vcl::Region& 
region);
 sk_sp mergeCacheBitmaps(const SkiaSalBitmap& bitmap, const 
SkiaSalBitmap* alphaBitmap,
  const Size targetSize);
@@ -305,9 +310,12 @@ protected:
 if (graphics == nullptr)
 return stream << "(null)";
 // O - offscreen, G - GPU-based, R - raster
-return stream << static_cast(graphics) << " "
-  << Size(graphics->GetWidth(), graphi

[Libreoffice-commits] core.git: sc/source

2021-11-15 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

New commits:
commit b90a5d0f23ffdf1b43c752db424c65bec6f0e8f1
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 14:53:50 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 15 17:56:14 2021 +0100

Revert "improve performance of cell equality comparisons)" (tdf#139612)

This reverts commit 5e9c2677e8fcd19b289d947b94ceba52b138728b.

Reason for revert: I based this on code that tdf#139612 talks about, and 
which is possibly incorrect.

Change-Id: Ie9e46a19ac8fe10bbf6cf6f429741200684d5bfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125138
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 02c2619624b5..9c7417278658 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2705,12 +2705,6 @@ public:
 // Simple string matching i.e. no regexp match.
 if (isTextMatchOp(rEntry))
 {
-bool matchWholeCell = bMatchWholeCell;
-// When comparing for (in)equality, we can simply compare the 
whole cell
-// even when not explicitly asked, and that code is faster 
(it's simpler,
-// no SharedString temporary, etc.).
-if( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL )
-matchWholeCell = true;
 if (rItem.meType != ScQueryEntry::ByString && 
rItem.maString.isEmpty())
 {
 // #i18374# When used from functions (match, countif, 
sumif, vlookup, hlookup, lookup),
@@ -2720,7 +2714,7 @@ public:
 if ( rEntry.eOp == SC_NOT_EQUAL )
 bOk = !bOk;
 }
-else if ( matchWholeCell )
+else if ( bMatchWholeCell )
 {
 if (pValueSource1)
 {
@@ -2758,7 +2752,7 @@ public:
 sal_Int32 nStrPos;
 
 if (!mbCaseSensitive)
-{
+{ // Common case for vlookup etc.
 const svl::SharedString rSource(pValueSource1? 
*pValueSource1 : mrStrPool.intern(*pValueSource2));
 
 const rtl_uString *pQuer = 
rItem.maString.getDataIgnoreCase();


[Libreoffice-commits] core.git: solenv/Executable_gbuildtojson.mk solenv/Executable_gcc-wrapper.mk solenv/Executable_g++-wrapper.mk solenv/StaticLibrary_wrapper.mk

2021-11-15 Thread Luboš Luňák (via logerrit)
 solenv/Executable_g++-wrapper.mk  |2 +-
 solenv/Executable_gbuildtojson.mk |2 +-
 solenv/Executable_gcc-wrapper.mk  |2 +-
 solenv/StaticLibrary_wrapper.mk   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f0b745e59f150ea33fc09eb88d682f8cbc085f7c
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 12:22:59 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 15 17:55:53 2021 +0100

build all solenv build tools always as optimized

Because they are tools used during the build.

Change-Id: I66ef65c16551a5242dcc687e200c81cdab7b463f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125251
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/Executable_g++-wrapper.mk b/solenv/Executable_g++-wrapper.mk
index 526ff3aafb74..1c4eb8dae489 100644
--- a/solenv/Executable_g++-wrapper.mk
+++ b/solenv/Executable_g++-wrapper.mk
@@ -10,7 +10,7 @@
 $(eval $(call gb_Executable_Executable,g++-wrapper))
 
 $(eval $(call gb_Executable_add_exception_objects,g++-wrapper,\
-   solenv/gcc-wrappers/g++ \
+   solenv/gcc-wrappers/g++, $(gb_COMPILEROPTFLAGS) \
 ))
 
 $(eval $(call gb_Executable_use_static_libraries,g++-wrapper,\
diff --git a/solenv/Executable_gbuildtojson.mk 
b/solenv/Executable_gbuildtojson.mk
index 6797bf3ac83e..bffc9904920e 100644
--- a/solenv/Executable_gbuildtojson.mk
+++ b/solenv/Executable_gbuildtojson.mk
@@ -10,7 +10,7 @@
 $(eval $(call gb_Executable_Executable,gbuildtojson))
 
 $(eval $(call gb_Executable_add_exception_objects,gbuildtojson,\
-   solenv/gbuildtojson/gbuildtojson \
+   solenv/gbuildtojson/gbuildtojson, $(gb_COMPILEROPTFLAGS) \
 ))
 
 # vim:set noet sw=4 ts=4:
diff --git a/solenv/Executable_gcc-wrapper.mk b/solenv/Executable_gcc-wrapper.mk
index ae76a3376b95..207e9158455d 100644
--- a/solenv/Executable_gcc-wrapper.mk
+++ b/solenv/Executable_gcc-wrapper.mk
@@ -10,7 +10,7 @@
 $(eval $(call gb_Executable_Executable,gcc-wrapper))
 
 $(eval $(call gb_Executable_add_exception_objects,gcc-wrapper,\
-   solenv/gcc-wrappers/gcc \
+   solenv/gcc-wrappers/gcc, $(gb_COMPILEROPTFLAGS) \
 ))
 
 $(eval $(call gb_Executable_use_static_libraries,gcc-wrapper,\
diff --git a/solenv/StaticLibrary_wrapper.mk b/solenv/StaticLibrary_wrapper.mk
index 8fe81ef7f8c4..403c66c6893e 100644
--- a/solenv/StaticLibrary_wrapper.mk
+++ b/solenv/StaticLibrary_wrapper.mk
@@ -10,7 +10,7 @@
 $(eval $(call gb_StaticLibrary_StaticLibrary,wrapper))
 
 $(eval $(call gb_StaticLibrary_add_exception_objects,wrapper,\
-   solenv/gcc-wrappers/wrapper \
+   solenv/gcc-wrappers/wrapper, $(gb_COMPILEROPTFLAGS) \
 ))
 
 # vim:set noet sw=4 ts=4:


[Libreoffice-commits] core.git: sw/source

2021-11-15 Thread Luboš Luňák (via logerrit)
 sw/source/core/layout/paintfrm.cxx |   33 ++---
 1 file changed, 18 insertions(+), 15 deletions(-)

New commits:
commit 8cfc86c652bc02eca2733498d4459bd24de2158b
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 11:36:39 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 15 16:53:53 2021 +0100

disable Writer shadow hack in LOK case

LOK redraws always with new content, so there's no need to rewrite
any possible previous content, and this breaks transparency in LOK
case.

Change-Id: I1df3fe738f5ac1290720f0e18d6d391e220eb8ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125133
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 554ddc4bbc44..9abc517a2a4f 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5851,25 +5851,28 @@ enum PaintArea {LEFT, RIGHT, TOP, BOTTOM};
 /// Wrapper around pOut->DrawBitmapEx.
 static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& 
aPoint, const Size& aSize, const BitmapEx& rBitmapEx, PaintArea eArea)
 {
-// The problem is that if we get called multiple times and the color is
-// partly transparent, then the result will get darker and darker. To avoid
-// this, always paint the background color before doing the real paint.
-tools::Rectangle aRect(aPoint, aSize);
-
-if (!aRect.IsEmpty())
+if(!comphelper::LibreOfficeKit::isActive())
 {
-switch (eArea)
+// The problem is that if we get called multiple times and the color is
+// partly transparent, then the result will get darker and darker. To 
avoid
+// this, always paint the background color before doing the real paint.
+tools::Rectangle aRect(aPoint, aSize);
+
+if (!aRect.IsEmpty())
 {
-case LEFT: aRect.SetLeft( aRect.Right() - 1 ); break;
-case RIGHT: aRect.SetRight( aRect.Left() + 1 ); break;
-case TOP: aRect.SetTop( aRect.Bottom() - 1 ); break;
-case BOTTOM: aRect.SetBottom( aRect.Top() + 1 ); break;
+switch (eArea)
+{
+case LEFT: aRect.SetLeft( aRect.Right() - 1 ); break;
+case RIGHT: aRect.SetRight( aRect.Left() + 1 ); break;
+case TOP: aRect.SetTop( aRect.Bottom() - 1 ); break;
+case BOTTOM: aRect.SetBottom( aRect.Top() + 1 ); break;
+}
 }
-}
 
-pOut->SetFillColor(SwViewOption::GetAppBackgroundColor());
-pOut->SetLineColor();
-pOut->DrawRect(pOut->PixelToLogic(aRect));
+pOut->SetFillColor(SwViewOption::GetAppBackgroundColor());
+pOut->SetLineColor();
+pOut->DrawRect(pOut->PixelToLogic(aRect));
+}
 
 // Tiled render if necessary
 tools::Rectangle aComplete(aPoint, aSize);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source

2021-11-15 Thread Luboš Luňák (via logerrit)
 sw/source/core/layout/paintfrm.cxx |   33 ++---
 1 file changed, 18 insertions(+), 15 deletions(-)

New commits:
commit 1b03d81bca698f0d1fa2dff7038c5d43196f8b61
Author: Luboš Luňák 
AuthorDate: Mon Nov 15 11:36:39 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 15 16:52:27 2021 +0100

disable Writer shadow hack in LOK case

LOK redraws always with new content, so there's no need to rewrite
any possible previous content, and this breaks transparency in LOK
case.

Change-Id: I1df3fe738f5ac1290720f0e18d6d391e220eb8ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125225
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 4eb886a644f7..82d1d4fbcbb7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5776,25 +5776,28 @@ enum PaintArea {LEFT, RIGHT, TOP, BOTTOM};
 /// Wrapper around pOut->DrawBitmapEx.
 static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& 
aPoint, const Size& aSize, const BitmapEx& rBitmapEx, PaintArea eArea)
 {
-// The problem is that if we get called multiple times and the color is
-// partly transparent, then the result will get darker and darker. To avoid
-// this, always paint the background color before doing the real paint.
-tools::Rectangle aRect(aPoint, aSize);
-
-if (!aRect.IsEmpty())
+if(!comphelper::LibreOfficeKit::isActive())
 {
-switch (eArea)
+// The problem is that if we get called multiple times and the color is
+// partly transparent, then the result will get darker and darker. To 
avoid
+// this, always paint the background color before doing the real paint.
+tools::Rectangle aRect(aPoint, aSize);
+
+if (!aRect.IsEmpty())
 {
-case LEFT: aRect.SetLeft( aRect.Right() - 1 ); break;
-case RIGHT: aRect.SetRight( aRect.Left() + 1 ); break;
-case TOP: aRect.SetTop( aRect.Bottom() - 1 ); break;
-case BOTTOM: aRect.SetBottom( aRect.Top() + 1 ); break;
+switch (eArea)
+{
+case LEFT: aRect.SetLeft( aRect.Right() - 1 ); break;
+case RIGHT: aRect.SetRight( aRect.Left() + 1 ); break;
+case TOP: aRect.SetTop( aRect.Bottom() - 1 ); break;
+case BOTTOM: aRect.SetBottom( aRect.Top() + 1 ); break;
+}
 }
-}
 
-pOut->SetFillColor(SwViewOption::GetAppBackgroundColor());
-pOut->SetLineColor();
-pOut->DrawRect(pOut->PixelToLogic(aRect));
+pOut->SetFillColor(SwViewOption::GetAppBackgroundColor());
+pOut->SetLineColor();
+pOut->DrawRect(pOut->PixelToLogic(aRect));
+}
 
 // Tiled render if necessary
 tools::Rectangle aComplete(aPoint, aSize);


[Libreoffice-commits] core.git: configure.ac

2021-11-14 Thread Luboš Luňák (via logerrit)
 configure.ac |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 63bb32dff8a5cd469a6e86fa7eb9119d4c40dcfa
Author: Luboš Luňák 
AuthorDate: Sun Nov 14 15:50:18 2021 +0100
Commit: Luboš Luňák 
CommitDate: Sun Nov 14 18:41:35 2021 +0100

clang-cl requires -Xclang for -fpch-* options

Change-Id: I96fb0ffaf66476a605966df3f2bde3756ae67ec8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125198
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 2f1764ac09cc..f0a4b641edab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5949,14 +5949,18 @@ AC_SUBST(BUILDING_PCH_WITH_OBJ)
 
 PCH_CODEGEN=
 PCH_NO_CODEGEN=
+fpch_prefix=
+if test "$COM" = MSC; then
+fpch_prefix="-Xclang "
+fi
 if test -n "$BUILDING_PCH_WITH_OBJ"; then
-AC_MSG_CHECKING([whether $CC supports -fpch-codegen])
+AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-codegen])
 save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -Werror -fpch-codegen"
+CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-codegen"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],
 [
-PCH_CODEGEN="-fpch-codegen"
-PCH_NO_CODEGEN="-fno-pch-codegen"
+PCH_CODEGEN="${fpch_prefix}-fpch-codegen"
+PCH_NO_CODEGEN="${fpch_prefix}-fno-pch-codegen"
 ],[])
 CFLAGS=$save_CFLAGS
 if test -n "$PCH_CODEGEN"; then
@@ -5969,10 +5973,10 @@ AC_SUBST(PCH_CODEGEN)
 AC_SUBST(PCH_NO_CODEGEN)
 PCH_DEBUGINFO=
 if test -n "$BUILDING_PCH_WITH_OBJ"; then
-AC_MSG_CHECKING([whether $CC supports -fpch-debuginfo])
+AC_MSG_CHECKING([whether $CC supports ${fpch_prefix}-fpch-debuginfo])
 save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -Werror -fpch-debuginfo"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ 
PCH_DEBUGINFO="-fpch-debuginfo" ],[])
+CFLAGS="$CFLAGS -Werror ${fpch_prefix}-fpch-debuginfo"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ 
PCH_DEBUGINFO="${fpch_prefix}-fpch-debuginfo" ],[])
 CFLAGS=$save_CFLAGS
 if test -n "$PCH_DEBUGINFO"; then
 AC_MSG_RESULT(yes)


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-13 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/LinkTarget.mk |2 +-
 solenv/gbuild/PrecompiledHeaders.mk |   14 ++
 solenv/gbuild/platform/com_GCC_class.mk |   20 +++-
 solenv/gbuild/platform/com_GCC_defs.mk  |5 +
 solenv/gbuild/platform/com_MSC_class.mk |   12 +++-
 5 files changed, 34 insertions(+), 19 deletions(-)

New commits:
commit 359b53acdb14f1661e35c75d8c17fcac9b59faea
Author: Luboš Luňák 
AuthorDate: Sat Nov 13 09:32:15 2021 +0100
Commit: Luboš Luňák 
CommitDate: Sat Nov 13 13:43:39 2021 +0100

do not rebuild PCHs on icecream/ccache change

We turn -Wunused-macros on or off depending on whether icecream/ccache
are used, and since now PCHs rebuild on CXXFLAGS changes, a plain
temporary 'CCACHE_DISABLE=1' caused a rebuild.

Change-Id: I63d539ac037d595f76a39e585011d1fde54f7f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125125
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 71be0790b59b..b0b716ace55b 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1915,7 +1915,7 @@ $(call gb_LinkTarget_get_pch_reuse_timestamp,$(4)) : 
$(call gb_PrecompiledHeader
$(call gb_PrecompiledHeader_check_flags,$(4),$(2),\
$(call gb_PrecompiledHeader_get_target,$(3),$(4)),\
$(call gb_PrecompiledHeader_get_flags_file,$(3),$(4)),\
-   $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS))
+   $(gb_PrecompiledHeader_cxxflags_includes))
$$(call gb_PrecompiledHeader__copy_reuse_files,$(1),$(3),$(4))
mkdir -p $$(dir $$@) && touch $$@
 
diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index 28f2308c8e92..73cc86c88ee7 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -36,6 +36,12 @@ ifneq ($(gb_ENABLE_PCH),)
 # for $(1)'s and things that are constant.
 # The defines are needed to get the right version of 
gb_PrecompiledHeader__get_debugdir.
 
+# all cxxflags to use for compilation
+gb_PrecompiledHeader_cxxflags_includes := $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)
+# flags to save to the .flags file to check if they are the same as last time
+gb_PrecompiledHeader_flags_for_flags_file := $$(sort 
$(gb_PrecompiledHeader_cxxflags_includes)) \
+$(if $(gb_PrecompiledHeader_ignore_flags_for_flags_file),| sed 
's/$(gb_PrecompiledHeader_ignore_flags_for_flags_file)//')
+
 # $(call 
gb_PrecompiledHeader_generate_rules,pchtarget,linktarget,linktargetmakefilename,pchcxxfile,compiler)
 define gb_PrecompiledHeader_generate_rules
 
@@ -48,8 +54,8 @@ $(call gb_PrecompiledHeader_get_dep_target,$(1),$(3)) :
 # change, and make the PCH depend on it => the PCH will be rebuilt on any 
flags change
 .PHONY: force
 $(call gb_PrecompiledHeader_get_flags_file,$(1),$(3)) : force
-   echo $$(sort $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)) | cmp -s - $$@ \
-   || echo $$(sort $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)) > $$@
+   echo $(gb_PrecompiledHeader_flags_for_flags_file) | cmp -s - $$@ \
+   || echo $(gb_PrecompiledHeader_flags_for_flags_file) > $$@
 
 # despite this being only one .d file, need to run concat-deps on it to
 # re-write external headers from UnpackedTarball
@@ -57,8 +63,8 @@ $(call gb_PrecompiledHeader_get_target,$(1),$(3)) :
test "$$(PCH_LINKTARGETMAKEFILENAME)" = "$(3)" \
 || ( echo "Error, PCH $(1) built by 
$$(PCH_LINKTARGETMAKEFILENAME) instead of $(3)" >&2; exit 1)
rm -f $$@
-   $$(call 
gb_PrecompiledHeader__command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(3),$(5))
-   $$(call 
gb_PrecompiledHeader__sum_command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(3))
+   $$(call 
gb_PrecompiledHeader__command,$$@,$(1),$$<,$(gb_PrecompiledHeader_cxxflags_includes),$$(INCLUDE),$(3),$(5))
+   $$(call 
gb_PrecompiledHeader__sum_command,$$@,$(1),$$<,$(gb_PrecompiledHeader_cxxflags_includes),$$(INCLUDE),$(3))
 ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$$(call gb_var2file,$$(shell 
$$(gb_MKTEMP)),200,$$(call gb_PrecompiledHeader_get_dep_target_tmp,$(1),$(3))) 
&& \
diff --git a/solenv/gbuild/platform/com_GCC_class.mk 
b/solenv/gbuild/platform/com_GCC_class.mk
index 58ec04c513bb..ba12572f4341 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -129,51 +129,53 @@ endif
 # This is for MSVC's object file built directly as a side-effect of building 
the PCH.
 gb_PrecompiledHeader_get_objectfile =
 
+# $(call 
gb_PrecompiledHeader__command,pchfile,p

[Libreoffice-commits] core.git: include/vcl vcl/backendtest vcl/inc vcl/qa

2021-11-13 Thread Luboš Luňák (via logerrit)
 include/vcl/test/GraphicsRenderTests.hxx  |2 
 vcl/backendtest/GraphicsRenderTests.cxx   |   44 +++
 vcl/backendtest/VisualBackendTest.cxx |   16 +
 vcl/backendtest/outputdevice/common.cxx   |   73 ++
 vcl/backendtest/outputdevice/outputdevice.cxx |   67 ++-
 vcl/inc/test/outputdevice.hxx |4 +
 vcl/qa/cppunit/BackendTest.cxx|   27 +
 7 files changed, 207 insertions(+), 26 deletions(-)

New commits:
commit 9af1dc8a03958c32d4bd56804166293cc1031828
Author: Luboš Luňák 
AuthorDate: Fri Nov 12 21:06:48 2021 +0100
Commit: Luboš Luňák 
CommitDate: Sat Nov 13 10:19:57 2021 +0100

add more tests for OutputDev::DrawOutDev()

Test also copy to self and clipped copy.

Change-Id: I3f741e5035fe1f4fb224dc7fe4ba7aa5b4860dda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125122
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/vcl/test/GraphicsRenderTests.hxx 
b/include/vcl/test/GraphicsRenderTests.hxx
index f1adcc6bb721..86266eebe317 100644
--- a/include/vcl/test/GraphicsRenderTests.hxx
+++ b/include/vcl/test/GraphicsRenderTests.hxx
@@ -99,6 +99,8 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests
 void testClipPolyPolygon();
 void testClipB2DPolyPolygon();
 void testDrawOutDev();
+void testDrawOutDevScaledClipped();
+void testDrawOutDevSelf();
 void testDashedLine();
 void testLinearGradient();
 void testLinearGradientAngled();
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx 
b/vcl/backendtest/GraphicsRenderTests.cxx
index fa48087fa03e..794910b0f045 100644
--- a/vcl/backendtest/GraphicsRenderTests.cxx
+++ b/vcl/backendtest/GraphicsRenderTests.cxx
@@ -985,6 +985,48 @@ void GraphicsRenderTests::testDrawOutDev()
 }
 }
 
+void GraphicsRenderTests::testDrawOutDevScaledClipped()
+{
+vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
+Bitmap aBitmap = aOutDevTest.setupDrawOutDevScaledClipped();
+OUString aTestName = "testDrawOutDevScaledClipped";
+if (!SHOULD_ASSERT)
+{
+appendTestResult(aTestName, "SKIPPED");
+return;
+}
+vcl::test::TestResult eResult
+= 
vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDevScaledClipped(aBitmap);
+appendTestResult(aTestName, returnTestStatus(eResult),
+ (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
+if (m_aStoreResultantBitmap)
+{
+BitmapEx aBitmapEx(aBitmap);
+exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", 
aBitmapEx);
+}
+}
+
+void GraphicsRenderTests::testDrawOutDevSelf()
+{
+vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
+Bitmap aBitmap = aOutDevTest.setupDrawOutDevSelf();
+OUString aTestName = "testDrawOutDevSelf";
+if (!SHOULD_ASSERT)
+{
+appendTestResult(aTestName, "SKIPPED");
+return;
+}
+vcl::test::TestResult eResult
+= 
vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDevSelf(aBitmap);
+appendTestResult(aTestName, returnTestStatus(eResult),
+ (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
+if (m_aStoreResultantBitmap)
+{
+BitmapEx aBitmapEx(aBitmap);
+exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", 
aBitmapEx);
+}
+}
+
 void GraphicsRenderTests::testDashedLine()
 {
 vcl::test::OutputDeviceTestLine aOutDevTest;
@@ -2197,6 +2239,8 @@ void GraphicsRenderTests::runALLTests()
 testClipPolyPolygon();
 testClipB2DPolyPolygon();
 testDrawOutDev();
+testDrawOutDevScaledClipped();
+testDrawOutDevSelf();
 testDashedLine();
 testLinearGradient();
 testLinearGradientAngled();
diff --git a/vcl/backendtest/VisualBackendTest.cxx 
b/vcl/backendtest/VisualBackendTest.cxx
index 4ab745c73af0..4ba2cf63897b 100644
--- a/vcl/backendtest/VisualBackendTest.cxx
+++ b/vcl/backendtest/VisualBackendTest.cxx
@@ -764,7 +764,7 @@ public:
 }
 else if (mnTest % gnNumberOfTests == 10)
 {
-std::vector aRegions = setupRegions(2, 1, 
nWidth, nHeight);
+std::vector aRegions = setupRegions(2, 2, 
nWidth, nHeight);
 size_t index = 0;
 
 tools::Rectangle aRectangle = aRegions[index++];
@@ -775,6 +775,20 @@ public:
 drawBitmapScaledAndCentered(aRectangle, aBitmap, 
rRenderContext);
 }
 aRectangle = aRegions[index++];
+{
+vcl::test::OutputDeviceTestAnotherOutDev aOutDevTest;
+Bitmap aBitmap = aOutDevTest.setupDrawOutDevScaledClipped();
+
assertAndSetBackground(vcl::test::OutputDeviceTestAnotherOutDev::checkDrawOutDevScaledClipped(aBitmap),
 aRectangle, rRenderContext);
+drawBitmapScaledAndCentered(aRectangle, aBitmap, 
rRenderConte

[Libreoffice-commits] core.git: vcl/inc vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/utils.hxx  |3 +++
 vcl/skia/SkiaHelper.cxx |   35 +++
 vcl/skia/gdiimpl.cxx|   35 ++-
 3 files changed, 40 insertions(+), 33 deletions(-)

New commits:
commit 110fa313628c55fef1d35830358aea7e27c1e3ee
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 20:51:55 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 18:49:39 2021 +0100

get rid of Skia's 'rasterhack' for Invert()

It seems that manually writing a shader that does the same
as SkBlendMode::kDifference works fine even though the blend mode
crashes e.g. on Windows/AMD. So get rid of the memory<->GPU
conversions and use the shader as a workaround.

Change-Id: I971deeeb98f40e5ffa90f6a8dd7b0b21ec491c1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125101
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx
index 0bcc5989493e..ba479c58f234 100644
--- a/vcl/inc/skia/utils.hxx
+++ b/vcl/inc/skia/utils.hxx
@@ -71,6 +71,9 @@ VCL_DLLPUBLIC sk_sp 
makeCheckedImageSnapshot(sk_sp surface,
 
 inline Size imageSize(const sk_sp& image) { return 
Size(image->width(), image->height()); }
 
+// Do 'paint->setBlendMode(SkBlendMode::kDifference)' (workaround for buggy 
drivers).
+void setBlendModeDifference(SkPaint* paint);
+
 // Must be called in any VCL backend before any Skia functionality is used.
 // If not set, Skia will be disabled.
 VCL_DLLPUBLIC void
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 458f415befa4..ed04e5f20ec0 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -42,6 +42,7 @@ bool isVCLSkiaEnabled() { return false; }
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -645,11 +646,45 @@ tools::Long maxImageCacheSize()
 return officecfg::Office::Common::Cache::Skia::ImageCacheSize::get();
 }
 
+static sk_sp differenceBlender;
+
+void setBlendModeDifference(SkPaint* paint)
+{
+// This should normally do 
'paint->setBlendMode(SkBlendMode::kDifference);'.
+// But some drivers have a problem with this, namely currently AMD on 
Windows
+// (e.g. 'Vulkan API version: 1.2.170, driver version: 2.0.179, vendor: 
0x1002 (AMD),
+// device: 0x15dd, type: integrated, name: AMD Radeon(TM) Vega 8 Graphics')
+// simply crashes when kDifference is used.
+// Intel also had repaint problems with kDifference (tdf#130430), but it 
seems
+// those do not(?) exist anymore.
+// Interestingly, explicitly writing a shader that does exactly the same 
works fine,
+// so do that.
+if (!differenceBlender)
+{
+const char* diff = R"(
+vec4 main( vec4 src, vec4 dst )
+{
+return vec4(abs( src.r - dst.r ), abs( src.g - dst.g ), abs( 
src.b - dst.b ), dst.a );
+}
+)";
+auto effect = SkRuntimeEffect::MakeForBlender(SkString(diff));
+if (!effect.effect)
+{
+SAL_WARN("vcl.skia",
+ "SKRuntimeEffect::MakeForBlender failed: " << 
effect.errorText.c_str());
+abort();
+}
+differenceBlender = effect.effect->makeBlender(nullptr);
+}
+paint->setBlender(differenceBlender);
+}
+
 void cleanup()
 {
 sharedWindowContext.reset();
 imageCache.clear();
 imageCacheSize = 0;
+differenceBlender.reset();
 }
 
 static SkSurfaceProps commonSurfaceProps;
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 9e2da70323de..fd86928c24c9 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1412,16 +1412,6 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 preDraw();
 SAL_INFO("vcl.skia.trace", "invert(" << this << "): " << rPoly << ":" << 
int(eFlags));
 assert(!mXorMode);
-// Intel Vulkan drivers (up to current 0.401.3889) have a problem
-// with SkBlendMode::kDifference(?) and surfaces wider than 1024 pixels, 
resulting
-// in drawing errors. Work that around by fetching the relevant part of 
the surface
-// and drawing using CPU.
-bool rasterHack = (isGPU() && getVendor() == DriverBlocklist::VendorIntel 
&& !mXorMode);
-// BackendTest::testDrawInvertTrackFrameWithRectangle() also has a problem
-// with SkBlendMode::kDifference on AMD, leading to crashes or even
-// driver instability. Also work around by drawing using CPU.
-if (isGPU() && getVendor() == DriverBlocklist::VendorAMD && !mXorMode)
-rasterHack = true;
 SkPath aPath;
 aPath.incReserve(rPoly.count());
 addPolygonToPath(rPoly, aPath);
@@ -1429,6 +1419,7 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 addUpdateRegion(aPath.getBo

[Libreoffice-commits] core.git: vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   62 ---
 1 file changed, 30 insertions(+), 32 deletions(-)

New commits:
commit 754697f0dcd63e1f0ce2edd70ab8b42b1b4d4484
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 16:23:53 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 18:49:19 2021 +0100

revert part of 'loplugin:flatten' in Skia code

The automated code flattening may make sense in old spaghetti code,
but this is new code, and it's structured the way it makes sense.
Both those if's are logically just a part of a larger function
and bailing out sooner is at least conceptually wrong (and the moment
I add more code there, I'd need to revert anyway).

Change-Id: Iddbd22166159429636196eb1545b008ef576036b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125054
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 1fb1518386d0..9e2da70323de 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -455,23 +455,22 @@ void SkiaSalGraphicsImpl::postDraw()
 }
 SkiaZone::leave(); // matched in preDraw()
 // If there's a problem with the GPU context, abort.
-GrDirectContext* context = 
GrAsDirectContext(mSurface->getCanvas()->recordingContext());
-if (!context)
-return;
-
-// Running out of memory on the GPU technically could be possibly 
recoverable,
-// but we don't know the exact status of the surface (and what has or has 
not been drawn to it),
-// so in practice this is unrecoverable without possible data loss.
-if (context->oomed())
-{
-SAL_WARN("vcl.skia", "GPU context has run out of memory, aborting.");
-abort();
-}
-// Unrecoverable problem.
-if (context->abandoned())
+if (GrDirectContext* context = 
GrAsDirectContext(mSurface->getCanvas()->recordingContext()))
 {
-SAL_WARN("vcl.skia", "GPU context has been abandoned, aborting.");
-abort();
+// Running out of memory on the GPU technically could be possibly 
recoverable,
+// but we don't know the exact status of the surface (and what has or 
has not been drawn to it),
+// so in practice this is unrecoverable without possible data loss.
+if (context->oomed())
+{
+SAL_WARN("vcl.skia", "GPU context has run out of memory, 
aborting.");
+abort();
+}
+// Unrecoverable problem.
+if (context->abandoned())
+{
+SAL_WARN("vcl.skia", "GPU context has been abandoned, aborting.");
+abort();
+}
 }
 }
 
@@ -1061,22 +1060,21 @@ static void roundPolygonPoints(basegfx::B2DPolyPolygon& 
polyPolygon)
 
 void SkiaSalGraphicsImpl::checkPendingDrawing()
 {
-if (mLastPolyPolygonInfo.polygons.size() == 0)
-return;
-
-// Flush any pending polygon drawing.
-basegfx::B2DPolyPolygonVector polygons;
-std::swap(polygons, mLastPolyPolygonInfo.polygons);
-double transparency = mLastPolyPolygonInfo.transparency;
-mLastPolyPolygonInfo.bounds.reset();
-if (polygons.size() == 1)
-performDrawPolyPolygon(polygons.front(), transparency, true);
-else
-{
-for (basegfx::B2DPolyPolygon& p : polygons)
-roundPolygonPoints(p);
-
performDrawPolyPolygon(basegfx::utils::mergeToSinglePolyPolygon(polygons), 
transparency,
-   true);
+if (mLastPolyPolygonInfo.polygons.size() != 0)
+{ // Flush any pending polygon drawing.
+basegfx::B2DPolyPolygonVector polygons;
+std::swap(polygons, mLastPolyPolygonInfo.polygons);
+double transparency = mLastPolyPolygonInfo.transparency;
+mLastPolyPolygonInfo.bounds.reset();
+if (polygons.size() == 1)
+performDrawPolyPolygon(polygons.front(), transparency, true);
+else
+{
+for (basegfx::B2DPolyPolygon& p : polygons)
+roundPolygonPoints(p);
+
performDrawPolyPolygon(basegfx::utils::mergeToSinglePolyPolygon(polygons), 
transparency,
+   true);
+}
 }
 }
 


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-12 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/LinkTarget.mk |5 -
 solenv/gbuild/PrecompiledHeaders.mk |   20 +---
 solenv/gbuild/TargetLocations.mk|1 +
 3 files changed, 18 insertions(+), 8 deletions(-)

New commits:
commit 5e7421b3895aa69ea874fc2ccf0f615b1163fbda
Author: Luboš Luňák 
AuthorDate: Fri Nov 12 11:34:41 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 13:21:19 2021 +0100

rebuild a PCH when the flags it was built with change

We already store the flags in a .flags file for another use, so just
handle the file as another make rule before the PCH rule and
if the file changes then the PCH rule will depend on something
that has changed.

Change-Id: Ic43068273a40c0337b77221660f370780a21340c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125094
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index fe40fcbaf4ac..71be0790b59b 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -1853,6 +1853,7 @@ define gb_LinkTarget__set_precompiled_header_impl
 $(call gb_LinkTarget_get_clean_target,$(1)) : $(call 
gb_PrecompiledHeader_get_clean_target,$(3))
 $(call gb_PrecompiledHeader_get_target,$(3),$(4)) : $(call 
gb_CxxObject_get_source,$(SRCDIR),$(2))
 $(call gb_PrecompiledHeader_get_target,$(3),$(4)) : $(patsubst 
%.cxx,%.hxx,$(call gb_CxxObject_get_source,$(SRCDIR),$(2)))
+$(call gb_PrecompiledHeader_get_target,$(3),$(4)) : $(call 
gb_PrecompiledHeader_get_flags_file,$(3),$(4))
 
 $(call gb_PrecompiledHeader_get_target,$(3),$(4)) : $(call 
gb_LinkTarget_get_headers_target,$(1))
 
@@ -1912,7 +1913,9 @@ $(call gb_LinkTarget_get_pch_timestamp,$(4)) : $(call 
gb_LinkTarget_get_pch_reus
 # Depending directly on the PCH could cause that PCH to be built with this 
linktarget's flags.
 $(call gb_LinkTarget_get_pch_reuse_timestamp,$(4)) : $(call 
gb_PrecompiledHeader_get_for_reuse_target,$(3),$(4))
$(call gb_PrecompiledHeader_check_flags,$(4),$(2),\
-   $(call 
gb_PrecompiledHeader_get_target,$(3),$(4)),$$(PCH_CXXFLAGS) $$(PCH_DEFS) 
$$(gb_LinkTarget_EXCEPTIONFLAGS))
+   $(call gb_PrecompiledHeader_get_target,$(3),$(4)),\
+   $(call gb_PrecompiledHeader_get_flags_file,$(3),$(4)),\
+   $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS))
$$(call gb_PrecompiledHeader__copy_reuse_files,$(1),$(3),$(4))
mkdir -p $$(dir $$@) && touch $$@
 
diff --git a/solenv/gbuild/PrecompiledHeaders.mk 
b/solenv/gbuild/PrecompiledHeaders.mk
index 60c56950350f..28f2308c8e92 100644
--- a/solenv/gbuild/PrecompiledHeaders.mk
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -44,6 +44,13 @@ $(call gb_PrecompiledHeader_get_dep_target,$(1),$(3)) :
mkdir -p $$(dir $$@) && \
echo "$$(call gb_PrecompiledHeader_get_target,$(1),$(3)) : 
$$(gb_Helper_PHONY)" > $$@)
 
+# keep the flags the PCH was built with in a separate file, update the file if 
and only if the flags
+# change, and make the PCH depend on it => the PCH will be rebuilt on any 
flags change
+.PHONY: force
+$(call gb_PrecompiledHeader_get_flags_file,$(1),$(3)) : force
+   echo $$(sort $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)) | cmp -s - $$@ \
+   || echo $$(sort $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)) > $$@
+
 # despite this being only one .d file, need to run concat-deps on it to
 # re-write external headers from UnpackedTarball
 $(call gb_PrecompiledHeader_get_target,$(1),$(3)) :
@@ -52,7 +59,6 @@ $(call gb_PrecompiledHeader_get_target,$(1),$(3)) :
rm -f $$@
$$(call 
gb_PrecompiledHeader__command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(3),$(5))
$$(call 
gb_PrecompiledHeader__sum_command,$$@,$(1),$$<,$$(PCH_DEFS),$$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS),$$(INCLUDE),$(3))
-   echo $$(sort $$(PCH_DEFS) $$(PCH_CXXFLAGS) 
$$(gb_PrecompiledHeader_EXCEPTIONFLAGS)) > $$(call 
gb_PrecompiledHeader_get_target,$(1),$(3)).flags
 ifeq ($(gb_FULLDEPS),$(true))
$$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$$(call gb_var2file,$$(shell 
$$(gb_MKTEMP)),200,$$(call gb_PrecompiledHeader_get_dep_target_tmp,$(1),$(3))) 
&& \
@@ -73,8 +79,8 @@ $(call gb_PrecompiledHeader_get_clean_target,$(1)) :
$$(call gb_PrecompiledHeader_get_target,$(1),$(3)).obj \
$$(call gb_PrecompiledHeader_get_target,$(1),$(3)).pdb \
$$(call gb_PrecompiledHeader_get_target,$(1),$(3)).sum \
-   $$(call 
gb_PrecompiledHeader_get_target,$(1),$(3)).flags \
-   $$(call 
gb_PrecompiledHeader_get_target,$(1),$(3)).reuse \
+   $$(call gb_PrecompiledHeader_get_fla

[Libreoffice-commits] core.git: toolkit/source

2021-11-12 Thread Luboš Luňák (via logerrit)
 toolkit/source/awt/vclxtoolkit.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 7a65f43709b2945cca935158c72c28dc77ba65b2
Author: Luboš Luňák 
AuthorDate: Fri Nov 12 13:14:23 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 13:18:36 2021 +0100

adapt to Sequence::operator[] non-const removal

5054202e71605cb4f10c798be76679 passed Gerrit before the changes
and I submitted it only later after the changes.

Change-Id: I251f50f417964f23e5e91aae6696df609fee9e14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125098
Tested-by: Luboš Luňák 
Reviewed-by: Luboš Luňák 

diff --git a/toolkit/source/awt/vclxtoolkit.cxx 
b/toolkit/source/awt/vclxtoolkit.cxx
index 5991df78fddb..6c21a5b474f1 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -2550,12 +2550,13 @@ SAL_CALL VCLXToolkit::finishTrackingFontMappingUse()
 SolarMutexGuard aSolarGuard;
 OutputDevice::FontMappingUseData data = 
OutputDevice::FinishTrackingFontMappingUse();
 css::uno::Sequence ret( data.size());
+css::awt::XFontMappingUseItem* retData = ret.getArray();
 for( size_t i = 0; i < data.size(); ++i )
 {
-ret[ i ].originalFont = data[ i ].mOriginalFont;
-ret[ i ].usedFonts = comphelper::arrayToSequence
+retData[ i ].originalFont = data[ i ].mOriginalFont;
+retData[ i ].usedFonts = comphelper::arrayToSequence
 (data[ i ].mUsedFonts.data(), data[ i ].mUsedFonts.size());
-ret[ i ].count = data[ i ].mCount;
+retData[ i ].count = data[ i ].mCount;
 }
 return ret;
 }


[Libreoffice-commits] core.git: desktop/source include/sfx2 sfx2/source sw/inc sw/source test/source

2021-11-12 Thread Luboš Luňák (via logerrit)
 desktop/source/lib/init.cxx   |5 +++--
 include/sfx2/viewsh.hxx   |5 +++--
 sfx2/source/view/viewsh.cxx   |2 +-
 sw/inc/view.hxx   |2 +-
 sw/inc/viscrs.hxx |4 ++--
 sw/source/core/crsr/viscrs.cxx|6 --
 sw/source/uibase/inc/wrtsh.hxx|2 +-
 sw/source/uibase/uiview/view.cxx  |4 ++--
 sw/source/uibase/wrtsh/wrtsh4.cxx |6 +++---
 test/source/lokcallback.cxx   |   10 ++
 10 files changed, 26 insertions(+), 20 deletions(-)

New commits:
commit 309bffba603ae65e76148dff3add1a541a2b5d81
Author: Luboš Luňák 
AuthorDate: Fri Nov 12 10:56:54 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 13:02:08 2021 +0100

make it explicit whether to ignore the result of getLOKPayload()

Returning an empty string to signify 'ignore' was a poor design,
as some messages types actually may have valid empty messages.

Change-Id: Ia82d3d97d150bc5ef412a1bd4b1091d9b2d84385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124979
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6a1e0871fceb..2191a87f5b87 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2191,8 +2191,9 @@ void CallbackFlushHandler::enqueueUpdatedTypes()
 
 void CallbackFlushHandler::enqueueUpdatedType( int type, const SfxViewShell* 
viewShell, int viewId )
 {
-OString payload = viewShell->getLOKPayload( type, viewId );
-if(payload.isEmpty())
+bool ignore = false;
+OString payload = viewShell->getLOKPayload( type, viewId,  );
+if(ignore)
 return; // No actual payload to send.
 CallbackData callbackData(payload.getStr(), viewId);
 m_queue1.emplace_back(type);
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index e35c6848c9e1..fc06eb9ddbe8 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -346,8 +346,9 @@ public:
 virtual void libreOfficeKitViewUpdatedCallback(int nType) const override;
 virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int 
nViewId, int nSourceViewId) const override;
 // Returns current payload for nType, after 
libreOfficeKitViewUpdatedCallback() or
-// libreOfficeKitViewUpdatedCallbackPerViewId() were called.
-virtual OString getLOKPayload(int nType, int nViewId) const;
+// libreOfficeKitViewUpdatedCallbackPerViewId() were called. If no payload 
should
+// be generated, the ignore flag should be set.
+virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 
 /// Set if we are doing tiled searching.
 void setTiledSearching(bool bTiledSearching);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e49899bc36eb..75826a28d128 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1544,7 +1544,7 @@ void SfxViewShell::flushPendingLOKInvalidateTiles()
 // SfxViewShell itself does not delay any tile invalidations.
 }
 
-OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/) const
+OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/, bool* 
/*ignore*/) const
 {
 // SfxViewShell itself currently doesn't handle any updated-payload types.
 SAL_WARN("sfx.view", "SfxViewShell::getLOKPayload unhandled type " << 
lokCallbackTypeToString(nType));
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index edcf028d9f5d..d074f0d552a7 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -693,7 +693,7 @@ public:
 
 virtual tools::Rectangle getLOKVisibleArea() const override;
 virtual void flushPendingLOKInvalidateTiles() override;
-virtual OString getLOKPayload(int nType, int nViewId) const override;
+virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const 
override;
 };
 
 inline tools::Long SwView::GetXScroll() const
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 3c355e01800c..6755b548e8a0 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -60,7 +60,7 @@ public:
 void SetPosAndShow(SfxViewShell const * pViewShell);
 const vcl::Cursor& GetTextCursor() const;
 
-OString getLOKPayload(int nType, int nViewId) const;
+OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 };
 
 // From here classes/methods for selections.
@@ -114,7 +114,7 @@ public:
 static void Get1PixelInLogic( const SwViewShell& rSh,
 tools::Long* pX = nullptr, tools::Long* pY 
= nullptr );
 
-OString getLOKPayload(int nType, int nViewId) const;
+OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 };
 
 class SW_DLLPUBLIC SwShellCursor : public virtual SwCursor, public 
SwSelPaintRects
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index d28dab2c7d98..26e43813575d 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/sour

[Libreoffice-commits] core.git: include/vcl offapi/com offapi/UnoApi_offapi.mk toolkit/source vcl/source

2021-11-12 Thread Luboš Luňák (via logerrit)
 include/vcl/outdev.hxx   |   19 +++
 offapi/UnoApi_offapi.mk  |3 +
 offapi/com/sun/star/awt/XFontMappingUse.idl  |   56 +++
 offapi/com/sun/star/awt/XFontMappingUseItem.idl  |   55 ++
 offapi/com/sun/star/awt/XToolkit3.idl|   47 +++
 offapi/com/sun/star/awt/XToolkitExperimental.idl |4 -
 toolkit/source/awt/vclxtoolkit.cxx   |   28 +++
 vcl/source/outdev/text.cxx   |   55 ++
 8 files changed, 265 insertions(+), 2 deletions(-)

New commits:
commit 5054202e71605cb4f10c798be766798d99cb1b6a
Author: Luboš Luňák 
AuthorDate: Mon Oct 4 15:03:19 2021 +0200
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 12:12:13 2021 +0100

make it possible to find out what fonts are actually really used

A document specifies which font each text is supposed to use,
but we still need to map that to a real available font, which
includes also font fallback in case the font selected doesn't
cover all glyphs.

This commit adds API to track this font mapping, first
StartTrackingFontMappingUse() will make VCL record this
information, and then FinishTrackingFontMappingUse() will stop
and return all the information, as a listing saying that
a requested font got mapped to a list of fonts and the number
of times this took place. This can be useful to find out
what actually gets used for a specific document, or compare how
changing fonts available affects a specific document.

Change-Id: I6426ecef354166bef337b1dc9b9007fda148d5c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123051
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index e9b8d3540cd1..8c0746215a50 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1253,6 +1253,25 @@ public:
 LogicalFontInstance* pLogicalFont, int 
nFallbackLevel,
 vcl::text::ImplLayoutArgs& rLayoutArgs, 
const SalLayoutGlyphs* ) const;
 
+/*
+ These functions allow collecting information on how fonts are mapped when 
used, such as what
+ replacements are used when a requrested font is missing or which fonts 
are used as fallbacks
+ when a font doesn't provide all necessary glyphs.
+ After StartTrackingFontMappingUse() is called, VCL starts collecting font 
usage for all
+ text layout calls, FinishTrackingFontMappingUse() will stop collecting 
and providing
+ the collected information.
+ Each item is a mapping from a requested font to a list of actually used 
fonts and the number
+ of times this mapping was done.
+*/
+struct FontMappingUseItem
+{
+OUString mOriginalFont;
+std::vector mUsedFonts;
+int mCount;
+};
+typedef std::vector FontMappingUseData;
+static void StartTrackingFontMappingUse();
+static FontMappingUseData FinishTrackingFontMappingUse();
 
 // Enabling/disabling RTL only makes sense for OutputDevices that use a 
mirroring SalGraphicsLayout
 virtual voidEnableRTL( bool bEnable = true);
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 26b56bedd8e5..6f1dc604a8e3 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1828,6 +1828,8 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
XFocusListener \
XFont \
XFont2 \
+   XFontMappingUse \
+   XFontMappingUseItem \
XGraphics \
XGraphics2 \
XImageButton \
@@ -1890,6 +1892,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
XToggleButton \
XToolkit \
XToolkit2 \
+   XToolkit3 \
XToolkitExperimental \
XToolkitRobot \
XTopWindow \
diff --git a/offapi/com/sun/star/awt/XFontMappingUse.idl 
b/offapi/com/sun/star/awt/XFontMappingUse.idl
new file mode 100644
index ..8140d6a78a4a
--- /dev/null
+++ b/offapi/com/sun/star/awt/XFontMappingUse.idl
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/sfx2 sfx2/source sw/inc sw/source test/source

2021-11-12 Thread Luboš Luňák (via logerrit)
 desktop/source/lib/init.cxx   |5 +++--
 include/sfx2/viewsh.hxx   |5 +++--
 sfx2/source/view/viewsh.cxx   |2 +-
 sw/inc/view.hxx   |2 +-
 sw/inc/viscrs.hxx |4 ++--
 sw/source/core/crsr/viscrs.cxx|6 --
 sw/source/uibase/inc/wrtsh.hxx|2 +-
 sw/source/uibase/uiview/view.cxx  |4 ++--
 sw/source/uibase/wrtsh/wrtsh4.cxx |6 +++---
 test/source/lokcallback.cxx   |   10 ++
 10 files changed, 26 insertions(+), 20 deletions(-)

New commits:
commit c33f23598f9bc5ed80c95b18e373c91b68b2511e
Author: Luboš Luňák 
AuthorDate: Fri Nov 12 10:56:54 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 12:10:00 2021 +0100

make it explicit whether to ignore the result of getLOKPayload()

Returning an empty string to signify 'ignore' was a poor design,
as some messages types actually may have valid empty messages.

Change-Id: Ia82d3d97d150bc5ef412a1bd4b1091d9b2d84385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125089
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d3353e441474..e71e62929903 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2197,8 +2197,9 @@ void CallbackFlushHandler::enqueueUpdatedTypes()
 
 void CallbackFlushHandler::enqueueUpdatedType( int type, SfxViewShell* 
viewShell, int viewId )
 {
-OString payload = viewShell->getLOKPayload( type, viewId );
-if(payload.isEmpty())
+bool ignore = false;
+OString payload = viewShell->getLOKPayload( type, viewId,  );
+if(ignore)
 return; // No actual payload to send.
 CallbackData callbackData(payload.getStr(), viewId);
 m_queue1.emplace_back(type);
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index f0d71bc542e6..26a2324c7ca0 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -345,8 +345,9 @@ public:
 virtual void libreOfficeKitViewUpdatedCallback(int nType) const override;
 virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int 
nViewId, int nSourceViewId) const override;
 // Returns current payload for nType, after 
libreOfficeKitViewUpdatedCallback() or
-// libreOfficeKitViewUpdatedCallbackPerViewId() were called.
-virtual OString getLOKPayload(int nType, int nViewId) const;
+// libreOfficeKitViewUpdatedCallbackPerViewId() were called. If no payload 
should
+// be generated, the ignore flag should be set.
+virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 
 /// Set if we are doing tiled searching.
 void setTiledSearching(bool bTiledSearching);
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 325c9ffa71cc..d1c0e48ba18e 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1552,7 +1552,7 @@ void SfxViewShell::flushPendingLOKInvalidateTiles()
 // SfxViewShell itself does not delay any tile invalidations.
 }
 
-OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/) const
+OString SfxViewShell::getLOKPayload(int nType, int /*nViewId*/, bool* 
/*ignore*/) const
 {
 // SfxViewShell itself currently doesn't handle any updated-payload types.
 SAL_WARN("sfx.view", "SfxViewShell::getLOKPayload unhandled type " << 
lokCallbackTypeToString(nType));
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index b793614f58f7..0f062d3bedf3 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -680,7 +680,7 @@ public:
 
 virtual tools::Rectangle getLOKVisibleArea() const override;
 virtual void flushPendingLOKInvalidateTiles() override;
-virtual OString getLOKPayload(int nType, int nViewId) const override;
+virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const 
override;
 };
 
 inline tools::Long SwView::GetXScroll() const
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index b2ceb9c67c79..dc7e020ad103 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -61,7 +61,7 @@ public:
 void SetPosAndShow(SfxViewShell const * pViewShell);
 const vcl::Cursor& GetTextCursor() const;
 
-OString getLOKPayload(int nType, int nViewId) const;
+OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 };
 
 // From here classes/methods for selections.
@@ -115,7 +115,7 @@ public:
 static void Get1PixelInLogic( const SwViewShell& rSh,
 tools::Long* pX = nullptr, tools::Long* pY 
= nullptr );
 
-OString getLOKPayload(int nType, int nViewId) const;
+OString getLOKPayload(int nType, int nViewId, bool* ignore) const;
 };
 
 class SW_DLLPUBLIC SwShellCursor : public virtual SwCursor, public 
SwSelPaintRects
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 7d9564295fab..f81f9750b312 100644
--- a/sw/source/core/crsr/viscrs.

[Libreoffice-commits] core.git: vcl/inc vcl/qa vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/salbmp.hxx  |1 
 vcl/qa/cppunit/skia/skia.cxx |   57 +++
 vcl/skia/salbmp.cxx  |2 -
 3 files changed, 59 insertions(+), 1 deletion(-)

New commits:
commit 897130541646a37e358463cb76aa505b66a1d7ac
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 16:12:35 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 11:09:11 2021 +0100

fix assertion with scaled alpha image in SkiaSalBitmap

The size of the alpha image does not really depend in mPixelsSize,
it's created on demand and it's just necessary to check if it
has the right size.

Change-Id: Ic16c7c2b202be31c22b21b0c5ee720bda955bbbd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125059
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index 91b11ab6255b..455414fdd7fa 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -96,6 +96,7 @@ public:
 bool unittestHasImage() const { return mImage.get(); }
 bool unittestHasAlphaImage() const { return mAlphaImage.get(); }
 bool unittestHasEraseColor() const { return mEraseColorSet; }
+bool unittestHasPendingScale() const { return mSize != mPixelsSize; }
 const sal_uInt8* unittestGetBuffer() const { return mBuffer.get(); }
 const SkImage* unittestGetImage() const { return mImage.get(); }
 const SkImage* unittestGetAlphaImage() const { return mAlphaImage.get(); }
diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx
index 4ff70306b3fe..128829aecc18 100644
--- a/vcl/qa/cppunit/skia/skia.cxx
+++ b/vcl/qa/cppunit/skia/skia.cxx
@@ -42,6 +42,7 @@ public:
 void testBitmapCopyOnWrite();
 void testMatrixQuality();
 void testDelayedScale();
+void testDelayedScaleAlphaImage();
 void testTdf137329();
 void testTdf140848();
 void testTdf132367();
@@ -54,6 +55,7 @@ public:
 CPPUNIT_TEST(testBitmapCopyOnWrite);
 CPPUNIT_TEST(testMatrixQuality);
 CPPUNIT_TEST(testDelayedScale);
+CPPUNIT_TEST(testDelayedScaleAlphaImage);
 CPPUNIT_TEST(testTdf137329);
 CPPUNIT_TEST(testTdf140848);
 CPPUNIT_TEST(testTdf132367);
@@ -372,6 +374,61 @@ void SkiaTest::testDelayedScale()
 skiaBitmap2.ReleaseBuffer(buffer2, BitmapAccessMode::Read);
 }
 
+void SkiaTest::testDelayedScaleAlphaImage()
+{
+if (!SkiaHelper::isVCLSkiaEnabled())
+return;
+auto bitmapTmp = std::make_unique();
+CPPUNIT_ASSERT(bitmapTmp->Create(Size(10, 10), vcl::PixelFormat::N24_BPP, 
BitmapPalette()));
+bitmapTmp->Erase(COL_RED);
+// Create a bitmap that has only an image, not a pixel buffer.
+SkiaSalBitmap bitmap(bitmapTmp->GetSkImage());
+bitmapTmp.release();
+CPPUNIT_ASSERT(!bitmap.unittestHasBuffer());
+CPPUNIT_ASSERT(bitmap.unittestHasImage());
+CPPUNIT_ASSERT(!bitmap.unittestHasAlphaImage());
+// Set up pending scale.
+CPPUNIT_ASSERT(bitmap.Scale(2.0, 2.0, BmpScaleFlag::Fast));
+CPPUNIT_ASSERT(bitmap.unittestHasPendingScale());
+CPPUNIT_ASSERT(bitmap.InterpretAs8Bit());
+// Ask for SkImage and make sure it's scaled up.
+sk_sp image = bitmap.GetSkImage();
+CPPUNIT_ASSERT_EQUAL(20, image->width());
+// Ask again, this time it should be cached.
+sk_sp image2 = bitmap.GetSkImage();
+CPPUNIT_ASSERT_EQUAL(image.get(), image2.get());
+// Add another scale.
+CPPUNIT_ASSERT(bitmap.Scale(3.0, 3.0, BmpScaleFlag::Fast));
+// Ask for alpha SkImage and make sure it's scaled up.
+sk_sp alphaImage = bitmap.GetAlphaSkImage();
+CPPUNIT_ASSERT_EQUAL(60, alphaImage->width());
+// Ask again, this time it should be cached.
+sk_sp alphaImage2 = bitmap.GetAlphaSkImage();
+CPPUNIT_ASSERT_EQUAL(alphaImage.get(), alphaImage2.get());
+// Ask again for non-alpha image, it should be scaled again.
+sk_sp image3 = bitmap.GetSkImage();
+CPPUNIT_ASSERT_EQUAL(60, image3->width());
+CPPUNIT_ASSERT(image3.get() != image2.get());
+CPPUNIT_ASSERT(image3.get() != image.get());
+// Create pixel buffer from the image (it should convert from alpha image 
because the bitmap is 8bpp
+// and the alpha image size matches).
+SkiaSalBitmap bitmapCopy;
+bitmapCopy.Create(bitmap);
+CPPUNIT_ASSERT(!bitmap.unittestHasBuffer());
+BitmapBuffer* buffer1 = bitmap.AcquireBuffer(BitmapAccessMode::Read);
+CPPUNIT_ASSERT(bitmap.unittestHasBuffer());
+bitmap.ReleaseBuffer(buffer1, BitmapAccessMode::Read);
+CPPUNIT_ASSERT_EQUAL(Size(60, 60), bitmap.GetSize());
+// Scale the copy before the buffer was created (this time it should 
convert from non-alpha image
+// because of the different size).
+CPPUNIT_ASSERT(!bitmapCopy.unittestHasBuffer());
+CPPUNIT_ASSERT(bitmapCopy.Scale(4.0, 4.0, BmpScaleFlag::Fast));
+BitmapBuffer* buffer2 = bitmapCopy.AcquireBuffer(BitmapAccessMode::Read);
+CPPUNIT_ASSERT(bitmapCopy

[Libreoffice-commits] core.git: vcl/inc

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/salbmp.hxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a8ea76779f8c0ab52f0200249a4a5cc279b914b3
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 15:21:29 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 11:08:55 2021 +0100

log also whether SkiaSalBitmap has a pixel buffer

Change-Id: Ib78c661ec82456386d79680f106b6d14b66f450f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125058
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index bb8ae16f1c2e..91b11ab6255b 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -147,6 +147,7 @@ private:
 // I/i - has SkImage (on GPU/CPU),
 // A/a - has alpha SkImage (on GPU/CPU)
 // E - has erase color
+// B - has pixel buffer
 stream << static_cast(bitmap) << " " << bitmap->GetSize() 
<< "x"
<< bitmap->GetBitCount();
 if (bitmap->GetBitCount() <= 8 && 
!bitmap->Palette().IsGreyPalette8Bit())
@@ -158,6 +159,8 @@ private:
 stream << (bitmap->mAlphaImage->isTextureBacked() ? "A" : "a");
 if (bitmap->mEraseColorSet)
 stream << "E" << bitmap->mEraseColor;
+if (bitmap->mBuffer)
+stream << "B";
 return stream;
 }
 


[Libreoffice-commits] core.git: vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1008f2a06e43c19b7d8b95427198bd691eed5992
Author: Luboš Luňák 
AuthorDate: Wed Nov 10 16:29:36 2021 +0100
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 11:08:40 2021 +0100

clean up SkCanvas before using the bitmap it's painted to

I think this is not strictly needed with raster bitmaps, but still,
this is the proper way.

Change-Id: If6ccf82cf633afefa5c043096ec01b5f3891dc0b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125057
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 642752a3bbdd..cc5e309a4d40 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -680,10 +680,12 @@ void SkiaSalGraphicsImpl::applyXor()
 abort();
 SkPaint paint;
 paint.setBlendMode(SkBlendMode::kSrc); // copy as is
-SkCanvas canvas(surfaceBitmap);
 SkRect area = SkRect::Make(mXorRegion.getBounds());
-canvas.drawImageRect(makeCheckedImageSnapshot(mSurface), area, area, 
SkSamplingOptions(),
- , SkCanvas::kFast_SrcRectConstraint);
+{
+SkCanvas canvas(surfaceBitmap);
+canvas.drawImageRect(makeCheckedImageSnapshot(mSurface), area, area, 
SkSamplingOptions(),
+ , SkCanvas::kFast_SrcRectConstraint);
+}
 // xor to surfaceBitmap
 assert(surfaceBitmap.info().alphaType() == kUnpremul_SkAlphaType);
 assert(mXorBitmap.info().alphaType() == kUnpremul_SkAlphaType);


[Libreoffice-commits] core.git: vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   93 ++-
 1 file changed, 27 insertions(+), 66 deletions(-)

New commits:
commit b11a510541f3758e1769f75b34cf27e70b846923
Author: Luboš Luňák 
AuthorDate: Mon Sep 13 14:08:33 2021 +0200
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 11:08:22 2021 +0100

drop usage of SkSurface::draw()

It causes so many problems that it almost doesn't get used in practice
anyway.

Change-Id: Ie11042749d0cca998af45be1daee6f14bf9531f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125056
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 434209ae1dcf..642752a3bbdd 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1213,37 +1213,6 @@ bool 
SkiaSalGraphicsImpl::drawPolyPolygonBezier(sal_uInt32, const sal_uInt32*, c
 return false;
 }
 
-static void copyArea(SkCanvas* canvas, sk_sp surface, tools::Long 
nDestX,
- tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY,
- tools::Long nSrcWidth, tools::Long nSrcHeight, bool 
srcIsRaster,
- bool destIsRaster)
-{
-// Using SkSurface::draw() should be more efficient than 
SkSurface::makeImageSnapshot(),
-// because it may detect copying to itself and avoid some needless copies.
-// But it has problems with drawing to itself
-// (https://groups.google.com/forum/#!topic/skia-discuss/6yiuw24jv0I) and 
also
-// raster surfaces do not avoid a copy of the source
-// (https://groups.google.com/forum/#!topic/skia-discuss/S3FMpCi82k0).
-// Finally, there's not much point if one of them is raster and the other 
is not (chrome/m86 even crashes).
-if (canvas == surface->getCanvas() || srcIsRaster || (srcIsRaster != 
destIsRaster))
-{
-SkPaint paint;
-paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
-canvas->drawImageRect(makeCheckedImageSnapshot(surface),
-  SkRect::MakeXYWH(nSrcX, nSrcY, nSrcWidth, 
nSrcHeight),
-  SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, 
nSrcHeight),
-  SkSamplingOptions(), , 
SkCanvas::kFast_SrcRectConstraint);
-return;
-}
-// SkCanvas::draw() cannot do a subrectangle, so clip.
-canvas->save();
-canvas->clipRect(SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, nSrcHeight));
-SkPaint paint;
-paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
-surface->draw(canvas, nDestX - nSrcX, nDestY - nSrcY, );
-canvas->restore();
-}
-
 void SkiaSalGraphicsImpl::copyArea(tools::Long nDestX, tools::Long nDestY, 
tools::Long nSrcX,
tools::Long nSrcY, tools::Long nSrcWidth, 
tools::Long nSrcHeight,
bool /*bWindowInvalidate*/)
@@ -1256,8 +1225,13 @@ void SkiaSalGraphicsImpl::copyArea(tools::Long nDestX, 
tools::Long nDestY, tools
<< SkIRect::MakeXYWH(nDestX, nDestY, 
nSrcWidth, nSrcHeight));
 assert(!mXorMode);
 addUpdateRegion(SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, nSrcHeight));
-::copyArea(getDrawCanvas(), mSurface, nDestX, nDestY, nSrcX, nSrcY, 
nSrcWidth, nSrcHeight,
-   !isGPU(), !isGPU());
+// Using SkSurface::draw() should be more efficient, but it's too buggy.
+SkPaint paint;
+paint.setBlendMode(SkBlendMode::kSrc); // copy as is, including alpha
+getDrawCanvas()->drawImageRect(makeCheckedImageSnapshot(mSurface),
+   SkRect::MakeXYWH(nSrcX, nSrcY, nSrcWidth, 
nSrcHeight),
+   SkRect::MakeXYWH(nDestX, nDestY, nSrcWidth, 
nSrcHeight),
+   SkSamplingOptions(), , 
SkCanvas::kFast_SrcRectConstraint);
 postDraw();
 }
 
@@ -1280,39 +1254,26 @@ void SkiaSalGraphicsImpl::copyBits(const SalTwoRect& 
rPosAry, SalGraphics* pSrcG
 assert(!mXorMode);
 addUpdateRegion(SkRect::MakeXYWH(rPosAry.mnDestX, rPosAry.mnDestY, 
rPosAry.mnDestWidth,
  rPosAry.mnDestHeight));
-if (rPosAry.mnSrcWidth == rPosAry.mnDestWidth && rPosAry.mnSrcHeight == 
rPosAry.mnDestHeight)
-{
-auto srcDebug = [&]() -> std::string {
-if (src == this)
-return "(self)";
-else
-{
-std::ostringstream stream;
-stream << "(" << src << ")";
-return stream.str();
-}
-};
-SAL_INFO("vcl.skia.trace",
- "copybits(" << this << "): " << srcDebug() << " copy area: " 
<< rPosAry);
-::copyArea(getDrawCanvas(), src->mSurface, rPosAry.mnDestX, 
rPosAry.

[Libreoffice-commits] core.git: vcl/skia

2021-11-12 Thread Luboš Luňák (via logerrit)
 vcl/skia/gdiimpl.cxx |   70 +--
 1 file changed, 24 insertions(+), 46 deletions(-)

New commits:
commit 0bd7dcf09d1801b03367ecbfd388c5940081d483
Author: Luboš Luňák 
AuthorDate: Fri Sep 10 16:06:03 2021 +0200
Commit: Luboš Luňák 
CommitDate: Fri Nov 12 09:12:47 2021 +0100

reduce copy

Change-Id: Ie37f96755f348316bb8d5129df925134943e7ace
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125055
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 73f6cc3dd479..434209ae1dcf 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1466,46 +1466,24 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 addPolygonToPath(rPoly, aPath);
 aPath.setFillType(SkPathFillType::kEvenOdd);
 addUpdateRegion(aPath.getBounds());
+SkAutoCanvasRestore autoRestore(getDrawCanvas(), true);
+SkPaint aPaint;
 // TrackFrame just inverts a dashed path around the polygon
 if (eFlags == SalInvert::TrackFrame)
 {
 // TrackFrame is not supposed to paint outside of the polygon (usually 
rectangle),
 // but wider stroke width usually results in that, so ensure the 
requirement
 // by clipping.
-SkAutoCanvasRestore autoRestore(getDrawCanvas(), true);
 getDrawCanvas()->clipRect(aPath.getBounds(), SkClipOp::kIntersect, 
false);
-SkPaint aPaint;
 aPaint.setStrokeWidth(2);
-float intervals[] = { 4.0f, 4.0f };
+constexpr float intervals[] = { 4.0f, 4.0f };
 aPaint.setStyle(SkPaint::kStroke_Style);
 aPaint.setPathEffect(SkDashPathEffect::Make(intervals, 
SK_ARRAY_COUNT(intervals), 0));
 aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
 aPaint.setBlendMode(SkBlendMode::kDifference);
-if (!rasterHack)
-getDrawCanvas()->drawPath(aPath, aPaint);
-else
-{
-SkRect area;
-aPath.getBounds().roundOut();
-SkRect size = SkRect::MakeWH(area.width(), area.height());
-sk_sp surface
-= SkSurface::MakeRasterN32Premul(area.width(), area.height(), 
surfaceProps());
-SkPaint copy;
-copy.setBlendMode(SkBlendMode::kSrc);
-flushDrawing();
-
surface->getCanvas()->drawImageRect(makeCheckedImageSnapshot(mSurface), area, 
size,
-SkSamplingOptions(), ,
-
SkCanvas::kFast_SrcRectConstraint);
-aPath.offset(-area.x(), -area.y());
-surface->getCanvas()->drawPath(aPath, aPaint);
-getDrawCanvas()->drawImageRect(makeCheckedImageSnapshot(surface), 
size, area,
-   SkSamplingOptions(), ,
-   SkCanvas::kFast_SrcRectConstraint);
-}
 }
 else
 {
-SkPaint aPaint;
 aPaint.setColor(SkColorSetARGB(255, 255, 255, 255));
 aPaint.setStyle(SkPaint::kFill_Style);
 aPaint.setBlendMode(SkBlendMode::kDifference);
@@ -1532,27 +1510,27 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
 aPaint.setShader(
 aBitmap.makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, 
SkSamplingOptions()));
 }
-if (!rasterHack)
-getDrawCanvas()->drawPath(aPath, aPaint);
-else
-{
-SkRect area;
-aPath.getBounds().roundOut();
-SkRect size = SkRect::MakeWH(area.width(), area.height());
-sk_sp surface
-= SkSurface::MakeRasterN32Premul(area.width(), area.height(), 
surfaceProps());
-SkPaint copy;
-copy.setBlendMode(SkBlendMode::kSrc);
-flushDrawing();
-
surface->getCanvas()->drawImageRect(makeCheckedImageSnapshot(mSurface), area, 
size,
-SkSamplingOptions(), ,
-
SkCanvas::kFast_SrcRectConstraint);
-aPath.offset(-area.x(), -area.y());
-surface->getCanvas()->drawPath(aPath, aPaint);
-getDrawCanvas()->drawImageRect(makeCheckedImageSnapshot(surface), 
size, area,
-   SkSamplingOptions(), ,
-   SkCanvas::kFast_SrcRectConstraint);
-}
+}
+if (!rasterHack)
+getDrawCanvas()->drawPath(aPath, aPaint);
+else
+{
+SkRect area;
+aPath.getBounds().roundOut();
+SkRect size = SkRect::MakeWH(area.width(), area.height());
+sk_sp surface
+= SkSurface::MakeRasterN32Premul(area.width(), area.height(), 
surfaceProps());
+SkPaint copy;
+copy.setBlendMode(SkBlendMode:

[Libreoffice-commits] core.git: sw/source

2021-11-11 Thread Luboš Luňák (via logerrit)
 sw/source/core/view/viewsh.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 9b96b748f324294cdf4b2d60bcea689757e08334
Author: Luboš Luňák 
AuthorDate: Thu Nov 4 17:17:00 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 11 14:54:16 2021 +0100

do not draw "desktop" (=surrounding background) in Writer in LOK mode

It's meant to stay transparent.

Change-Id: Ia6264c44f369e80092f78a6a6674857460cd7c04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124716
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 
(cherry picked from commit 7f88f47bb9995eaf4d9cc169788e9fe2006af1ad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124971
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 20b4d0ac13a6..0f8284c5d915 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1535,6 +1535,9 @@ void SwViewShell::PaintDesktop(const vcl::RenderContext& 
rRenderContext, const S
 if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
 return; //for the printer we don't do anything 
here.
 
+if(comphelper::LibreOfficeKit::isActive())
+return;
+
 //Catch exceptions, so that it doesn't look so surprising.
 //Can e.g. happen during Idle.
 //Unfortunately we must at any rate Paint the rectangles next to the pages,


[Libreoffice-commits] core.git: sc/source

2021-11-11 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/formulacell.cxx |   21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 871d5fe3ae531f8849908e50bf87c2848f0b9068
Author: Luboš Luňák 
AuthorDate: Thu Nov 11 08:47:08 2021 +0100
Commit: Luboš Luňák 
CommitDate: Thu Nov 11 13:07:52 2021 +0100

do not use grouped cell calculation for just a single cell

We do threaded calculations per row, so there's no point in setting
up all the thread stuff effectively just for a single thread (all
but one would be called to do nothing). No point in setting up
OpenCL in this case either.

Change-Id: I91ea5a7f219f8518a934ecbb04667fa7fba1cdff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125026
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index d678fad353c7..409b14767a82 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4652,15 +4652,6 @@ bool ScFormulaCell::InterpretFormulaGroup(SCROW 
nStartOffset, SCROW nEndOffset)
 }
 }
 
-// Guard against endless recursion of Interpret() calls, for this to work
-// ScFormulaCell::InterpretFormulaGroup() must never be called through
-// anything else than ScFormulaCell::Interpret(), same as
-// ScFormulaCell::InterpretTail()
-RecursionCounter aRecursionCounter( rRecursionHelper, this);
-
-bool bDependencyComputed = false;
-bool bDependencyCheckFailed = false;
-
 // Get rid of -1's in offsets (defaults) or any invalid offsets.
 SCROW nMaxOffset = mxGroup->mnLength - 1;
 nStartOffset = nStartOffset < 0 ? 0 : std::min(nStartOffset, nMaxOffset);
@@ -4672,6 +4663,18 @@ bool ScFormulaCell::InterpretFormulaGroup(SCROW 
nStartOffset, SCROW nEndOffset)
 nEndOffset = nMaxOffset;
 }
 
+if (nEndOffset == nStartOffset)
+return false; // Do not use threads for a single row.
+
+// Guard against endless recursion of Interpret() calls, for this to work
+// ScFormulaCell::InterpretFormulaGroup() must never be called through
+// anything else than ScFormulaCell::Interpret(), same as
+// ScFormulaCell::InterpretTail()
+RecursionCounter aRecursionCounter( rRecursionHelper, this);
+
+bool bDependencyComputed = false;
+bool bDependencyCheckFailed = false;
+
 // Preference order: First try OpenCL, then threading.
 // TODO: Do formula-group span computation for OCL too if 
nStartOffset/nEndOffset are non default.
 if( InterpretFormulaGroupOpenCL(aScope, bDependencyComputed, 
bDependencyCheckFailed))


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source

2021-11-11 Thread Luboš Luňák (via logerrit)
 sw/source/core/view/viewsh.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 7f88f47bb9995eaf4d9cc169788e9fe2006af1ad
Author: Luboš Luňák 
AuthorDate: Thu Nov 4 17:17:00 2021 +0100
Commit: Andras Timar 
CommitDate: Thu Nov 11 10:47:57 2021 +0100

do not draw "desktop" (=surrounding background) in Writer in LOK mode

It's meant to stay transparent.

Change-Id: Ia6264c44f369e80092f78a6a6674857460cd7c04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124716
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 42ae60123c71..19d0c5261c87 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1533,6 +1533,9 @@ void SwViewShell::PaintDesktop(vcl::RenderContext& 
rRenderContext, const SwRect
 if ( !GetWin() && !GetOut()->GetConnectMetaFile() )
 return; //for the printer we don't do anything 
here.
 
+if(comphelper::LibreOfficeKit::isActive())
+return;
+
 //Catch exceptions, so that it doesn't look so surprising.
 //Can e.g. happen during Idle.
 //Unfortunately we must at any rate Paint the rectangles next to the pages,


[Libreoffice-commits] core.git: sc/source

2021-11-08 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5e9c2677e8fcd19b289d947b94ceba52b138728b
Author: Luboš Luňák 
AuthorDate: Mon Nov 8 17:45:14 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 8 21:39:08 2021 +0100

improve performance of cell equality comparisons (tdf#139444)

When comparing cell and a string for (in)equality, that means
comparing the whole cell, even when not explicitly asked for.
Whole cell comparison is simpler and faster.

Change-Id: Ic7a79b20f710f2a5d84f62c714d67c088a22d449
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124881
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 9c7417278658..02c2619624b5 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2705,6 +2705,12 @@ public:
 // Simple string matching i.e. no regexp match.
 if (isTextMatchOp(rEntry))
 {
+bool matchWholeCell = bMatchWholeCell;
+// When comparing for (in)equality, we can simply compare the 
whole cell
+// even when not explicitly asked, and that code is faster 
(it's simpler,
+// no SharedString temporary, etc.).
+if( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL )
+matchWholeCell = true;
 if (rItem.meType != ScQueryEntry::ByString && 
rItem.maString.isEmpty())
 {
 // #i18374# When used from functions (match, countif, 
sumif, vlookup, hlookup, lookup),
@@ -2714,7 +2720,7 @@ public:
 if ( rEntry.eOp == SC_NOT_EQUAL )
 bOk = !bOk;
 }
-else if ( bMatchWholeCell )
+else if ( matchWholeCell )
 {
 if (pValueSource1)
 {
@@ -2752,7 +2758,7 @@ public:
 sal_Int32 nStrPos;
 
 if (!mbCaseSensitive)
-{ // Common case for vlookup etc.
+{
 const svl::SharedString rSource(pValueSource1? 
*pValueSource1 : mrStrPool.intern(*pValueSource2));
 
 const rtl_uString *pQuer = 
rItem.maString.getDataIgnoreCase();


[Libreoffice-commits] core.git: 2 commits - sc/inc sc/qa sc/source

2021-11-08 Thread Luboš Luňák (via logerrit)
/nameuno.cxx|6 
 sc/source/ui/unoobj/textuno.cxx|3 
 sc/source/ui/vba/vbaname.cxx   |2 
 sc/source/ui/view/cellsh.cxx   |5 
 sc/source/ui/view/cellsh1.cxx  |   18 -
 sc/source/ui/view/formatsh.cxx |   13 -
 sc/source/ui/view/gridwin5.cxx |3 
 sc/source/ui/view/output2.cxx  |   17 -
 sc/source/ui/view/spelleng.cxx |3 
 sc/source/ui/view/tabvwsh.cxx  |5 
 sc/source/ui/view/tabvwsha.cxx |6 
 sc/source/ui/view/viewfun2.cxx |   10 
 sc/source/ui/view/viewfun4.cxx |6 
 sc/source/ui/view/viewfunc.cxx |   19 -
 sc/source/ui/view/viewutil.cxx |3 
 91 files changed, 750 insertions(+), 964 deletions(-)

New commits:
commit ec0edb0969c23b25576f4d1b3b2ee5d3f21990ad
Author: Luboš Luňák 
AuthorDate: Mon Nov 8 17:29:41 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 8 20:34:23 2021 +0100

optimize VLOOKUP by returning SharedString if possible (tdf#139444)

Profiling shows that the slowness mostly comes from converting
the cell's SharedString to OUString and then the comparison
converts it back. To improve performance, return the SharedString
if possible and ignore the OUString.

Change-Id: Idb190bd0354cea3185e5ff9ebaf92cab63f23f70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124880
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/inc/cellform.hxx b/sc/inc/cellform.hxx
index 65d0fc232ee9..cd9b28f7692c 100644
--- a/sc/inc/cellform.hxx
+++ b/sc/inc/cellform.hxx
@@ -21,6 +21,7 @@
 
 #include "scdllapi.h"
 #include 
+#include 
 
 class SvNumberFormatter;
 class Color;
@@ -42,9 +43,17 @@ public:
 const Color** ppColor, SvNumberFormatter& rFormatter, bool bNullVals = 
true,
 bool bFormula  = false );
 
+// Note that if pShared is set and a value is returned that way, the 
returned OUString is empty.
 static OUString GetInputString(
 const ScRefCellValue& rCell, sal_uInt32 nFormat, SvNumberFormatter& 
rFormatter,
-const ScDocument& rDoc, bool bFiltering = false );
+const ScDocument& rDoc, const svl::SharedString** pShared = nullptr, 
bool bFiltering = false );
+
+static OUString GetInputString(
+const ScRefCellValue& rCell, sal_uInt32 nFormat, SvNumberFormatter& 
rFormatter,
+const ScDocument& rDoc, bool bFiltering)
+{
+return GetInputString( rCell, nFormat, rFormatter, rDoc, nullptr, 
bFiltering );
+}
 
 static OUString GetOutputString(
 ScDocument& rDoc, const ScAddress& rPos, const ScRefCellValue& rCell );
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index c25de8a028bc..91e5b5c3fc22 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -368,10 +368,12 @@ public:
const ScInterpreterContext* pContext = nullptr ) 
const
 { return GetString( GetCellValue( rBlockPos, nRow ), nRow, pContext ); 
}
 double* GetValueCell( SCROW nRow );
-OUStringGetInputString( SCROW nRow ) const
-{ return GetInputString( GetCellValue( nRow ), nRow ); }
-OUStringGetInputString( sc::ColumnBlockConstPosition& rBlockPos, SCROW 
nRow ) const
-{ return GetInputString( GetCellValue( rBlockPos, nRow ), nRow ); }
+// Note that if pShared is set and a value is returned that way, the 
returned OUString is empty.
+OUStringGetInputString( SCROW nRow, const svl::SharedString** pShared 
= nullptr ) const
+{ return GetInputString( GetCellValue( nRow ), nRow, pShared ); }
+OUStringGetInputString( sc::ColumnBlockConstPosition& rBlockPos, SCROW 
nRow,
+const svl::SharedString** pShared = nullptr ) const
+{ return GetInputString( GetCellValue( rBlockPos, nRow ), nRow, 
pShared ); }
 double  GetValue( SCROW nRow ) const;
 const EditTextObject* GetEditText( SCROW nRow ) const;
 void RemoveEditTextCharAttribs( SCROW nRow, const ScPatternAttr& rAttr );
@@ -747,7 +749,7 @@ private:
 SCROW FindNextVisibleRow(SCROW nRow, bool bForward) const;
 
 OUString GetString( const ScRefCellValue& cell, SCROW nRow, const 
ScInterpreterContext* pContext = nullptr ) const;
-OUString GetInputString( const ScRefCellValue& cell, SCROW nRow ) const;
+OUString GetInputString( const ScRefCellValue& cell, SCROW nRow, const 
svl::SharedString** pShared = nullptr ) const;
 
 /**
  * Called whenever the state of cell array gets modified i.e. new cell
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 7ff8fbcb4fbe..0ed322c541ab 100644
--- a/sc/inc/

[Libreoffice-commits] core.git: configure.ac

2021-11-08 Thread Luboš Luňák (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 033aea780cc8315979b6de2692f5f7aeb6a0e99b
Author: Luboš Luňák 
AuthorDate: Sun Nov 7 19:46:18 2021 +0100
Commit: Luboš Luňák 
CommitDate: Mon Nov 8 09:15:11 2021 +0100

actually check for -isystem

When I added this in 151abb8b2b9d3a9b98cec12e29484d1210 I made
a copy mistake that I corrected in a follow-up commit
by removing the incorrect option without introducing -isystem
into the check. Not that it matters in practice, apparently.

Change-Id: I64d9ce34dcbaf9acdd8c794aed9fd84bae776d4a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124828
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/configure.ac b/configure.ac
index 6144dab8ba48..3cfcb7540e7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3766,7 +3766,7 @@ ISYSTEM=
 if test "$GCC" = "yes"; then
 AC_MSG_CHECKING( for -isystem )
 save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -Werror"
+CFLAGS="$CFLAGS -isystem /usr/include -Werror"
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ 
ISYSTEM="-isystem " ],[])
 CFLAGS=$save_CFLAGS
 if test -n "$ISYSTEM"; then


[Libreoffice-commits] core.git: solenv/gbuild

2021-11-08 Thread Luboš Luňák (via logerrit)
 solenv/gbuild/ExternalProject.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 69ee81cc3947a91efb03eb10a117a3f1de5b92ad
Author: Luboš Luňák 
AuthorDate: Sun Nov 7 18:21:44 2021 +
Commit: Luboš Luňák 
CommitDate: Mon Nov 8 09:14:53 2021 +0100

set up gb_COMPILER_SETUP also for gbuild's ExternalProject

It's used to set up various ccache variables, which without this
aren't applied to builds handled by other build systems.

Change-Id: Id1157b5a02d607651ba18b249375da6e1fa13cd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124826
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/solenv/gbuild/ExternalProject.mk b/solenv/gbuild/ExternalProject.mk
index afb76c3a19d8..6f703f256174 100644
--- a/solenv/gbuild/ExternalProject.mk
+++ b/solenv/gbuild/ExternalProject.mk
@@ -222,7 +222,7 @@ $(call gb_Helper_print_on_error,cd $(EXTERNAL_WORKDIR)/$(3) 
&& \
unset Platform && \
$(if $(WRAPPERS),export $(WRAPPERS) &&) \
$(if $(NMAKE),export $(NMAKE) &&) \
-   $(2) && touch $@,$(EXTERNAL_WORKDIR)/$(if $(3),$(3)/,)$(if 
$(4),$(4),$(1).log))
+   $(gb_COMPILER_SETUP) $(2) && touch $@,$(EXTERNAL_WORKDIR)/$(if 
$(3),$(3)/,)$(if $(4),$(4),$(1).log))
 )
 endef
 


<    2   3   4   5   6   7   8   9   10   11   >