summaryrefslogtreecommitdiff
path: root/vcl/skia/gdiimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/skia/gdiimpl.cxx')
-rw-r--r--vcl/skia/gdiimpl.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 928015ac5c14..9c8d7c497ba2 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -842,14 +842,16 @@ void SkiaSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, const SalBitmap& r
Color nMaskColor)
{
assert(dynamic_cast<const SkiaSalBitmap*>(&rSalBitmap));
- drawMask(rPosAry, static_cast<const SkiaSalBitmap&>(rSalBitmap).GetAlphaSkBitmap(), nMaskColor);
+ sk_sp<SkImage> image
+ = SkImage::MakeFromBitmap(static_cast<const SkiaSalBitmap&>(rSalBitmap).GetAlphaSkBitmap());
+ drawMask(rPosAry, *image, nMaskColor);
}
-void SkiaSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, const SkBitmap& rBitmap,
+void SkiaSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, const SkImage& rImage,
Color nMaskColor)
{
SkBitmap tmpBitmap;
- if (!tmpBitmap.tryAllocN32Pixels(rBitmap.width(), rBitmap.height()))
+ if (!tmpBitmap.tryAllocN32Pixels(rImage.width(), rImage.height()))
abort();
tmpBitmap.eraseColor(toSkColor(nMaskColor));
SkPaint paint;
@@ -857,7 +859,7 @@ void SkiaSalGraphicsImpl::drawMask(const SalTwoRect& rPosAry, const SkBitmap& rB
// TODO figure out the right blend mode to avoid the temporary bitmap
paint.setBlendMode(SkBlendMode::kDstOut);
SkCanvas canvas(tmpBitmap);
- canvas.drawBitmap(rBitmap, 0, 0, &paint);
+ canvas.drawImage(&rImage, 0, 0, &paint);
drawBitmap(rPosAry, tmpBitmap);
}