summaryrefslogtreecommitdiff
path: root/vcl/inc/skia/gdiimpl.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-19 11:09:51 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-22 13:49:01 +0100
commit53ce0e3af4dcb1c70380016b3824da71548cdc60 (patch)
treeb4077a95525b1b0f0026e2e84957136f396fe6cc /vcl/inc/skia/gdiimpl.hxx
parent1b327e4a33a2a2c575c247ea90365652d6549852 (diff)
move code to helper functions
I'll want some common extra functionality there later. Change-Id: I249f9ca4662fc8e8d52c58b1bd33293f363464d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125643 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.hxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index 9cf14f176185..aeaef186ca44 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -27,6 +27,8 @@
#include <skia/utils.hxx>
+#include <SkPaint.h>
+
class SkiaFlushIdle;
class GenericSalLayout;
class SkFont;
@@ -306,6 +308,29 @@ protected:
void performDrawPolyPolygon(const basegfx::B2DPolyPolygon& polygon, double transparency,
bool useAA);
+ // Create SkPaint set up for drawing lines (using mLineColor etc.).
+ SkPaint makeLinePaint(double transparency = 0) const
+ {
+ assert(mLineColor != SALCOLOR_NONE);
+ SkPaint paint;
+ paint.setColor(transparency == 0
+ ? SkiaHelper::toSkColor(mLineColor)
+ : SkiaHelper::toSkColorWithTransparency(mLineColor, transparency));
+ paint.setStyle(SkPaint::kStroke_Style);
+ return paint;
+ }
+ // Create SkPaint set up for filling (using mFillColor etc.).
+ SkPaint makeFillPaint(double transparency = 0) const
+ {
+ assert(mFillColor != SALCOLOR_NONE);
+ SkPaint paint;
+ paint.setColor(transparency == 0
+ ? SkiaHelper::toSkColor(mFillColor)
+ : SkiaHelper::toSkColorWithTransparency(mFillColor, transparency));
+ paint.setStyle(SkPaint::kFill_Style);
+ return paint;
+ }
+
template <typename charT, typename traits>
friend inline std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& stream, const SkiaSalGraphicsImpl* graphics)