]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcgraph.cpp
Allow creating wxGraphicsBitmap and wxGraphicsContext from wxImage.
[wxWidgets.git] / src / common / dcgraph.cpp
index 1f7295a12ec61804252379364e95f12f54f0fee9..1f08538f85fa5436a4dec403e0215e95a0d2dc83 100644 (file)
@@ -121,6 +121,12 @@ wxGCDC::wxGCDC(const wxEnhMetaFileDC& dc)
 }
 #endif
 
+wxGCDC::wxGCDC(wxGraphicsContext* context) :
+    wxDC( new wxGCDCImpl( this ) )
+{
+    SetGraphicsContext(context);
+}
+
 wxGCDC::wxGCDC() :
   wxDC( new wxGCDCImpl( this ) )
 {
@@ -181,13 +187,7 @@ wxGCDCImpl::wxGCDCImpl( wxDC *owner, const wxMemoryDC& dc ) :
 {
     Init();
     wxGraphicsContext* context;
-#if wxUSE_CAIRO
-    wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetCairoRenderer();
-    context = renderer->CreateContext(dc);
-#else
     context = wxGraphicsContext::Create(dc);
-#endif
-
     SetGraphicsContext( context );
 }