2007-08-25 Jasper Bryant-Greene <m@ni.ac.nz>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 12:35:44 +0000 (12:35 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 25 Aug 2007 12:35:44 +0000 (12:35 +0000)
        Reviewed by Oliver Hunt.

        Set paintingDisabled to true in Cairo's GraphicsContext constructor
        when passed a null PlatformGraphicsContext.

        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::GraphicsContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

index fdb093dbd0763250077348d0ad2a6019ade9487d..27a0410179e465012ce0aa9f7e2a2ec3d93e2f45 100644 (file)
@@ -1,3 +1,13 @@
+2007-08-25  Jasper Bryant-Greene  <m@ni.ac.nz>
+
+        Reviewed by Oliver Hunt.
+
+        Set paintingDisabled to true in Cairo's GraphicsContext constructor
+        when passed a null PlatformGraphicsContext.
+
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+
 2007-08-25  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
index 65125e0ef7fe7d59788efba966b4139c038075db..c225d7b5cb7677ce8e9c6b42afeb3e94856920d7 100644 (file)
@@ -103,8 +103,13 @@ GraphicsContext::GraphicsContext(HDC dc)
     : m_common(createGraphicsContextPrivate())
     , m_data(new GraphicsContextPlatformPrivate)
 {
-    cairo_surface_t* surface = cairo_win32_surface_create(dc);
-    m_data->cr = cairo_create(surface);
+    if (dc) {
+        cairo_surface_t* surface = cairo_win32_surface_create(dc);
+        m_data->cr = cairo_create(surface);
+    } else {
+        setPaintingDisabled(true);
+        m_data->cr = 0;
+    }
 }
 #endif
 
@@ -113,6 +118,7 @@ GraphicsContext::GraphicsContext(PlatformGraphicsContext* cr)
     , m_data(new GraphicsContextPlatformPrivate)
 {
     m_data->cr = cairo_reference(cr);
+    setPaintingDisabled(!cr);
 }
 
 GraphicsContext::~GraphicsContext()