[Libreoffice-commits] core.git: vcl/headless vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Nov 13 07:23:17 PST 2015


 vcl/headless/svpgdi.cxx                       |   10 +++++++---
 vcl/inc/headless/svpgdi.hxx                   |    5 ++---
 vcl/inc/unx/gtk/gtkgdi.hxx                    |    2 --
 vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx      |   13 +++++++------
 vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx      |    9 +++++----
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    7 +------
 6 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 81860b908b0c6104d47886a172b65d8d31f59ec3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 13 13:24:34 2015 +0000

    do all the headless using platforms have cairo ?
    
    Change-Id: I4c0250254480790f49ad45f3d42151aee4a441e8
    Reviewed-on: https://gerrit.libreoffice.org/19953
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index fc7d5fa..6c108a3 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 ac24df4..c040a0e 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 ee101af..e559385 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 2262012..0171ef1 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 fcba273..1a0a1ec 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 a1927e4..7c25774 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;


More information about the Libreoffice-commits mailing list