summaryrefslogtreecommitdiff
path: root/vcl/inc/skia/gdiimpl.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-09-23 18:03:54 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-09-23 18:06:13 +0200
commitcdf86c3dfbc94c8147c5c681c642398427340e9a (patch)
treeece91992711720b751e0113d3e9a79e008288273 /vcl/inc/skia/gdiimpl.hxx
parent9e7b229fceae5d5c7073a115e108f710db741a06 (diff)
WIP add forgotten skia/gdiimpl.hxx changes
Change-Id: I9bd809fe1e1896a119cd4c3c72e1fd41fa4bed41
Diffstat (limited to 'vcl/inc/skia/gdiimpl.hxx')
-rw-r--r--vcl/inc/skia/gdiimpl.hxx40
1 files changed, 38 insertions, 2 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index ea73222b57ae..af0ce88590c7 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -22,8 +22,11 @@
#include <vcl/dllapi.h>
-#include "salgdiimpl.hxx"
-#include "salgeom.hxx"
+#include <salgdiimpl.hxx>
+#include <salgeom.hxx>
+
+#include <SkPaint.h>
+#include <SkSurface.h>
class VCL_DLLPUBLIC SkiaSalGraphicsImpl : public SalGraphicsImpl
{
@@ -178,6 +181,39 @@ public:
virtual bool drawGradient(const tools::PolyPolygon& rPolygon,
const Gradient& rGradient) override;
+
+#ifdef DBG_UTIL
+ void dump(const char* file) const;
+#endif
+
+protected:
+ void setProvider(SalGeometryProvider* provider) { mProvider = provider; }
+
+private:
+ // get the width of the device
+ int GetWidth() const { return mProvider ? mProvider->GetWidth() : 1; }
+ // get the height of the device
+ int GetHeight() const { return mProvider ? mProvider->GetHeight() : 1; }
+ static SkColor toSkColor(Color color)
+ {
+ return SkColorSetARGB(255 - color.GetTransparency(), color.GetRed(), color.GetGreen(),
+ color.GetBlue());
+ }
+ static Color fromSkColor(SkColor color)
+ {
+ return Color(255 - SkColorGetA(color), SkColorGetR(color), SkColorGetG(color),
+ SkColorGetB(color));
+ }
+
+ SalGraphics& mParent;
+ /// Pointer to the SalFrame or SalVirtualDevice
+ SalGeometryProvider* mProvider;
+ // The Skia surface that is target of all the rendering.
+ sk_sp<SkSurface> mSurface;
+ SkPaint mPaint; // The current paint object (contains paint setup, such as color to use).
+ vcl::Region mClipRegion;
+ Color mLineColor;
+ Color mFillColor;
};
#endif