[Libreoffice-commits] core.git: vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 13:06:19 UTC 2020


 vcl/skia/win/gdiimpl.cxx |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

New commits:
commit bac708dbd19940bfc7c211951bc7b198c9f0cdeb
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Apr 7 13:38:48 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Apr 7 15:05:41 2020 +0200

    simplify code
    
    Change-Id: I8806e5ac0f086c0356ae87bcc3020a3dc6d45e54
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91814
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index 50082d2fc51b..42c9078316f2 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -247,16 +247,7 @@ sk_sp<SkImage> SkiaCompatibleDC::getAsMaskImage() const
     alpha.setPixelRef(sk_ref_sp(bitmap8.pixelRef()), bitmap8.pixelRefOrigin().x(),
                       bitmap8.pixelRefOrigin().y());
     alpha.setImmutable();
-    sk_sp<SkSurface> surface
-        = SkiaHelper::createSkSurface(alpha.width(), alpha.height(), kAlpha_8_SkColorType);
-    // https://bugs.chromium.org/p/skia/issues/detail?id=9692
-    // Raster kAlpha_8_SkColorType surfaces need empty contents for SkBlendMode::kSrc.
-    if (!surface->getCanvas()->getGrContext())
-        surface->getCanvas()->clear(SkColorSetARGB(0x00, 0x00, 0x00, 0x00));
-    SkPaint paint;
-    paint.setBlendMode(SkBlendMode::kSrc); // set as is, including alpha
-    surface->getCanvas()->drawBitmap(alpha, 0, 0, &paint);
-    return surface->makeImageSnapshot();
+    return SkiaHelper::createSkImage(alpha);
 }
 
 sk_sp<SkImage> SkiaCompatibleDC::getAsImage() const


More information about the Libreoffice-commits mailing list