Changeset 53057 in webkit


Ignore:
Timestamp:
Jan 10, 2010 6:59:02 PM (14 years ago)
Author:
oliver@apple.com
Message:

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.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53056 r53057  
     12010-01-10  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Nikolas Zimmerman.
     4
     5        Bad DOM performance in large SVG files
     6        https://bugs.webkit.org/show_bug.cgi?id=30055
     7
     8        Cull RenderPaths before passing on to the underlying graphics system.
     9
     10        * rendering/RenderPath.cpp:
     11        (WebCore::RenderPath::paint):
     12        (WebCore::RenderPath::nodeAtFloatPoint):
     13
    1142010-01-10  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebCore/rendering/RenderPath.cpp

    r52930 r53057  
    215215    if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty())
    216216        return;
    217            
    218     paintInfo.context->save();
    219     paintInfo.context->concatCTM(localToParentTransform());
     217    PaintInfo childPaintInfo(paintInfo);
     218    childPaintInfo.context->save();
     219    applyTransformToPaintInfo(childPaintInfo, m_localTransform);
     220    FloatRect boundingBox = repaintRectInLocalCoordinates();
     221    if (!boundingBox.intersects(childPaintInfo.rect)) {
     222        childPaintInfo.context->restore();
     223        return;
     224    }
    220225
    221226    SVGResourceFilter* filter = 0;
    222227
    223     FloatRect boundingBox = repaintRectInLocalCoordinates();
    224     if (paintInfo.phase == PaintPhaseForeground) {
    225         PaintInfo savedInfo(paintInfo);
    226 
    227         if (prepareToRenderSVGContent(this, paintInfo, boundingBox, filter)) {
     228    if (childPaintInfo.phase == PaintPhaseForeground) {
     229        PaintInfo savedInfo(childPaintInfo);
     230
     231        if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) {
    228232            if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES)
    229                 paintInfo.context->setShouldAntialias(false);
    230             fillAndStrokePath(m_path, paintInfo.context, style(), this);
     233                childPaintInfo.context->setShouldAntialias(false);
     234            fillAndStrokePath(m_path, childPaintInfo.context, style(), this);
    231235
    232236            if (static_cast<SVGStyledElement*>(node())->supportsMarkers())
    233                 m_markerLayoutInfo.drawMarkers(paintInfo);
     237                m_markerLayoutInfo.drawMarkers(childPaintInfo);
    234238        }
    235         finishRenderSVGContent(this, paintInfo, filter, savedInfo.context);
    236     }
    237 
    238     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
    239         paintOutline(paintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
     239        finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context);
     240    }
     241
     242    if ((childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
     243        paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
    240244            static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style());
    241245   
    242     paintInfo.context->restore();
     246    childPaintInfo.context->restore();
    243247}
    244248
     
    258262        return false;
    259263
    260     FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
     264    FloatPoint localPoint = m_localTransform.inverse().mapPoint(pointInParent);
    261265
    262266    PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, style()->pointerEvents());
Note: See TracChangeset for help on using the changeset viewer.