From 999150a45a78480b5c3c74e3d65aad5da75cf0c5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:44:36 +0000 Subject: [PATCH] let wxCairoContext could create cairo context correctly under x11 in this constructor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77863 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/graphicc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index ec701a7a47..a42d91da23 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1838,6 +1838,12 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& #endif #endif +#ifdef __WXX11__ + cairo_t* cr = static_cast(dc.GetImpl()->GetCairoContext()); + if ( cr ) + Init(cairo_reference(cr)); +#endif + #ifdef __WXMAC__ CGContextRef cgcontext = (CGContextRef)dc.GetWindow()->MacGetCGContextRef(); cairo_surface_t* surface = cairo_quartz_surface_create_for_cg_context(cgcontext, width, height);