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,\
))
$(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 \
......
......@@ -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;
......@@ -187,6 +194,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight,
extents.y + extents.height));
}
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
......
......@@ -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
......
......@@ -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;
......
......@@ -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*/)
{
}
......
......@@ -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;
......
......@@ -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;
......
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