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

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 11:16:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 72ed0d8c3a602d5b99532c07176bab70b6c35a48
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 15:50:08 2010 +0000

    2010-07-16  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Antonio Gomes.
    
            [Qt] Path: Avoid creating a new GraphicsContext in strokeContains() and strokeBoundingRect()
            https://bugs.webkit.org/show_bug.cgi?id=42456
    
            * platform/graphics/qt/PathQt.cpp:
            (WebCore::scratchContext): Added, provides a scratch GraphicsContext.
            (WebCore::Path::strokeContains): Use the scratch context instead
            of creating a new GraphicsContext.
            (WebCore::Path::strokeBoundingRect): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63552 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 77d216e..6f3ffbd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-16  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Antonio Gomes.
+
+        [Qt] Path: Avoid creating a new GraphicsContext in strokeContains() and strokeBoundingRect()
+        https://bugs.webkit.org/show_bug.cgi?id=42456
+
+        * platform/graphics/qt/PathQt.cpp:
+        (WebCore::scratchContext): Added, provides a scratch GraphicsContext.
+        (WebCore::Path::strokeContains): Use the scratch context instead
+        of creating a new GraphicsContext.
+        (WebCore::Path::strokeBoundingRect): Ditto.
+
 2010-07-16  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index a367212..d296e29 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -121,15 +121,18 @@ bool Path::contains(const FloatPoint& point, WindRule rule) const
     return contains;
 }
 
+static GraphicsContext* scratchContext()
+{
+    static ImageBuffer* scratch = ImageBuffer::create(IntSize(1, 1)).leakPtr();
+    return scratch->context();
+}
+
 bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
 {
     ASSERT(applier);
 
-    // FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
-    // on each call.
-    OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
-    GraphicsContext* gc = scratchImage->context();
     QPainterPathStroker stroke;
+    GraphicsContext* gc = scratchContext();
     applier->strokeStyle(gc);
 
     QPen pen = gc->pen();
@@ -157,10 +160,7 @@ FloatRect Path::boundingRect() const
 
 FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
 {
-    // FIXME: We should try to use a 'shared Context' instead of creating a new ImageBuffer
-    // on each call.
-    OwnPtr<ImageBuffer> scratchImage = ImageBuffer::create(IntSize(1, 1));
-    GraphicsContext* gc = scratchImage->context();
+    GraphicsContext* gc = scratchContext();
     QPainterPathStroker stroke;
     if (applier) {
         applier->strokeStyle(gc);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list