diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-06-30 10:19:34 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-07-01 07:36:39 +0200 |
commit | d1fcc9053f98cc4afb52498b40a836884bb5ec6f (patch) | |
tree | 1bc3fed7ffc3972ad051f1a46f759825eeb82690 /vcl/inc/skia/gdiimpl.hxx | |
parent | 8663d81828541072999b26451f7d6e6bfcb5f951 (diff) |
optimize Bitmap::Erase() for Skia by delaying the erase (tdf#134363)
Tdf#134363 causes OutputDevice::DrawTransformBitmapExDirect()
to create a huge 1bpp bitmap as mask, and Skia code then tries
to convert all the bits to a format Skia would understand. Which
is wasteful, as SkShader with the color given will do the same
task much more efficiently.
Change-Id: If0bba16f56fed9c3720be801b25a1e703054ed8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97488
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/inc/skia/gdiimpl.hxx')
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index 73fbee394072..c98038807287 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -200,10 +200,14 @@ public: #endif // Default blend mode for SkPaint is SkBlendMode::kSrcOver + void drawBitmap(const SalTwoRect& rPosAry, const SkiaSalBitmap& bitmap, + SkBlendMode blendMode = SkBlendMode::kSrcOver); + void drawImage(const SalTwoRect& rPosAry, const sk_sp<SkImage>& aImage, SkBlendMode eBlendMode = SkBlendMode::kSrcOver); - void drawShader(const SalTwoRect& rPosAry, const sk_sp<SkShader>& shader); + void drawShader(const SalTwoRect& rPosAry, const sk_sp<SkShader>& shader, + SkBlendMode blendMode = SkBlendMode::kSrcOver); enum class GlyphOrientation { |