drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 2 - drawinglayer/source/texture/texture3d.cxx | 3 + external/skia/UnpackedTarball_skia.mk | 1 external/skia/fix-alpha-difference-copy.patch.1 | 13 ++++++ external/skia/fix-pch.patch | 28 ++++++++++++++ solenv/gbuild/JunitTest.mk | 2 - solenv/gbuild/PythonTest.mk | 2 - solenv/gbuild/UITest.mk | 2 - vcl/inc/unx/salinst.h | 2 - vcl/inc/win/salinst.h | 1 vcl/skia/salbmp.cxx | 16 ++++++-- vcl/source/gdi/bitmapex.cxx | 2 + vcl/unx/generic/app/salinst.cxx | 10 ----- vcl/unx/generic/window/salframe.cxx | 1 vcl/win/app/salinst.cxx | 10 ----- 15 files changed, 65 insertions(+), 30 deletions(-)
New commits: commit 2f66e50c6de540eddb1956027265a04d1f5bc637 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Thu Nov 21 12:17:13 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Thu Nov 21 12:17:13 2019 +0100 revert BackendCapabilities::mbSupportsBitmap32 for Skia It appears that there are still some paths that do not expect bitmaps to be truly 32bit, so better revert to the old safe (and poor, complicated and inefficient) way of pretty much ignoring the alpha channel in SkiaSalBitmap, and let BitmapEx handle it by using an extra alpha bitmap. Change-Id: I4318c05f4ceafc5de48e19eeae5efe2abed2ec69 diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index db5241dbe1b9..bd28d6895f78 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -81,8 +81,6 @@ public: virtual void AfterAppInit() override; - std::shared_ptr<vcl::BackendCapabilities> GetBackendCapabilities() override; - // dtrans implementation virtual css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override; diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index c06e51c84050..bcd3540ad8a9 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -73,7 +73,6 @@ public: virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override; virtual OUString getOSVersion() override; - virtual std::shared_ptr<vcl::BackendCapabilities> GetBackendCapabilities() override; static int WorkaroundExceptionHandlingInUSER32Lib(int nExcept, LPEXCEPTION_POINTERS pExceptionInfo); }; diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index 9910693d6336..fb0c3608028d 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -80,8 +80,16 @@ bool SkiaSalBitmap::Create(const Size& rSize, sal_uInt16 nBitCount, const Bitmap } if (colorType != kUnknown_SkColorType) { + // TODO + // As long as vcl::BackendCapabilities::mbSupportsBitmap32 is not set, we must use + // unpremultiplied alpha. This is because without mbSupportsBitmap32 set VCL uses + // an extra bitmap for the alpha channel and then merges the channels together + // into colors. kPremul_SkAlphaType would provide better performance, but + // without mbSupportsBitmap32 BitmapReadAccess::ImplSetAccessPointers() would use + // functions that merely read RGB without A, so the premultiplied values would + // not be converted back to unpremultiplied values. if (!mBitmap.tryAllocPixels( - SkImageInfo::Make(rSize.Width(), rSize.Height(), colorType, kPremul_SkAlphaType))) + SkImageInfo::Make(rSize.Width(), rSize.Height(), colorType, kUnpremul_SkAlphaType))) { return false; } diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 25c081281ea0..e403e4433ac4 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -216,14 +216,4 @@ std::unique_ptr<GenPspGraphics> X11SalInstance::CreatePrintGraphics() return std::make_unique<GenPspGraphics>(); } -std::shared_ptr<vcl::BackendCapabilities> X11SalInstance::GetBackendCapabilities() -{ - auto pBackendCapabilities = SalInstance::GetBackendCapabilities(); -#if HAVE_FEATURE_SKIA - if( SkiaHelper::isVCLSkiaEnabled()) - pBackendCapabilities->mbSupportsBitmap32 = true; -#endif - return pBackendCapabilities; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index a27ffee2779b..dd3023ab6948 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -1068,14 +1068,4 @@ OUString WinSalInstance::getOSVersion() return aVer.makeStringAndClear(); } -std::shared_ptr<vcl::BackendCapabilities> WinSalInstance::GetBackendCapabilities() -{ - auto pBackendCapabilities = SalInstance::GetBackendCapabilities(); -#if HAVE_FEATURE_SKIA - if( SkiaHelper::isVCLSkiaEnabled()) - pBackendCapabilities->mbSupportsBitmap32 = true; -#endif - return pBackendCapabilities; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 6ad6ad03c80cf42d26a2fa493f26b8df2ee83697 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Thu Nov 21 12:09:17 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Thu Nov 21 12:09:17 2019 +0100 patch Skia bug with copying data with different alpha type https://bugs.chromium.org/p/skia/issues/detail?id=9662 Change-Id: Ic5208c2c817912cddbfae4b86e3b3647306262fb diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk index 1fab368cc34b..aabb1149a3ae 100644 --- a/external/skia/UnpackedTarball_skia.mk +++ b/external/skia/UnpackedTarball_skia.mk @@ -19,6 +19,7 @@ skia_patches := \ make-api-visible.patch.1 \ fix-shader-locale.patch.1 \ no-trace-resources-on-exit.patch.1 \ + fix-alpha-difference-copy.patch.1 \ share-grcontext.patch.1 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1)) diff --git a/external/skia/fix-alpha-difference-copy.patch.1 b/external/skia/fix-alpha-difference-copy.patch.1 new file mode 100644 index 000000000000..d9e992a770a7 --- /dev/null +++ b/external/skia/fix-alpha-difference-copy.patch.1 @@ -0,0 +1,13 @@ +diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp +index 89b107b939..042d8e65aa 100644 +--- a/src/core/SkBlitter_Sprite.cpp ++++ b/src/core/SkBlitter_Sprite.cpp +@@ -178,7 +178,7 @@ SkBlitter* SkBlitter::ChooseSprite(const SkPixmap& dst, const SkPaint& paint, + */ + SkASSERT(allocator != nullptr); + +- if (source.alphaType() == kUnpremul_SkAlphaType) { ++ if (source.alphaType() != dst.alphaType()) { + return nullptr; + } + commit 6c6366cfd96210059939c4e4d7bdb67cf02b6205 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Wed Nov 20 15:37:11 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 15:37:11 2019 +0100 handle properly true 32bit bitmaps in some places I.e. those created with vcl::BackendCapabilities::mbSupportsBitmap32 set. But there are quite possibly many more places that do not expect that the Bitmap itself would contain alpha. Change-Id: I83db37b3d346f42565f96b9bbf81c71b97b6bf8b diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 3c5f7d5e29bf..8874d3425599 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -23,6 +23,7 @@ #include <drawinglayer/texture/texture3d.hxx> #include <vcl/bitmapaccess.hxx> +#include <vcl/BitmapTools.hxx> #include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx> #include <sal/log.hxx> @@ -76,6 +77,8 @@ namespace drawinglayer mbIsAlpha(false), mbIsTransparent(maBitmapEx.IsTransparent()) { + if(vcl::bitmap::convertBitmap32To24Plus8(maBitmapEx,maBitmapEx)) + mbIsTransparent = maBitmapEx.IsTransparent(); // #121194# Todo: use alpha channel, too (for 3d) maBitmap = maBitmapEx.GetBitmap(); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 5e410d05fb9b..0fe22f607ead 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -689,6 +689,8 @@ sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const { if (nX >= 0 && nX < GetSizePixel().Width() && nY >= 0 && nY < GetSizePixel().Height()) { + if (maBitmap.GetBitCount() == 32) + return GetPixelColor(nX, nY).GetTransparency(); switch(meTransparent) { case TransparentType::NONE: diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 370b47cbdb6b..4379efa2e162 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -261,6 +261,7 @@ static void CreateNetWmAppIcon( sal_uInt16 nIcon, NetWmIconData& netwm_icon ) if( aIcon.IsEmpty()) continue; + vcl::bitmap::convertBitmap32To24Plus8(aIcon, aIcon); Bitmap icon = aIcon.GetBitmap(); AlphaMask mask; switch( aIcon.GetTransparentType()) commit d657cb05264fbf4ea4e18d1528402d682b2e7f0b Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Wed Nov 20 12:47:23 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 12:47:23 2019 +0100 copy SkImage properly Change-Id: I61f082d8a8d8eead6c49bbf3da997462e7d9738e diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index 1e5c554b49f2..9910693d6336 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -49,7 +49,9 @@ SkiaSalBitmap::SkiaSalBitmap(const SkImage& image) { SkCanvas canvas(mBitmap); // TODO makeNonTextureImage() ? - canvas.drawImage(&image, 0, 0); + SkPaint paint; + paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha + canvas.drawImage(&image, 0, 0, &paint); } } commit 54b11bd73f5f02abb3d4d9127ff41a3b0af8441b Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Wed Nov 20 12:10:21 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 12:10:21 2019 +0100 fix mistyped operator Change-Id: I10ca633d31163c968b0010983132942a1823a3f6 diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index de49400cd481..1e5c554b49f2 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -86,7 +86,7 @@ bool SkiaSalBitmap::Create(const Size& rSize, sal_uInt16 nBitCount, const Bitmap #ifdef DBG_UTIL // fill with random garbage sal_uInt8* buffer = static_cast<sal_uInt8*>(mBitmap.getPixels()); - size_t size = mBitmap.rowBytes() & mBitmap.height(); + size_t size = mBitmap.rowBytes() * mBitmap.height(); for (size_t i = 0; i < size; i++) buffer[i] = (i & 0xFF); #endif commit 00ed4ea682a2ec05a7c789679d047c5745cd0088 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Nov 19 12:52:00 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 11:33:22 2019 +0100 fix a VirtualDevice leak VclPtr is a smart ptr, but it does not own (and thus does not autodelete). Change-Id: I2d9b924852d01b118fb0bc2a583063da230ee065 diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index c377f4ee6526..ae753a40a39b 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -170,7 +170,7 @@ namespace if (maDeviceTemplates[pRetval]->isDisposed()) { maDeviceTemplates.erase(pRetval); - pRetval = nullptr; + pRetval.disposeAndClear(); } else { commit 3c4b5b2c138e49b64d8ad3c24e03c63e982416f8 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Thu Nov 14 15:48:43 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 11:33:22 2019 +0100 use icerun also for python/java/ui tests Change-Id: If25c4949b999435e7a444d80a45f3dce9b8184ee diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index 2102d196d58c..2be9376879ce 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -40,7 +40,7 @@ else rm -rf $(call gb_JunitTest_get_userdir,$*) && \ mkdir -p $(call gb_JunitTest_get_userdir,$*)/user && \ cp $(SRCDIR)/qadevOOo/qa/registrymodifications.xcu $(call gb_JunitTest_get_userdir,$*)/user/ && \ - ($(gb_TEST_ENV_VARS) $(gb_JunitTest_JAVACOMMAND) \ + ($(gb_TEST_ENV_VARS) $(ICECREAM_RUN) $(gb_JunitTest_JAVACOMMAND) \ -classpath "$(T_CP)" \ $(DEFS) \ org.junit.runner.JUnitCore \ diff --git a/solenv/gbuild/PythonTest.mk b/solenv/gbuild/PythonTest.mk index 16bc7d2404a7..9c21ca959852 100644 --- a/solenv/gbuild/PythonTest.mk +++ b/solenv/gbuild/PythonTest.mk @@ -56,7 +56,7 @@ else TestUserDir="$(call gb_Helper_make_url,$(dir $(call gb_PythonTest_get_target,$*)))" \ PYTHONDONTWRITEBYTECODE=1 \ $(gb_TEST_ENV_VARS) \ - $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \ + $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_RR) \ $(gb_PythonTest_COMMAND) \ $(if $(PYTHON_TEST_NAME),$(PYTHON_TEST_NAME),$(MODULES)) \ $(if $(gb_CppunitTest__interactive),, \ diff --git a/solenv/gbuild/UITest.mk b/solenv/gbuild/UITest.mk index 5ae6774b7d8d..c155348194ca 100644 --- a/solenv/gbuild/UITest.mk +++ b/solenv/gbuild/UITest.mk @@ -37,7 +37,7 @@ else gb_UITest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice endif -gb_UITest_COMMAND = LIBO_LANG=C $(gb_CppunitTest_RR) $(gb_UITest_EXECUTABLE) $(SRCDIR)/uitest/test_main.py +gb_UITest_COMMAND = LIBO_LANG=C $(ICECREAM_RUN) $(gb_CppunitTest_RR) $(gb_UITest_EXECUTABLE) $(SRCDIR)/uitest/test_main.py .PHONY : $(call gb_UITest_get_clean_target,%) $(call gb_UITest_get_clean_target,%) : commit a065fbdd33268eea596e67676820d1fbee17624b Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Nov 12 17:28:14 2019 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 20 11:33:22 2019 +0100 fix Skia with --enable-pch=full Change-Id: I6bec47e373c042d1ffb3607bf5dca9dfe2509466 diff --git a/external/skia/fix-pch.patch b/external/skia/fix-pch.patch index 1bd09f1bbc30..a991e80970e9 100644 --- a/external/skia/fix-pch.patch +++ b/external/skia/fix-pch.patch @@ -54,3 +54,31 @@ #include <dwrite.h> #include <d2d1.h> +--- skia/include/core/SkColor.h ++++ skia/include/core/SkColor.h +@@ -396,6 +396,7 @@ using SkColor4f = SkRGBA4f<kUnpremul_SkAlphaType>; + + template <> SK_API SkColor4f SkColor4f::FromColor(SkColor); + template <> SK_API SkColor SkColor4f::toSkColor() const; ++template <> uint32_t SkColor4f::toBytes_RGBA() const; + + namespace SkColors { + constexpr SkColor4f kTransparent = {0, 0, 0, 0}; +--- skia/include/private/SkColorData.h ++++ skia/include/private/SkColorData.h +@@ -441,4 +441,6 @@ constexpr SkPMColor4f SK_PMColor4fILLEGAL = { SK_FloatNegativeInfinity, + SK_FloatNegativeInfinity, + SK_FloatNegativeInfinity }; + ++template <> uint32_t SkPMColor4f::toBytes_RGBA() const; ++ + #endif +--- skia/src/gpu/text/GrTextBlobCache.h ++++ skia/src/gpu/text/GrTextBlobCache.h +@@ -188,4 +188,6 @@ private: + SkMessageBus<PurgeBlobMessage>::Inbox fPurgeBlobInbox; + }; + ++template<> SkMessageBus<GrTextBlobCache::PurgeBlobMessage>* SkMessageBus<GrTextBlobCache::PurgeBlobMessage>::Get(); ++ + #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits