diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-08-06 01:19:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-06 12:23:07 +0200 |
commit | ad1f69d28d31725a22e7e1cbb4d950aa9ad3bea7 (patch) | |
tree | f3c553d612f3db55d778ac5835bd1938799d7173 /canvas | |
parent | f454a774053d2f631009612c78713822f6afdbd2 (diff) |
tdf#156540 invert alpha mask when drawing sprites
Due to the switch from transparency to alpha in commit
81994cb2b8b32453a92bcb011830fcb884f22ff3, a sprite's
alpha mask needs to be inverted.
Additionally, fixes an oversight in vcl's alpha.cxx, where manual
blend math got mangled, also in
81994cb2b8b32453a92bcb011830fcb884f22ff3.
Change-Id: I8ebbbc7fe624d8dfc8121d8814d30875c498870d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155378
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/vcl/spritehelper.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index 3494a5fbda8f..f188526930a0 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx @@ -134,12 +134,14 @@ namespace vclcanvas // sprite content might contain alpha, create // BmpEx, then. BitmapEx aMask( mpBackBufferMask->getOutDev().GetBitmapEx( aEmptyPoint, - aOutputSize ) ); + aOutputSize ) ); + AlphaMask aAlpha( aMask.GetBitmap() ); + aAlpha.Invert(); // Note: since we retrieved aBmp and aMask // directly from an OutDev, it's already a // 'display bitmap' on windows. - maContent = BitmapEx( aBmp.GetBitmap(), AlphaMask( aMask.GetBitmap()) ); + maContent = BitmapEx( aBmp.GetBitmap(), aAlpha ); } } |