From 1008f2a06e43c19b7d8b95427198bd691eed5992 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 10 Nov 2021 16:29:36 +0100 Subject: [PATCH] clean up SkCanvas before using the bitmap it's painted to MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- vcl/skia/gdiimpl.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.11.4.GIT