summaryrefslogtreecommitdiff
path: root/vcl/inc/skia/gdiimpl.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-10-02 17:15:07 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-10-02 17:15:07 +0200
commitf12a617da1963728260ab2b082c825450435bb87 (patch)
treee4363c9d51cd69e637d78443545f54a964d8492c /vcl/inc/skia/gdiimpl.hxx
parentfb2d7a6026f746cc37b34e272426664a3b939fa3 (diff)
make the X11/Skia backend finally capable of drawing on screen
Change-Id: I5c847c1036c671137ee27053691189093b1dafae
Diffstat (limited to 'vcl/inc/skia/gdiimpl.hxx')
-rw-r--r--vcl/inc/skia/gdiimpl.hxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx
index aad4ea3e8454..c72c5979464d 100644
--- a/vcl/inc/skia/gdiimpl.hxx
+++ b/vcl/inc/skia/gdiimpl.hxx
@@ -27,6 +27,8 @@
#include <SkSurface.h>
+class SkiaFlushIdle;
+
class VCL_DLLPUBLIC SkiaSalGraphicsImpl : public SalGraphicsImpl
{
public:
@@ -37,8 +39,6 @@ public:
virtual void DeInit() override;
- virtual void freeResources() override;
-
const vcl::Region& getClipRegion() const;
virtual bool setClipRegion(const vcl::Region&) override;
@@ -183,6 +183,12 @@ public:
virtual bool drawGradient(const tools::PolyPolygon& rPolygon,
const Gradient& rGradient) override;
+ // To be called after any drawing.
+ void scheduleFlush();
+
+ // Internal, called by SkiaFlushIdle.
+ virtual void performFlush() = 0;
+
#ifdef DBG_UTIL
void dump(const char* file) const;
void dump(const SkBitmap& bitmap, const char* file) const;
@@ -191,7 +197,9 @@ public:
protected:
void setProvider(SalGeometryProvider* provider) { mProvider = provider; }
-private:
+ bool isOffscreen() const { return mProvider == nullptr || mProvider->IsOffScreen(); }
+
+protected:
// get the width of the device
int GetWidth() const { return mProvider ? mProvider->GetWidth() : 1; }
// get the height of the device
@@ -215,6 +223,7 @@ private:
vcl::Region mClipRegion;
Color mLineColor;
Color mFillColor;
+ std::unique_ptr<SkiaFlushIdle> mFlush;
};
#endif