[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

alex at webkit.org alex at webkit.org
Wed Dec 22 13:22:55 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b38aa83b7f1cc9a6e3a30a810c6245f334d8d8e6
Author: alex at webkit.org <alex at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 13 18:34:22 2010 +0000

    2010-09-13  Alejandro G. Castro  <alex at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [GTK] Leak in the GraphicsContextCairo drawPathShadow
            https://bugs.webkit.org/show_bug.cgi?id=44959
    
            Fix a leak of the cairo_path.
    
            * platform/graphics/cairo/GraphicsContextCairo.cpp:
            (WebCore::drawPathShadow):
            * platform/graphics/cairo/OwnPtrCairo.cpp:
            (WTF::cairo_path_t):
            * platform/graphics/cairo/OwnPtrCairo.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67398 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d5d88b2..40cbc5c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-13  Alejandro G. Castro  <alex at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Leak in the GraphicsContextCairo drawPathShadow
+        https://bugs.webkit.org/show_bug.cgi?id=44959
+
+        Fix a leak of the cairo_path.
+
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::drawPathShadow):
+        * platform/graphics/cairo/OwnPtrCairo.cpp:
+        (WTF::cairo_path_t):
+        * platform/graphics/cairo/OwnPtrCairo.h:
+
 2010-09-13  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 283e75a..276465b 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -38,6 +38,7 @@
 #include "FEGaussianBlur.h"
 #include "FloatRect.h"
 #include "Font.h"
+#include "OwnPtrCairo.h"
 #include "ImageBuffer.h"
 #include "ImageBufferFilter.h"
 #include "IntRect.h"
@@ -201,7 +202,6 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
     
     // Calculate filter values to create appropriate shadow.
     cairo_t* cr = context->platformContext();
-    cairo_path_t* path = cairo_copy_path(cr);
     double x0, x1, y0, y1;
     if (strokeShadow)
         cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
@@ -222,7 +222,8 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
     copyContextProperties(cr, shadowContext);
     cairo_translate(shadowContext, -rect.x() + radius, -rect.y() + radius);
     cairo_new_path(shadowContext);
-    cairo_append_path(shadowContext, path);
+    OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
+    cairo_append_path(shadowContext, path.get());
 
     if (fillShadow)
         setPlatformFill(context, shadowContext, gcp);
diff --git a/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp b/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
index 9be8670..75a1f13 100644
--- a/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
+++ b/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp
@@ -47,4 +47,10 @@ template <> void deleteOwnedPtr<FcFontSet>(FcFontSet* ptr)
 }
 #endif
 
+template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t* ptr)
+{
+    if (ptr)
+        cairo_path_destroy(ptr);
+}
+
 } // namespace WTF
diff --git a/WebCore/platform/graphics/cairo/OwnPtrCairo.h b/WebCore/platform/graphics/cairo/OwnPtrCairo.h
index 29f4562..4426b97 100644
--- a/WebCore/platform/graphics/cairo/OwnPtrCairo.h
+++ b/WebCore/platform/graphics/cairo/OwnPtrCairo.h
@@ -28,6 +28,8 @@ typedef struct _FcObjectSet FcObjectSet;
 typedef struct _FcFontSet FcFontSet;
 #endif
 
+typedef struct cairo_path cairo_path_t;
+
 namespace WTF {
 
 #if defined(USE_FREETYPE)
@@ -36,6 +38,8 @@ template <> void deleteOwnedPtr<FcObjectSet>(FcObjectSet*);
 template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*);
 #endif
 
+template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t*);
+
 } // namespace WTF
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list