From 5ddde30071f639962dd557c453f2ad01f8f0fd00 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Wed, 8 Sep 2010 12:18:00 +0100 Subject: Merge WebKit at r66666 : Initial merge by git. Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f --- WebCore/rendering/RenderPath.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'WebCore/rendering/RenderPath.cpp') diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp index 86a12c8..0f31df1 100644 --- a/WebCore/rendering/RenderPath.cpp +++ b/WebCore/rendering/RenderPath.cpp @@ -101,28 +101,39 @@ void RenderPath::layout() LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout()); SVGStyledTransformableElement* element = static_cast(node()); + bool updateCachedBoundariesInParents = false; + bool needsPathUpdate = m_needsPathUpdate; if (needsPathUpdate) { m_path = element->toPathData(); m_needsPathUpdate = false; + updateCachedBoundariesInParents = true; } if (m_needsTransformUpdate) { m_localTransform = element->animatedLocalTransform(); m_needsTransformUpdate = false; + updateCachedBoundariesInParents = true; } + if (m_needsBoundariesUpdate) + updateCachedBoundariesInParents = true; + // Invalidate all resources of this client if our layout changed. if (m_everHadLayout && selfNeedsLayout()) SVGResourcesCache::clientLayoutChanged(this); // At this point LayoutRepainter already grabbed the old bounds, - // recalculate them now so repaintAfterLayout() uses the new bounds + // recalculate them now so repaintAfterLayout() uses the new bounds. if (needsPathUpdate || m_needsBoundariesUpdate) { updateCachedBoundaries(); m_needsBoundariesUpdate = false; } + // If our bounds changed, notify the parents. + if (updateCachedBoundariesInParents) + RenderSVGModelObject::setNeedsBoundariesUpdate(); + repainter.repaintAfterLayout(); setNeedsLayout(false); } @@ -172,8 +183,7 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); - FloatRect nonLocalBoundingBox = m_localTransform.mapRect(boundingBox); - if (!nonLocalBoundingBox.intersects(paintInfo.rect)) + if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) return; PaintInfo childPaintInfo(paintInfo); @@ -270,13 +280,6 @@ FloatRect RenderPath::calculateMarkerBoundsIfNeeded() return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path); } -void RenderPath::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) -{ - if (diff == StyleDifferenceLayout) - setNeedsBoundariesUpdate(); - RenderSVGModelObject::styleWillChange(diff, newStyle); -} - void RenderPath::updateCachedBoundaries() { if (m_path.isEmpty()) { -- cgit v1.1