From 2beb8b2e6aef50b8a35da37a5d0caf2ee33d174d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 18 Mar 2015 14:53:53 +0000 Subject: more thinking Change-Id: Ie349bd35b1fc92b77cc15f51eb886a1c9c92cbe1 --- vcl/generic/print/genpspgraphics.cxx | 4 ++++ vcl/headless/svpgdi.cxx | 4 ++++ vcl/inc/generic/genpspgraphics.h | 1 + vcl/inc/headless/svpgdi.hxx | 3 ++- vcl/inc/quartz/salgdi.h | 1 + vcl/inc/salgdi.hxx | 1 + vcl/inc/unx/gtk/gtkgdi.hxx | 1 + vcl/inc/unx/salgdi.h | 1 + vcl/inc/win/salgdi.h | 1 + vcl/source/outdev/outdev.cxx | 11 +++++++++++ vcl/unx/generic/gdi/salgdi.cxx | 4 ++++ vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 6 ++++++ 12 files changed, 37 insertions(+), 1 deletion(-) (limited to 'vcl') diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index d43e725b8b8c..53f6a579be38 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -1224,6 +1224,10 @@ cairo_t* GenPspGraphics::GetCairoContext() const return NULL; } +void GenPspGraphics::FlushCairoContext(cairo_t*) const +{ +} + SystemFontData GenPspGraphics::GetSysFontData( int /* nFallbacklevel */ ) const { return SystemFontData(); diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index de563063c631..d2822ebcf4de 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -748,4 +748,8 @@ cairo_t* SvpSalGraphics::GetCairoContext() const return NULL; } +void SvpSalGraphics::FlushCairoContext(cairo_t *) const +{ +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h index b4a683cc055c..094504c15ac1 100644 --- a/vcl/inc/generic/genpspgraphics.h +++ b/vcl/inc/generic/genpspgraphics.h @@ -204,6 +204,7 @@ public: virtual bool SupportsCairo() const SAL_OVERRIDE; virtual bool CanResizeCairoSurface() const SAL_OVERRIDE; virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t *) const SAL_OVERRIDE; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index e4ff74d93ace..b6d2a7420f34 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -200,7 +200,8 @@ public: virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE; virtual bool SupportsCairo() const SAL_OVERRIDE; - cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t *cr) const SAL_OVERRIDE; virtual bool CanResizeCairoSurface() const SAL_OVERRIDE; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 451c5823302a..7958af26d1f0 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -421,6 +421,7 @@ public: virtual bool SupportsCairo() const SAL_OVERRIDE; virtual bool CanResizeCairoSurface() const SAL_OVERRIDE; virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t*) const SAL_OVERRIDE; virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const SAL_OVERRIDE; virtual void BeginPaint() SAL_OVERRIDE { }; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 87971fd51013..1beebfade5b5 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -442,6 +442,7 @@ public: virtual bool SupportsCairo() const = 0; virtual bool CanResizeCairoSurface() const = 0; virtual cairo_t* GetCairoContext() const = 0; + virtual void FlushCairoContext(cairo_t *cr) const = 0; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const = 0; diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index 731b7f032bfa..1a63e744710e 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -51,6 +51,7 @@ public: Rectangle &rNativeContentRegion ) SAL_OVERRIDE; virtual bool SupportsCairo() const SAL_OVERRIDE; virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t *cr) const SAL_OVERRIDE; void updateSettings( AllSettings& rSettings ); static void refreshFontconfig( GtkSettings *pSettings ); diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 74ba77d4d27b..7851ca395179 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -264,6 +264,7 @@ public: virtual SystemGraphicsData GetGraphicsData() const SAL_OVERRIDE; virtual bool SupportsCairo() const SAL_OVERRIDE; virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t*) const SAL_OVERRIDE; virtual bool CanResizeCairoSurface() const SAL_OVERRIDE; virtual SystemFontData GetSysFontData( int nFallbackLevel ) const SAL_OVERRIDE; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index a4800eabe2e0..6502dac34c2f 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -448,6 +448,7 @@ public: virtual bool SupportsCairo() const SAL_OVERRIDE; virtual bool CanResizeCairoSurface() const SAL_OVERRIDE; virtual cairo_t* GetCairoContext() const SAL_OVERRIDE; + virtual void FlushCairoContext(cairo_t *) const SAL_OVERRIDE; virtual SystemFontData GetSysFontData( int nFallbacklevel ) const SAL_OVERRIDE; virtual void BeginPaint() SAL_OVERRIDE; diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 1ffa2282962a..8c3820f3060b 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -330,6 +330,17 @@ cairo_t* OutputDevice::GetCairoContext() const return mpGraphics->GetCairoContext(); } +void OutputDevice::FlushCairoContext(cairo_t* cr) const +{ + if (!mpGraphics) + { + if (!AcquireGraphics()) + return; + } + + mpGraphics->FlushCairoContext(cr); +} + css::uno::Any OutputDevice::GetSystemGfxDataAny() const { const SystemGraphicsData aSysData = GetSystemGfxData(); diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index 91bfa59520dc..1f70e9a4f52d 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -472,6 +472,10 @@ cairo_t* X11SalGraphics::GetCairoContext() const return NULL; } +void X11SalGraphics::FlushCairoContext(cairo_t*) const +{ +} + // draw a poly-polygon bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPolyPoly, double fTransparency ) { diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index eaf56ea32849..9123e589b247 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1561,6 +1561,12 @@ cairo_t* GtkSalGraphics::GetCairoContext() const return mpFrame->getCairoContext(); } +void GtkSalGraphics::FlushCairoContext(cairo_t *) const +{ + //request gtk to sync the entire contents + gtk_widget_queue_draw(mpWindow); +} + void GtkSalGraphics::clipRegion(cairo_t* cr) { if (!m_aClipRegion.IsEmpty()) -- cgit