]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dc.cpp
missing commit
[wxWidgets.git] / src / gtk / dc.cpp
index de3eb8005d55db63d7cd22eb573d0e6eb3fc9145..52abd3b2bea78827c2aa6709ed3ddb3d9c9d1ff0 100644 (file)
@@ -28,8 +28,15 @@ wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner)
     m_height = 0;
 }
 
+wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner, int)
+    : base_type(owner, 0)
+{
+    m_width = 0;
+    m_height = 0;
+}
+
 wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner, wxWindow* window)
-    : base_type(owner)
+    : base_type(owner, 0)
 {
     m_window = window;
     m_font = window->GetFont();
@@ -147,7 +154,7 @@ bool wxGTKCairoDCImpl::DoStretchBlit(int xdest, int ydest, int dstWidth, int dst
         {
             wxMask* mask = bitmap.GetMask();
             if (mask)
-                maskSurf = mask->GetBitmap();
+                maskSurf = *mask;
         }
     }
     if (maskSurf)
@@ -219,6 +226,8 @@ wxWindowDCImpl::wxWindowDCImpl(wxWindowDC* owner, wxWindow* window)
         if (x || y)
             SetDeviceLocalOrigin(x, y);
     }
+    else
+        SetGraphicsContext(wxGraphicsContext::Create());
 }
 //-----------------------------------------------------------------------------
 
@@ -255,13 +264,7 @@ wxClientDCImpl::wxClientDCImpl(wxClientDC* owner, wxWindow* window)
         }
     }
     else
-    {
-        // create something that can be used for measuring, but not drawing
-        cairo_t* cr = gdk_cairo_create(gdk_get_default_root_window());
-        cairo_rectangle(cr, 0, 0, 0, 0);
-        cairo_clip(cr);
-        SetGraphicsContext(wxGraphicsContext::CreateFromNative(cr));
-    }
+        SetGraphicsContext(wxGraphicsContext::Create());
 }
 //-----------------------------------------------------------------------------
 
@@ -279,7 +282,7 @@ wxPaintDCImpl::wxPaintDCImpl(wxPaintDC* owner, wxWindow* window)
 //-----------------------------------------------------------------------------
 
 wxScreenDCImpl::wxScreenDCImpl(wxScreenDC* owner)
-    : base_type(owner)
+    : base_type(owner, 0)
 {
     GdkWindow* window = gdk_get_default_root_window();
     m_width = gdk_window_get_width(window);
@@ -296,7 +299,7 @@ wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC* owner)
 }
 
 wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC* owner, wxBitmap& bitmap)
-    : base_type(owner)
+    : base_type(owner, 0)
     , m_bitmap(bitmap)
 {
     Setup();
@@ -345,7 +348,7 @@ void wxMemoryDCImpl::Setup()
 //-----------------------------------------------------------------------------
 
 wxGTKCairoDC::wxGTKCairoDC(cairo_t* cr)
-    : base_type(new wxGTKCairoDCImpl(this))
+    : base_type(new wxGTKCairoDCImpl(this, 0))
 {
     cairo_reference(cr);
     SetGraphicsContext(wxGraphicsContext::CreateFromNative(cr));