Changeset 53343 in webkit
- Timestamp:
- Jan 15, 2010 12:54:37 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53342 r53343 1 2010-01-15 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Dirk Schulze. 4 5 Bad DOM performance in large SVG files 6 https://bugs.webkit.org/show_bug.cgi?id=30055 7 8 Add an early return when we go to paint a RenderPath that 9 isn't in the current clip. 10 11 * rendering/RenderPath.cpp: 12 (WebCore::RenderPath::paint): 13 * svg/graphics/SVGImage.cpp: 14 (WebCore::SVGImage::draw): 15 1 16 2010-01-15 Steve Block <steveblock@google.com> 2 17 -
trunk/WebCore/rendering/RenderPath.cpp
r53334 r53343 216 216 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty()) 217 217 return; 218 219 paintInfo.context->save(); 220 paintInfo.context->concatCTM(localToParentTransform()); 218 219 PaintInfo childPaintInfo(paintInfo); 220 childPaintInfo.context->save(); 221 applyTransformToPaintInfo(childPaintInfo, m_localTransform); 222 FloatRect boundingBox = repaintRectInLocalCoordinates(); 223 // FIXME: The empty rect check is to deal with incorrect initial clip in renderSubtreeToImage 224 // unfortunately fixing that problem is fairly complex unless we were willing to just futz the 225 // rect to something "close enough" 226 if (!boundingBox.intersects(childPaintInfo.rect) && !childPaintInfo.rect.isEmpty()) { 227 childPaintInfo.context->restore(); 228 return; 229 } 221 230 222 231 SVGResourceFilter* filter = 0; 223 232 224 FloatRect boundingBox = repaintRectInLocalCoordinates(); 225 if (paintInfo.phase == PaintPhaseForeground) { 226 PaintInfo savedInfo(paintInfo); 227 228 if (prepareToRenderSVGContent(this, paintInfo, boundingBox, filter)) { 233 if (childPaintInfo.phase == PaintPhaseForeground) { 234 PaintInfo savedInfo(childPaintInfo); 235 236 if (prepareToRenderSVGContent(this, childPaintInfo, boundingBox, filter)) { 229 237 if (style()->svgStyle()->shapeRendering() == SR_CRISPEDGES) 230 paintInfo.context->setShouldAntialias(false);231 fillAndStrokePath(m_path, paintInfo.context, style(), this);238 childPaintInfo.context->setShouldAntialias(false); 239 fillAndStrokePath(m_path, childPaintInfo.context, style(), this); 232 240 233 241 if (static_cast<SVGStyledElement*>(node())->supportsMarkers()) 234 m_markerLayoutInfo.drawMarkers( paintInfo);242 m_markerLayoutInfo.drawMarkers(childPaintInfo); 235 243 } 236 finishRenderSVGContent(this, paintInfo, filter, savedInfo.context);237 } 238 239 if (( paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())240 paintOutline( paintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),244 finishRenderSVGContent(this, childPaintInfo, filter, savedInfo.context); 245 } 246 247 if ((childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth()) 248 paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()), 241 249 static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()), style()); 242 250 243 paintInfo.context->restore();251 childPaintInfo.context->restore(); 244 252 } 245 253 -
trunk/WebCore/svg/graphics/SVGImage.cpp
r52448 r53343 194 194 if (view->needsLayout()) 195 195 view->layout(); 196 view->paint(context, enclosingIntRect(srcRect));196 view->paint(context, IntRect(0, 0, view->width(), view->height())); 197 197 198 198 if (compositeOp != CompositeSourceOver)
Note: See TracChangeset
for help on using the changeset viewer.