summaryrefslogtreecommitdiffstats
path: root/vcl/source/bitmap/BitmapEx.cxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:03:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 05:09:28 +0000
commit97ac77f067910fa5e8206d75160fa63546a9358d (patch)
treee6fa64b43e8150ef65578afa4f1f40f3e19f7fa3 /vcl/source/bitmap/BitmapEx.cxx
parentReleasing progress-linux version 4:24.2.2-3~progress7.99u1. (diff)
downloadlibreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.tar.xz
libreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.zip
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vcl/source/bitmap/BitmapEx.cxx')
-rw-r--r--vcl/source/bitmap/BitmapEx.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 40feacbf66..07e25f1771 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -657,7 +657,7 @@ namespace
const Bitmap& rSource,
const Size& rDestinationSize,
const basegfx::B2DHomMatrix& rTransform,
- bool bSmooth)
+ bool bSmooth, bool bAlphaMask)
{
Bitmap aDestination(rDestinationSize, vcl::PixelFormat::N24_BPP);
BitmapScopedWriteAccess xWrite(aDestination);
@@ -673,7 +673,10 @@ namespace
// tdf#157795 set color to black outside of bitmap bounds
// Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3,
// transparent areas are now black instead of white.
- const BitmapColor aOutside(0x0, 0x0, 0x0);
+ // tdf#160831 only set outside color to black for alpha masks
+ // The outside color still needs to be white for the content
+ // so only apply the fix for tdf#157795 to the alpha mask.
+ const BitmapColor aOutside = bAlphaMask ? BitmapColor(0x0, 0x0, 0x0) : BitmapColor(0xff, 0xff, 0xff);
for(tools::Long y(0); y < aDestinationSizePixel.getHeight(); y++)
{
@@ -759,12 +762,12 @@ BitmapEx BitmapEx::TransformBitmapEx(
// force destination to 24 bit, we want to smooth output
const Size aDestinationSize(basegfx::fround(fWidth), basegfx::fround(fHeight));
bool bSmooth = implTransformNeedsSmooth(rTransformation);
- const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bSmooth));
+ const Bitmap aDestination(impTransformBitmap(GetBitmap(), aDestinationSize, rTransformation, bSmooth, false));
// create mask
if(IsAlpha())
{
- const Bitmap aAlpha(impTransformBitmap(GetAlphaMask().GetBitmap(), aDestinationSize, rTransformation, bSmooth));
+ const Bitmap aAlpha(impTransformBitmap(GetAlphaMask().GetBitmap(), aDestinationSize, rTransformation, bSmooth, true));
return BitmapEx(aDestination, AlphaMask(aAlpha));
}