Kaydet (Commit) 5730388b authored tarafından Caolán McNamara's avatar Caolán McNamara

undo cairo use in svp for now

seeing as its unavailable for android at the moment

Change-Id: Idc4dfd01224a2b90eacce0efd2d1b8a75001d085
üst da05c05e
...@@ -623,7 +623,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\ ...@@ -623,7 +623,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\
)) ))
$(eval $(call gb_Library_use_externals,vcl,\ $(eval $(call gb_Library_use_externals,vcl,\
cairo \
freetype \ freetype \
)) ))
ifneq ($(OS),EMSCRIPTEN) ifneq ($(OS),EMSCRIPTEN)
...@@ -654,7 +653,6 @@ $(eval $(call gb_Library_use_static_libraries,vcl,\ ...@@ -654,7 +653,6 @@ $(eval $(call gb_Library_use_static_libraries,vcl,\
)) ))
$(eval $(call gb_Library_use_externals,vcl,\ $(eval $(call gb_Library_use_externals,vcl,\
cairo \
fontconfig \ fontconfig \
freetype \ freetype \
expat \ expat \
......
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basebmp/scanlineformats.hxx> #include <basebmp/scanlineformats.hxx>
#if ENABLE_CAIRO_CANVAS
#include <cairo.h> #include <cairo.h>
#endif
#if OSL_DEBUG_LEVEL > 2 #if OSL_DEBUG_LEVEL > 2
#include <basebmp/debug.hxx> #include <basebmp/debug.hxx>
...@@ -93,6 +95,8 @@ bool SvpSalGraphics::drawTransformedBitmap( ...@@ -93,6 +95,8 @@ bool SvpSalGraphics::drawTransformedBitmap(
return false; return false;
} }
#if ENABLE_CAIRO_CANVAS
namespace namespace
{ {
bool isCairoCompatible(const basebmp::BitmapDeviceSharedPtr &rBuffer) bool isCairoCompatible(const basebmp::BitmapDeviceSharedPtr &rBuffer)
...@@ -130,15 +134,18 @@ void SvpSalGraphics::clipRegion(cairo_t* cr) ...@@ -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 SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
{ {
bool bRet = false; bool bRet = false;
(void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency; (void)nX; (void)nY; (void)nWidth; (void)nHeight; (void)nTransparency;
#if ENABLE_CAIRO_CANVAS
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0) #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 10, 0)
if (m_bUseLineColor || !m_bUseFillColor) if (m_bUseLineColor || !m_bUseFillColor)
return bRet; return bRet;
cairo_t* cr = getCairoContext(); cairo_t* cr = createCairoContext(m_aDevice);
if (!cr) if (!cr)
return bRet; return bRet;
...@@ -187,6 +194,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, ...@@ -187,6 +194,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
extents.y + extents.height)); extents.y + extents.height));
} }
bRet = true; bRet = true;
#endif
#endif #endif
return bRet; return bRet;
} }
...@@ -809,6 +817,8 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong ) ...@@ -809,6 +817,8 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
return false; return false;
} }
#if ENABLE_CAIRO_CANVAS
cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr &rBuffer) cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr &rBuffer)
{ {
if (!isCairoCompatible(rBuffer)) if (!isCairoCompatible(rBuffer))
...@@ -828,12 +838,6 @@ cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr ...@@ -828,12 +838,6 @@ cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr
return cr; return cr;
} }
cairo_t* SvpSalGraphics::getCairoContext() const
{
return SvpSalGraphics::createCairoContext(m_aOrigDevice);
}
#if ENABLE_CAIRO_CANVAS
bool SvpSalGraphics::SupportsCairo() const bool SvpSalGraphics::SupportsCairo() const
{ {
return false; return false;
...@@ -870,9 +874,14 @@ SystemGraphicsData SvpSalGraphics::GetGraphicsData() const ...@@ -870,9 +874,14 @@ SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const bool SvpSalGraphics::supportsOperation(OutDevSupportType eType) const
{ {
#if ENABLE_CAIRO_CANVAS
return m_aDrawMode != basebmp::DrawMode::XOR && return m_aDrawMode != basebmp::DrawMode::XOR &&
OutDevSupport_TransparentRect == eType && OutDevSupport_TransparentRect == eType &&
isCairoCompatible(m_aDevice); isCairoCompatible(m_aDevice);
#else
(void)eType;
return false;
#endif
} }
#endif #endif
......
...@@ -202,12 +202,13 @@ public: ...@@ -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 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 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 css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const override;
virtual SystemFontData GetSysFontData( int nFallbacklevel ) 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); static cairo_t* createCairoContext(const basebmp::BitmapDeviceSharedPtr& rBuffer);
void clipRegion(cairo_t* cr); void clipRegion(cairo_t* cr);
#endif // ENABLE_CAIRO_CANVAS
}; };
#endif #endif
......
...@@ -59,6 +59,8 @@ public: ...@@ -59,6 +59,8 @@ public:
static void refreshFontconfig( GtkSettings *pSettings ); static void refreshFontconfig( GtkSettings *pSettings );
static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer ); static void signalSettingsNotify( GObject*, GParamSpec *pSpec, gpointer );
cairo_t* getCairoContext() const;
virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override; virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override;
private: private:
GtkWidget *mpWindow; GtkWidget *mpWindow;
......
...@@ -8,35 +8,34 @@ ...@@ -8,35 +8,34 @@
*/ */
#include "gtk3cairotextrender.hxx" #include "gtk3cairotextrender.hxx"
#include "headless/svpgdi.hxx"
SvpCairoTextRender::SvpCairoTextRender(SvpSalGraphics& rParent) GtkCairoTextRender::GtkCairoTextRender(GtkSalGraphics& rParent)
: mrParent(rParent) : mrParent(rParent)
{ {
} }
GlyphCache& SvpCairoTextRender::getPlatformGlyphCache() GlyphCache& GtkCairoTextRender::getPlatformGlyphCache()
{ {
return SvpSalGraphics::getPlatformGlyphCache(); return SvpSalGraphics::getPlatformGlyphCache();
} }
cairo_t* SvpCairoTextRender::getCairoContext() cairo_t* GtkCairoTextRender::getCairoContext()
{ {
return mrParent.getCairoContext(); return mrParent.getCairoContext();
} }
void SvpCairoTextRender::getSurfaceOffset(double& nDX, double& nDY) void GtkCairoTextRender::getSurfaceOffset(double& nDX, double& nDY)
{ {
nDX = 0; nDX = 0;
nDY = 0; nDY = 0;
} }
void SvpCairoTextRender::clipRegion(cairo_t* cr) void GtkCairoTextRender::clipRegion(cairo_t* cr)
{ {
mrParent.clipRegion(cr); mrParent.clipRegion(cr);
} }
void SvpCairoTextRender::drawSurface(cairo_t* /*cr*/) void GtkCairoTextRender::drawSurface(cairo_t* /*cr*/)
{ {
} }
......
...@@ -11,16 +11,15 @@ ...@@ -11,16 +11,15 @@
#define INCLUDED_VCL_UNX_GTK3_GDI_GTK3CAIROTEXTRENDER_HXX #define INCLUDED_VCL_UNX_GTK3_GDI_GTK3CAIROTEXTRENDER_HXX
#include "cairotextrender.hxx" #include "cairotextrender.hxx"
#include <unx/gtk/gtkgdi.hxx>
class SvpSalGraphics; class GtkCairoTextRender : public CairoTextRender
class SvpCairoTextRender : public CairoTextRender
{ {
protected: protected:
SvpSalGraphics& mrParent; GtkSalGraphics& mrParent;
public: public:
explicit SvpCairoTextRender(SvpSalGraphics& rParent); explicit GtkCairoTextRender(GtkSalGraphics& rParent);
virtual GlyphCache& getPlatformGlyphCache() override; virtual GlyphCache& getPlatformGlyphCache() override;
virtual cairo_t* getCairoContext() override; virtual cairo_t* getCairoContext() override;
......
...@@ -1999,7 +1999,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) ...@@ -1999,7 +1999,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
mpFrame( pFrame ), mpFrame( pFrame ),
mpWindow( pWindow ) mpWindow( pWindow )
{ {
m_xTextRenderImpl.reset(new SvpCairoTextRender(*this)); m_xTextRenderImpl.reset(new GtkCairoTextRender(*this));
if(style_loaded) if(style_loaded)
return; return;
...@@ -2124,6 +2124,11 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) ...@@ -2124,6 +2124,11 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
gtk_widget_show_all(gDumbContainer); gtk_widget_show_all(gDumbContainer);
} }
cairo_t* GtkSalGraphics::getCairoContext() const
{
return mpFrame->getCairoContext();
}
void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
{ {
char* pForceDpi; char* pForceDpi;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment