diff options
author | Patrick Luby <plubius@libreoffice.org> | 2023-11-20 14:01:32 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-11-21 07:13:17 +0100 |
commit | 9a0dad2a649066a10ace53a06d563596330199a0 (patch) | |
tree | 62069e14e4536ca738a754934446724188bc1576 /drawinglayer | |
parent | 2fa88bfbfa4c9befe1be8a1953c018437a621254 (diff) |
tdf#157558 invert and remove blended white color
Before commit 81994cb2b8b32453a92bcb011830fcb884f22ff3,
RemoveBlendedStartColor(COL_BLACK, aAlpha) would darken
the bitmap when running a slideshow, printing, or exporting
to PDF. To get the same effect, the alpha mask must be
inverted, RemoveBlendedStartColor(COL_WHITE, aAlpha)
called, and the alpha mask uninverted.
Change-Id: I8e81b11aab05954c821f833f4a2fc77eec7b7701
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159742
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/converters.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx index 56fe2fb91791..3e32af49c508 100644 --- a/drawinglayer/source/tools/converters.cxx +++ b/drawinglayer/source/tools/converters.cxx @@ -268,7 +268,22 @@ BitmapEx convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&& rSe // Now that vcl supports bitmaps with an alpha channel, only apply // this correction to bitmaps without an alpha channel. if (pContent->GetBitCount() < 32) + { aRetval.RemoveBlendedStartColor(COL_BLACK, aAlpha); + } + else + { + // tdf#157558 invert and remove blended white color + // Before commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, + // RemoveBlendedStartColor(COL_BLACK, aAlpha) would darken + // the bitmap when running a slideshow, printing, or exporting + // to PDF. To get the same effect, the alpha mask must be + // inverted, RemoveBlendedStartColor(COL_WHITE, aAlpha) + // called, and the alpha mask uninverted. + aAlpha.Invert(); + aRetval.RemoveBlendedStartColor(COL_WHITE, aAlpha); + aAlpha.Invert(); + } // return combined result return BitmapEx(aRetval, aAlpha); } |