[Libreoffice-commits] core.git: drawinglayer/source

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 10 10:31:14 UTC 2021


 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit af5ff9ee32031c9eb7b4545cb2db6186792fda8f
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Mar 9 22:55:00 2021 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Mar 10 11:30:35 2021 +0100

    use VCL API rather than manually apply numeric alpha change
    
    Change-Id: I500b3ad3d8229b792b7394a9e1b2f51fa9b1af2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112251
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 927dacd12b65..e192a29a0a6f 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -410,11 +410,11 @@ void impBufferDevice::paint(double fTrans)
     }
     else if (0.0 != fTrans)
     {
-        sal_uInt8 nMaskValue(static_cast<sal_uInt8>(basegfx::fround(fTrans * 255.0)));
-        AlphaMask aAlphaMask(aSizePixel, &nMaskValue);
-        BitmapEx aContent(mpContent->GetBitmapEx(aEmptyPoint, aSizePixel));
-        aAlphaMask.BlendWith(aContent.GetAlpha());
-        mrOutDev.DrawBitmapEx(maDestPixel.TopLeft(), BitmapEx(aContent.GetBitmap(), aAlphaMask));
+        basegfx::B2DHomMatrix trans, scale;
+        trans.translate(maDestPixel.TopLeft().X(), maDestPixel.TopLeft().Y());
+        scale.scale(aSizePixel.Width(), aSizePixel.Height());
+        mrOutDev.DrawTransformedBitmapEx(
+            trans * scale, mpContent->GetBitmapEx(aEmptyPoint, aSizePixel), 1 - fTrans);
     }
     else
     {


More information about the Libreoffice-commits mailing list