vcl/inc/headless/svpgdi.hxx | 2 +- vcl/inc/unx/gtk/gtkgdi.hxx | 10 ++++++---- vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-)
New commits: commit 756b2c945143ee171ae80c9ba51ef0dd50fab789 Author: Caolán McNamara <[email protected]> Date: Mon Mar 2 15:23:02 2015 +0000 just in case, fallback if not cairo-surface Change-Id: I5c185f9306f73f787f38566ba5335b5a8f51ee1d diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index e9f5110..c45cf0f 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -55,7 +55,7 @@ protected: public: GlyphCache& getPlatformGlyphCache(); - void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice); + virtual void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice); void BlendTextColor(const basebmp::Color &rTextColor, const basebmp::BitmapDeviceSharedPtr &rAlphaMask, const basegfx::B2IPoint &rDstPoint); diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index 2cbe6e0..3bc7ef0 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -35,12 +35,14 @@ class GtkSalFrame; class GtkSalGraphics : public SvpSalGraphics { GtkSalFrame *mpFrame; + bool m_bCairoCompatibleSurface; public: GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ); - virtual void copyArea( long nDestX, long nDestY, - long nSrcX, long nSrcY, - long nSrcWidth, long nSrcHeight, - sal_uInt16 /*nFlags*/ ) SAL_OVERRIDE; + virtual void setDevice(basebmp::BitmapDeviceSharedPtr& rDevice) SAL_OVERRIDE; + virtual void copyArea( long nDestX, long nDestY, + long nSrcX, long nSrcY, + long nSrcWidth, long nSrcHeight, + sal_uInt16 /*nFlags*/ ) SAL_OVERRIDE; virtual bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 774be5a..8ccf2e3 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1576,6 +1576,20 @@ static void print_update_area (GdkWindow *window, const char *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, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight,
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
