+wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& dc )
+: wxGraphicsContext(renderer)
+{
+#ifdef __WXGTK20__
+ wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
+ Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
+
+#if 0
+ wxGraphicsMatrix matrix = CreateMatrix();
+
+ wxPoint org = dc.GetDeviceOrigin();
+ matrix.Translate( org.x, org.y );
+
+ org = dc.GetLogicalOrigin();
+ matrix.Translate( -org.x, -org.y );
+
+ double sx,sy;
+ dc.GetUserScale( &sx, &sy );
+ matrix.Scale( sx, sy );
+
+ ConcatTransform( matrix );
+#endif
+#endif
+
+#ifdef __WXMAC__
+ int width, height;
+ dc.GetSize( &width, &height );
+ CGContextRef cgcontext = (CGContextRef)dc.GetWindow()->MacGetCGContextRef();
+ cairo_surface_t* surface = cairo_quartz_surface_create_for_cg_context(cgcontext, width, height);
+ Init( cairo_create( surface ) );
+ cairo_surface_destroy( surface );
+#endif
+}
+
+#ifdef __WXGTK20__