diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-13 13:24:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-13 15:22:53 +0000 |
commit | 81860b908b0c6104d47886a172b65d8d31f59ec3 (patch) | |
tree | 4b84470e5e5c06435118f563df57af92c2585d7b | |
parent | 97464be9808c0d349be8b84fea6973527496bf26 (diff) |
do all the headless using platforms have cairo ?
Change-Id: I4c0250254480790f49ad45f3d42151aee4a441e8
Reviewed-on: https://gerrit.libreoffice.org/19953
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/headless/svpgdi.cxx | 10 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx | 9 | ||||
-rw-r--r-- | vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 7 |
6 files changed, 22 insertions, 24 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index fc7d5fa70e0a..6c108a34078c 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -145,7 +145,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, if (m_bUseLineColor || !m_bUseFillColor) return bRet; - cairo_t* cr = createCairoContext(m_aDevice); + cairo_t* cr = getCairoContext(); if (!cr) return bRet; @@ -817,8 +817,6 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong ) return false; } -#if ENABLE_CAIRO_CANVAS - cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr &rBuffer) { if (!isCairoCompatible(rBuffer)) @@ -838,6 +836,12 @@ cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr return cr; } +cairo_t* SvpSalGraphics::getCairoContext() const +{ + return SvpSalGraphics::createCairoContext(m_aOrigDevice); +} + +#if ENABLE_CAIRO_CANVAS bool SvpSalGraphics::SupportsCairo() const { return false; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index ac24df4cf086..c040a0e94ea2 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -202,13 +202,12 @@ public: virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const override; virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const override; virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const override; - virtual SystemFontData GetSysFontData( int nFallbacklevel ) const override; +#endif // ENABLE_CAIRO_CANVAS + cairo_t* getCairoContext() const; static cairo_t* createCairoContext(const basebmp::BitmapDeviceSharedPtr& rBuffer); void clipRegion(cairo_t* cr); - -#endif // ENABLE_CAIRO_CANVAS }; #endif diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index ee101af7d609..e5593856f474 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -59,8 +59,6 @@ public: static void refreshFontconfig( GtkSettings *pSettings ); static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer ); - cairo_t* getCairoContext() const; - virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override; private: GtkWidget *mpWindow; diff --git a/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx b/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx index 226201265d0e..0171ef12b022 100644 --- a/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx +++ b/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx @@ -8,34 +8,35 @@ */ #include "gtk3cairotextrender.hxx" +#include "headless/svpgdi.hxx" -GtkCairoTextRender::GtkCairoTextRender(GtkSalGraphics& rParent) +SvpCairoTextRender::SvpCairoTextRender(SvpSalGraphics& rParent) : mrParent(rParent) { } -GlyphCache& GtkCairoTextRender::getPlatformGlyphCache() +GlyphCache& SvpCairoTextRender::getPlatformGlyphCache() { return SvpSalGraphics::getPlatformGlyphCache(); } -cairo_t* GtkCairoTextRender::getCairoContext() +cairo_t* SvpCairoTextRender::getCairoContext() { return mrParent.getCairoContext(); } -void GtkCairoTextRender::getSurfaceOffset(double& nDX, double& nDY) +void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY) { nDX = 0; nDY = 0; } -void GtkCairoTextRender::clipRegion(cairo_t* cr) +void SvpCairoTextRender::clipRegion(cairo_t* cr) { mrParent.clipRegion(cr); } -void GtkCairoTextRender::drawSurface(cairo_t* /*cr*/) +void SvpCairoTextRender::drawSurface(cairo_t* /*cr*/) { } diff --git a/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx b/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx index fcba2731a40d..1a0a1ec3b871 100644 --- a/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx +++ b/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx @@ -11,15 +11,16 @@ #define INCLUDED_VCL_UNX_GTK3_GDI_GTK3CAIROTEXTRENDER_HXX #include "cairotextrender.hxx" -#include <unx/gtk/gtkgdi.hxx> -class GtkCairoTextRender : public CairoTextRender +class SvpSalGraphics; + +class SvpCairoTextRender : public CairoTextRender { protected: - GtkSalGraphics& mrParent; + SvpSalGraphics& mrParent; public: - explicit GtkCairoTextRender(GtkSalGraphics& rParent); + explicit SvpCairoTextRender(SvpSalGraphics& rParent); virtual GlyphCache& getPlatformGlyphCache() override; virtual cairo_t* getCairoContext() override; diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index a1927e4e47f8..7c25774a865f 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1999,7 +1999,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) mpFrame( pFrame ), mpWindow( pWindow ) { - m_xTextRenderImpl.reset(new GtkCairoTextRender(*this)); + m_xTextRenderImpl.reset(new SvpCairoTextRender(*this)); if(style_loaded) return; @@ -2124,11 +2124,6 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) gtk_widget_show_all(gDumbContainer); } -cairo_t* GtkSalGraphics::getCairoContext() const -{ - return mpFrame->getCairoContext(); -} - void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) { char* pForceDpi; |