summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-02-19 18:36:23 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-02-24 12:40:13 +0100
commit5ba5ac948db1092712ffeaef41983ea5f5dcb5cc (patch)
tree1efc83d9f17c5f458908300eb9d918e665531662 /include
parentf57872d2da23c8a3f90c67b6ad4a3ad0f699a276 (diff)
add additional 0-1 alpha argument to DrawTransformedBitmap()
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 <l.lunak@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/outdev.hxx9
-rw-r--r--include/vcl/print.hxx2
2 files changed, 8 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 2eb6fd9e882e..a8d77c77b30e 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1480,10 +1480,14 @@ public:
@param rBitmapEx
The BitmapEx to be painted
+
+ @param fAlpha
+ Optional additional alpha to use for drawing (0 to 1, 1 being no change).
*/
void DrawTransformedBitmapEx(
const basegfx::B2DHomMatrix& rTransformation,
- const BitmapEx& rBitmapEx);
+ const BitmapEx& rBitmapEx,
+ double fAlpha = 1.0);
/** Return true if DrawTransformedBitmapEx() is fast.
@@ -1509,7 +1513,8 @@ protected:
*/
virtual bool DrawTransformBitmapExDirect(
const basegfx::B2DHomMatrix& aFullTransform,
- const BitmapEx& rBitmapEx);
+ const BitmapEx& rBitmapEx,
+ double fAlpha = 1.0);
/** Transform and reduce the area that needs to be drawn of the bitmap and return the new
visible range and the maximum area.
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 8ddd8bc7fbd3..e787ce40fca8 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -234,7 +234,7 @@ protected:
const Point& rSrcPtPixel, const Size& rSrcSizePixel) override;
bool DrawTransformBitmapExDirect( const basegfx::B2DHomMatrix& aFullTransform,
- const BitmapEx& rBitmapEx) override;
+ const BitmapEx& rBitmapEx, double fAlpha = 1.0) override;
bool TransformAndReduceBitmapExToTargetRange( const basegfx::B2DHomMatrix& aFullTransform,
basegfx::B2DRange &aVisibleRange, double &fMaximumArea) override;