[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

oliver at apple.com oliver at apple.com
Thu Apr 8 00:59:33 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 2d951c4d09bd7388af2e39e5b625d995ccbdb5bd
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 11 02:59:02 2010 +0000

    Bad DOM performance in large SVG files
    https://bugs.webkit.org/show_bug.cgi?id=30055
    
    Reviewed by Nikolas Zimmerman
    
    Cull RenderPaths before passing on to the underlying graphics system.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53057 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5b87801..c6dcc5a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-10  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Nikolas Zimmerman.
+
+        Bad DOM performance in large SVG files
+        https://bugs.webkit.org/show_bug.cgi?id=30055
+
+        Cull RenderPaths before passing on to the underlying graphics system.
+
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::paint):
+        (WebCore::RenderPath::nodeAtFloatPoint):
+
 2010-01-10  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index 30cbedf..a2ac331 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -214,32 +214,36 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int)
 {
     if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty())
         return;
-            
-    paintInfo.context->save();
-    paintInfo.context->concatCTM(localToParentTransform());
+    PaintInfo childPaintInfo(paintInfo);
+    childPaintInfo.context->save();
+    applyTransformToPaintInfo(childPaintInfo, m_localTransform);
+    FloatRect boundingBox = repaintRectInLocalCoordinates();
+    if (!boundingBox.intersects(childPaintInfo.rect)) {
+        childPaintInfo.context->restore();
+        return;
+    }
 
     SVGResourceFilter* filter = 0;
 
-    FloatRect boundingBox = repaintRectInLocalCoordinates();
-    if (paintInfo.phase == PaintPhaseForeground) {
-        PaintInfo savedInfo(paintInfo);
+    if (childPaintInfo.phase == PaintPhaseForeground) {
+        PaintInfo savedInfo(childPaintInfo);
 
-        if (prepareToRenderSVGContent(this, paintInfo, boundingBox, filter)) {
+        if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) {
             if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
-                paintInfo.context->setShouldAntialias(false);
-            fillAndStrokePath(m_path, paintInfo.context, style(), this);
+                childPaintInfo.context->setShouldAntialias(false);
+            fillAndStrokePath(m_path, childPaintInfo.context, style(), this);
 
             if (static_cast<SVGStyledElement*>(node())->supportsMarkers())
-                m_markerLayoutInfo.drawMarkers(paintInfo);
+                m_markerLayoutInfo.drawMarkers(childPaintInfo);
         }
-        finishRenderSVGContent(this, paintInfo, filter, savedInfo.context);
+        finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context);
     }
 
-    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
-        paintOutline(paintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
+    if ((childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
+        paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
             static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style());
     
-    paintInfo.context->restore();
+    childPaintInfo.context->restore();
 }
 
 // This method is called from inside paintOutline() since we call paintOutline()
@@ -257,7 +261,7 @@ bool RenderPath::nodeAtFloatPoint(const HitTestRequest&, HitTestResult& result,
     if (hitTestAction != HitTestForeground)
         return false;
 
-    FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
+    FloatPoint localPoint = m_localTransform.inverse().mapPoint(pointInParent);
 
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, style()->pointerEvents());
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list