Revert "tdf#156540 invert alpha when drawing sprites"
This reverts commit 52637f46cc79eb7f65a97524e92a0b2f45d3d598.
Reason for revert: A better fix is being worked on in https://gerrit.libreoffice.org/c/core/+/155378
Change-Id: I91c6ed96bdd202612d4b10458c015532b9162c1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155308
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Tested-by: Patrick Luby <plubius@neooffice.org>
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 54ad522..3494a5f 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -31,7 +31,6 @@
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/outdev.hxx>
#include <vcl/skia/SkiaHelper.hxx>
#include <canvas/canvastools.hxx>
@@ -137,17 +136,10 @@ namespace vclcanvas
BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmapEx( aEmptyPoint,
aOutputSize ) );
AlphaMask aAlpha( aMask.GetBitmap() );
#if HAVE_FEATURE_SKIA
// tdf#156540 invert alpha mask when using Skia
if ( SkiaHelper::isVCLSkiaEnabled() )
aAlpha.Invert();
#endif
// Note: since we retrieved aBmp and aMask
// directly from an OutDev, it's already a
// 'display bitmap' on windows.
maContent = BitmapEx( aBmp.GetBitmap(), aAlpha );
maContent = BitmapEx( aBmp.GetBitmap(), AlphaMask( aMask.GetBitmap()) );
}
}
@@ -188,13 +180,7 @@ namespace vclcanvas
aMoveTransform.translate( aOutPos.X(), aOutPos.Y() );
aTransform = aMoveTransform * aTransform * aSizeTransform;
// tdf#156540 invert alpha when Skia is disabled
bool bAlpha = false;
#if HAVE_FEATURE_SKIA
if ( SkiaHelper::isVCLSkiaEnabled() )
bAlpha = true;
#endif
rTargetSurface.DrawTransformedBitmapEx( aTransform, *maContent, bAlpha ? fAlpha : 1.0 - fAlpha );
rTargetSurface.DrawTransformedBitmapEx( aTransform, *maContent, fAlpha );
rTargetSurface.Pop();