From f12a617da1963728260ab2b082c825450435bb87 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 2 Oct 2019 17:15:07 +0200 Subject: make the X11/Skia backend finally capable of drawing on screen Change-Id: I5c847c1036c671137ee27053691189093b1dafae --- vcl/inc/skia/gdiimpl.hxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'vcl/inc/skia/gdiimpl.hxx') 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 +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 mFlush; }; #endif -- cgit v1.2.3