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

Caolán McNamara caolanm at redhat.com
Sat Nov 14 07:58:40 PST 2015


 vcl/Library_vcl.mk                            |    2 --
 vcl/headless/svpgdi.cxx                       |   23 ++++++++++++++++-------
 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 ++++++-
 7 files changed, 37 insertions(+), 24 deletions(-)

New commits:
commit 5730388b6e8cd1345318afedb00afcfc139287a5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Nov 14 15:20:49 2015 +0000

    undo cairo use in svp for now
    
    seeing as its unavailable for android at the moment
    
    Change-Id: Idc4dfd01224a2b90eacce0efd2d1b8a75001d085

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 914637f..7592860 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -623,7 +623,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\
 ))
 
 $(eval $(call gb_Library_use_externals,vcl,\
-	cairo \
 	freetype \
 ))
 ifneq ($(OS),EMSCRIPTEN)
@@ -654,7 +653,6 @@ $(eval $(call gb_Library_use_static_libraries,vcl,\
 ))
 
 $(eval $(call gb_Library_use_externals,vcl,\
-	cairo \
 	fontconfig \
 	freetype \
 	expat \
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 8edc059..fc7d5fa 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -33,7 +33,9 @@
 #include <basegfx/polygon/b2dpolygontools.hxx>
 #include <basebmp/scanlineformats.hxx>
 
+#if ENABLE_CAIRO_CANVAS
 #include <cairo.h>
+#endif
 
 #if OSL_DEBUG_LEVEL > 2
 #include <basebmp/debug.hxx>
@@ -93,6 +95,8 @@ bool SvpSalGraphics::drawTransformedBitmap(
     return false;
 }
 
+#if ENABLE_CAIRO_CANVAS
+
 namespace
 {
     bool isCairoCompatible(const basebmp::BitmapDeviceSharedPtr &rBuffer)
@@ -130,15 +134,18 @@ void SvpSalGraphics::clipRegion(cairo_t* cr)
     }
 }
 
+#endif
+
 bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
 {
     bool bRet = false;
     (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency;
+#if ENABLE_CAIRO_CANVAS
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
     if (m_bUseLineColor || !m_bUseFillColor)
         return bRet;
 
-    cairo_t* cr = getCairoContext();
+    cairo_t* cr = createCairoContext(m_aDevice);
     if (!cr)
         return bRet;
 
@@ -188,6 +195,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
     }
     bRet = true;
 #endif
+#endif
     return bRet;
 }
 
@@ -809,6 +817,8 @@ 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))
@@ -828,12 +838,6 @@ 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;
@@ -870,9 +874,14 @@ SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
 
 bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const
 {
+#if ENABLE_CAIRO_CANVAS
     return m_aDrawMode != basebmp::DrawMode::XOR &&
            OutDevSupport_TransparentRect == eType &&
            isCairoCompatible(m_aDevice);
+#else
+    (void)eType;
+    return false;
+#endif
 }
 
 #endif
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index c040a0e..ac24df4 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -202,12 +202,13 @@ 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 e559385..ee101af 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -59,6 +59,8 @@ 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 0171ef1..2262012 100644
--- a/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3cairotextrender.cxx
@@ -8,35 +8,34 @@
  */
 
 #include "gtk3cairotextrender.hxx"
-#include "headless/svpgdi.hxx"
 
-SvpCairoTextRender::SvpCairoTextRender(SvpSalGraphics& rParent)
+GtkCairoTextRender::GtkCairoTextRender(GtkSalGraphics& rParent)
     : mrParent(rParent)
 {
 }
 
-GlyphCache& SvpCairoTextRender::getPlatformGlyphCache()
+GlyphCache& GtkCairoTextRender::getPlatformGlyphCache()
 {
     return SvpSalGraphics::getPlatformGlyphCache();
 }
 
-cairo_t* SvpCairoTextRender::getCairoContext()
+cairo_t* GtkCairoTextRender::getCairoContext()
 {
     return mrParent.getCairoContext();
 }
 
-void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
+void GtkCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
 {
     nDX = 0;
     nDY = 0;
 }
 
-void SvpCairoTextRender::clipRegion(cairo_t* cr)
+void GtkCairoTextRender::clipRegion(cairo_t* cr)
 {
     mrParent.clipRegion(cr);
 }
 
-void SvpCairoTextRender::drawSurface(cairo_t* /*cr*/)
+void GtkCairoTextRender::drawSurface(cairo_t* /*cr*/)
 {
 }
 
diff --git a/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx b/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx
index 1a0a1ec..fcba273 100644
--- a/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx
+++ b/vcl/unx/gtk3/gdi/gtk3cairotextrender.hxx
@@ -11,16 +11,15 @@
 #define INCLUDED_VCL_UNX_GTK3_GDI_GTK3CAIROTEXTRENDER_HXX
 
 #include "cairotextrender.hxx"
+#include <unx/gtk/gtkgdi.hxx>
 
-class SvpSalGraphics;
-
-class SvpCairoTextRender : public CairoTextRender
+class GtkCairoTextRender : public CairoTextRender
 {
 protected:
-    SvpSalGraphics& mrParent;
+    GtkSalGraphics& mrParent;
 
 public:
-    explicit SvpCairoTextRender(SvpSalGraphics& rParent);
+    explicit GtkCairoTextRender(GtkSalGraphics& 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 7c25774..a1927e4 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 SvpCairoTextRender(*this));
+    m_xTextRenderImpl.reset(new GtkCairoTextRender(*this));
 
     if(style_loaded)
         return;
@@ -2124,6 +2124,11 @@ 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