2008-01-06 Alp Toker <alp@atoker.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 08:48:10 +0000 (08:48 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 08:48:10 +0000 (08:48 +0000)
        Reviewed by Eric.

        Cairo canvas refcounting fix. Reference the surface in the constructor
        to match its destruction in the destructor.

        Fixes a crash triggered by leaving this page:
          http://philip.html5.org/tests/canvas/misc/globalalpha-pattern.html

        * html/CanvasPattern.cpp:
        (WebCore::CanvasPattern::CanvasPattern):

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

WebCore/ChangeLog
WebCore/html/CanvasPattern.cpp

index d70fe5d84aae3fff85319a73df8c245bd1461fcb..f0ec9a36acfcffb99e0018223ce0b9fc60e6e98b 100644 (file)
@@ -1,3 +1,16 @@
+2008-01-06  Alp Toker  <alp@atoker.com>
+
+        Reviewed by Eric.
+
+        Cairo canvas refcounting fix. Reference the surface in the constructor
+        to match its destruction in the destructor.
+
+        Fixes a crash triggered by leaving this page:
+          http://philip.html5.org/tests/canvas/misc/globalalpha-pattern.html
+
+        * html/CanvasPattern.cpp:
+        (WebCore::CanvasPattern::CanvasPattern):
+
 2008-01-06  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Sam.
index 3d17c76df196bf650e07d01206a47580a60c0dbc..950471ea2a44975fabd1d5c26afab02411f64343 100644 (file)
@@ -76,7 +76,7 @@ CanvasPattern::CanvasPattern(CGImageRef image, bool repeatX, bool repeatY)
 #elif PLATFORM(CAIRO)
 
 CanvasPattern::CanvasPattern(cairo_surface_t* surface, bool repeatX, bool repeatY)
-    : m_platformImage(surface)
+    : m_platformImage(cairo_surface_reference(surface))
     , m_cachedImage(0)
     , m_repeatX(repeatX)
     , m_repeatY(repeatY)