From: Václav Slavík Date: Sun, 21 Sep 2008 09:42:49 +0000 (+0000) Subject: route all Cairo calls in GTK printing code through gs_cairo (is this still needed?) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fc2bb342ec223d558682385992f3715e6f092672 route all Cairo calls in GTK printing code through gs_cairo (is this still needed?) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cairo.h b/include/wx/cairo.h index 7133656190..acb961c83f 100644 --- a/include/wx/cairo.h +++ b/include/wx/cairo.h @@ -102,6 +102,8 @@ public: (cairo_pattern_t *pattern, cairo_filter_t filter), (pattern, filter) ) wxDL_VOIDMETHOD_DEFINE( cairo_rectangle, (cairo_t *cr, double x, double y, double width, double height), (cr, x, y, width, height) ) + wxDL_METHOD_DEFINE( cairo_t*, cairo_reference, + (cairo_t *cr), (cr), NULL ) wxDL_VOIDMETHOD_DEFINE( cairo_reset_clip, (cairo_t *cr), (cr) ) wxDL_VOIDMETHOD_DEFINE( cairo_restore, diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 62c47203f5..5be92542a8 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -1177,7 +1177,7 @@ bool wxGtkPrinterDCImpl::IsOk() const void* wxGtkPrinterDCImpl::GetCairoContext() const { - return (void*) cairo_reference( m_cairo ); + return (void*) gs_cairo->cairo_reference( m_cairo ); } bool wxGtkPrinterDCImpl::DoFloodFill(wxCoord WXUNUSED(x1), @@ -1746,11 +1746,11 @@ void wxGtkPrinterDCImpl::DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoor // Scale the image cairo_filter_t filter = CAIRO_FILTER_BILINEAR; - cairo_pattern_t* pattern = cairo_pattern_create_for_surface(surface); - cairo_pattern_set_filter(pattern,filter); + cairo_pattern_t* pattern = gs_cairo->cairo_pattern_create_for_surface(surface); + gs_cairo->cairo_pattern_set_filter(pattern,filter); wxDouble scaleX = (wxDouble) XLOG2DEVREL(bw) / (wxDouble) bw; wxDouble scaleY = (wxDouble) YLOG2DEVREL(bh) / (wxDouble) bh; - cairo_scale(m_cairo, scaleX, scaleY); + gs_cairo->cairo_scale(m_cairo, scaleX, scaleY); gs_cairo->cairo_set_source(m_cairo, pattern); // Use the original size here since the context is scaled already.