[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:38:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c59be67d5f663867e18e2143a7425a6b66077260
Author: alex at webkit.org <alex at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 22 08:23:20 2010 +0000

    2010-09-22  Alejandro G. Castro  <alex at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [gtk] Use the smart pointers to handle cairo_path_t
            https://bugs.webkit.org/show_bug.cgi?id=46212
    
            Modified the code to use smart pointers with cairo_path_t
            variables.
    
            * platform/graphics/cairo/GraphicsContextCairo.cpp:
            (WebCore::appendPathToCairoContext):
            (WebCore::GraphicsContext::clip):
            (WebCore::GraphicsContext::drawTiledShadow):
            * platform/graphics/cairo/PathCairo.cpp:
            (WebCore::Path::Path):
            (WebCore::Path::operator=):
            (WebCore::Path::apply):
            (WebCore::Path::debugString):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e669712..bb2dbcd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-09-22  Alejandro G. Castro  <alex at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [gtk] Use the smart pointers to handle cairo_path_t
+        https://bugs.webkit.org/show_bug.cgi?id=46212
+
+        Modified the code to use smart pointers with cairo_path_t
+        variables.
+
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::appendPathToCairoContext):
+        (WebCore::GraphicsContext::clip):
+        (WebCore::GraphicsContext::drawTiledShadow):
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::Path):
+        (WebCore::Path::operator=):
+        (WebCore::Path::apply):
+        (WebCore::Path::debugString):
+
 2010-09-22  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Kent Tamura.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 4174892..05096a9 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -134,9 +134,8 @@ static inline void fillRectSourceOver(cairo_t* cr, const FloatRect& rect, const
 
 static void appendPathToCairoContext(cairo_t* to, cairo_t* from)
 {
-    cairo_path_t* cairoPath = cairo_copy_path(from);
-    cairo_append_path(to, cairoPath);
-    cairo_path_destroy(cairoPath);
+    OwnPtr<cairo_path_t> cairoPath(cairo_copy_path(from));
+    cairo_append_path(to, cairoPath.get());
 }
 
 // We apply the pending path built via addPath to the Cairo context
@@ -1166,9 +1165,8 @@ void GraphicsContext::clip(const Path& path)
         return;
 
     cairo_t* cr = m_data->cr;
-    cairo_path_t* p = cairo_copy_path(path.platformPath()->context());
-    cairo_append_path(cr, p);
-    cairo_path_destroy(p);
+    OwnPtr<cairo_path_t> p(cairo_copy_path(path.platformPath()->context()));
+    cairo_append_path(cr, p.get());
     cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
     cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
     cairo_clip(cr);
@@ -1325,9 +1323,8 @@ void GraphicsContext::drawTiledShadow(const IntRect& rect, const FloatSize& topL
         copyContextProperties(cr, shadowContext);
         cairo_translate(shadowContext, -rect.x() + blurRadius, -rect.y() + blurRadius);
         cairo_new_path(shadowContext);
-        cairo_path_t* path = cairo_copy_path(cr);
-        cairo_append_path(shadowContext, path);
-        cairo_path_destroy(path);
+        OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
+        cairo_append_path(shadowContext, path.get());
 
         setPlatformFill(this, shadowContext, m_common);
 
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index 05c6952..06dd313 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -52,9 +52,8 @@ Path::Path(const Path& other)
     : m_path(new CairoPath())
 {
     cairo_t* cr = platformPath()->context();
-    cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
-    cairo_append_path(cr, p);
-    cairo_path_destroy(p);
+    OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
+    cairo_append_path(cr, p.get());
 }
 
 Path& Path::operator=(const Path& other)
@@ -64,9 +63,8 @@ Path& Path::operator=(const Path& other)
 
     clear();
     cairo_t* cr = platformPath()->context();
-    cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
-    cairo_append_path(cr, p);
-    cairo_path_destroy(p);
+    OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
+    cairo_append_path(cr, p.get());
     return *this;
 }
 
@@ -297,7 +295,7 @@ bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point)
 void Path::apply(void* info, PathApplierFunction function) const
 {
     cairo_t* cr = platformPath()->context();
-    cairo_path_t* path = cairo_copy_path(cr);
+    OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
     cairo_path_data_t* data;
     PathElement pelement;
     FloatPoint points[3];
@@ -329,7 +327,6 @@ void Path::apply(void* info, PathApplierFunction function) const
             break;
         }
     }
-    cairo_path_destroy(path);
 }
 
 void Path::transform(const AffineTransform& trans)
@@ -346,7 +343,7 @@ String Path::debugString() const
         return String();
 
     String pathString;
-    cairo_path_t* path = cairo_copy_path(platformPath()->context());
+    OwnPtr<cairo_path_t> path(cairo_copy_path(platformPath()->context()));
     cairo_path_data_t* data;
 
     for (int i = 0; i < path->num_data; i += path->data[i].header.length) {
@@ -373,7 +370,6 @@ String Path::debugString() const
         }
     }
 
-    cairo_path_destroy(path);
     return pathString.simplifyWhiteSpace();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list