]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/graphicc.cpp
Correctly determine best wxPropertyGrid width.
[wxWidgets.git] / src / generic / graphicc.cpp
index af0031b53661348b821afd5c84a55c9ef295d3f5..d2a9ab089f0fdc4bd2d09af78b338dc42087aa05 100644 (file)
@@ -1018,7 +1018,6 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm
 {
     wxCHECK_RET( bmp.IsOk(), wxT("Invalid bitmap in wxCairoContext::DrawBitmap"));
 
-    cairo_surface_t* surface;
     int bw = bmp.GetWidth();
     int bh = bmp.GetHeight();
     wxBitmap bmpSource = bmp;  // we need a non-const instance
@@ -1085,12 +1084,17 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm
             p.OffsetY(pixData, 1);
         }
     }
+    m_pattern = cairo_pattern_create_for_surface(m_surface);
 }
 
 wxCairoBitmapData::~wxCairoBitmapData()
 {
-    cairo_pattern_destroy(m_pattern);
-    cairo_surface_destroy(m_surface);
+    if (m_pattern)
+        cairo_pattern_destroy(m_pattern);
+    
+    if (m_surface)
+        cairo_surface_destroy(m_surface);
+    
     delete [] m_buffer;
 }
 
@@ -1875,7 +1879,12 @@ wxGraphicsBitmap wxCairoRenderer::CreateBitmap( const wxBitmap& bmp )
         return wxNullGraphicsBitmap;
 }
 
-wxGraphicsBitmap wxCairoRenderer::CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h  )
+wxGraphicsBitmap
+wxCairoRenderer::CreateSubBitmap(const wxGraphicsBitmap& WXUNUSED(bitmap),
+                                 wxDouble WXUNUSED(x),
+                                 wxDouble WXUNUSED(y),
+                                 wxDouble WXUNUSED(w),
+                                 wxDouble WXUNUSED(h))
 {
     wxFAIL_MSG("wxCairoRenderer::CreateSubBitmap is not implemented.");
     return wxNullGraphicsBitmap;