From 5ba5ac948db1092712ffeaef41983ea5f5dcb5cc Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 19 Feb 2021 18:36:23 +0100 Subject: add additional 0-1 alpha argument to DrawTransformedBitmap() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the VCL backends the apply the extra alpha transformation as it sees fit, rather than it being done manually elsewhere (and even if the backend doesn't implement it, at least do it in one place in the function). With the document from tdf#136223, going from slide 2 to slide 3, this easily saves 10-30% of CPU cycles. As an additional bonus, using AlphaMask::BlendWith() rather than AlphaMask::Replace() makes edges of shapes noticeably more smooth. Change-Id: I036dc9b887d6def0c7cdad3982becabdc7cd5206 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111247 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/inc/salgdiimpl.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vcl/inc/salgdiimpl.hxx') diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx index eb1508dcf7d6..8b310c586e1a 100644 --- a/vcl/inc/salgdiimpl.hxx +++ b/vcl/inc/salgdiimpl.hxx @@ -194,7 +194,8 @@ public: const basegfx::B2DPoint& rX, const basegfx::B2DPoint& rY, const SalBitmap& rSourceBitmap, - const SalBitmap* pAlphaBitmap) = 0; + const SalBitmap* pAlphaBitmap, + double fAlpha) = 0; /// Used e.g. by canvas to know whether to cache the drawing. virtual bool hasFastDrawTransformedBitmap() const = 0; -- cgit