Kaydet (Commit) 756b2c94 authored tarafından Caolán McNamara's avatar Caolán McNamara

just in case, fallback if not cairo-surface

Change-Id: I5c185f9306f73f787f38566ba5335b5a8f51ee1d
üst 7b4c2d83
...@@ -55,7 +55,7 @@ protected: ...@@ -55,7 +55,7 @@ protected:
public: public:
GlyphCache& getPlatformGlyphCache(); GlyphCache& getPlatformGlyphCache();
void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice); virtual void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice);
void BlendTextColor(const basebmp::Color &rTextColor, const basebmp::BitmapDeviceSharedPtr &rAlphaMask, void BlendTextColor(const basebmp::Color &rTextColor, const basebmp::BitmapDeviceSharedPtr &rAlphaMask,
const basegfx::B2IPoint &rDstPoint); const basegfx::B2IPoint &rDstPoint);
......
...@@ -35,8 +35,10 @@ class GtkSalFrame; ...@@ -35,8 +35,10 @@ class GtkSalFrame;
class GtkSalGraphics : public SvpSalGraphics class GtkSalGraphics : public SvpSalGraphics
{ {
GtkSalFrame *mpFrame; GtkSalFrame *mpFrame;
bool m_bCairoCompatibleSurface;
public: public:
GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ); GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow );
virtual void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice) SAL_OVERRIDE;
virtual void copyArea( long nDestX, long nDestY, virtual void copyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY, long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight, long nSrcWidth, long nSrcHeight,
......
...@@ -1576,6 +1576,20 @@ static void print_update_area (GdkWindow *window, const char *msg) ...@@ -1576,6 +1576,20 @@ static void print_update_area (GdkWindow *window, const char *msg)
print_cairo_region (gdk_window_get_update_area (window), msg); print_cairo_region (gdk_window_get_update_area (window), msg);
} }
void GtkSalGraphics::setDevice(basebmp::BitmapDeviceSharedPtr& rDevice)
{
SvpSalGraphics::setDevice(rDevice);
bool bCairoCompatibleSurface = rDevice->getScanlineFormat() == basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRX;
if (bCairoCompatibleSurface != m_bCairoCompatibleSurface)
{
if (bCairoCompatibleSurface)
m_xTextRenderImpl.reset(new GtkCairoTextRender(*this));
else
m_xTextRenderImpl.reset(new SvpTextRender(*this));
m_bCairoCompatibleSurface = bCairoCompatibleSurface;
}
}
void GtkSalGraphics::copyArea( long nDestX, long nDestY, void GtkSalGraphics::copyArea( long nDestX, long nDestY,
long nSrcX, long nSrcY, long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight, long nSrcWidth, long nSrcHeight,
......
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