vcl/skia/gdiimpl.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1008f2a06e43c19b7d8b95427198bd691eed5992
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Nov 10 16:29:36 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Nov 12 11:08:40 2021 +0100

    clean up SkCanvas before using the bitmap it's painted to
    
    I think this is not strictly needed with raster bitmaps, but still,
    this is the proper way.
    
    Change-Id: If6ccf82cf633afefa5c043096ec01b5f3891dc0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125057
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 642752a3bbdd..cc5e309a4d40 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -680,10 +680,12 @@ void SkiaSalGraphicsImpl::applyXor()
         abort();
     SkPaint paint;
     paint.setBlendMode(SkBlendMode::kSrc); // copy as is
-    SkCanvas canvas(surfaceBitmap);
     SkRect area = SkRect::Make(mXorRegion.getBounds());
-    canvas.drawImageRect(makeCheckedImageSnapshot(mSurface), area, area, 
SkSamplingOptions(),
-                         &paint, SkCanvas::kFast_SrcRectConstraint);
+    {
+        SkCanvas canvas(surfaceBitmap);
+        canvas.drawImageRect(makeCheckedImageSnapshot(mSurface), area, area, 
SkSamplingOptions(),
+                             &paint, SkCanvas::kFast_SrcRectConstraint);
+    }
     // xor to surfaceBitmap
     assert(surfaceBitmap.info().alphaType() == kUnpremul_SkAlphaType);
     assert(mXorBitmap.info().alphaType() == kUnpremul_SkAlphaType);

Reply via email to