- wxMemoryDC* mdc = wxDynamicCast(&dc, wxMemoryDC);
- if ( mdc )
- {
- return new wxMacCoreGraphicsContext(this,
- (CGContextRef)mdc->GetGraphicsContext()->GetNativeContext());
- }
- else
- {
- return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() );
- }
+ const wxDCImpl* impl = dc.GetImpl();
+ wxWindowDCImpl *win_impl = wxDynamicCast( impl, wxWindowDCImpl );
+ if (win_impl)
+ return new wxMacCoreGraphicsContext( this,
+ (CGContextRef)(win_impl->GetWindow()->MacGetCGContextRef()) );
+
+ return NULL;
+}
+
+wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxMemoryDC& dc )
+{
+ const wxDCImpl* impl = dc.GetImpl();
+ wxMemoryDCImpl *mem_impl = wxDynamicCast( impl, wxMemoryDCImpl );
+ if (mem_impl)
+ return new wxMacCoreGraphicsContext( this,
+ (CGContextRef)(mem_impl->GetGraphicsContext()->GetNativeContext()) );
+
+ return NULL;