| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> | 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> |
| 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
| 10 * Copyright (C) 2011 University of Szeged | 10 * Copyright (C) 2011 University of Szeged |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return shapeDependentStrokeContains(point); | 131 return shapeDependentStrokeContains(point); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void RenderSVGShape::layout() | 134 void RenderSVGShape::layout() |
| 135 { | 135 { |
| 136 bool updateCachedBoundariesInParents = false; | 136 bool updateCachedBoundariesInParents = false; |
| 137 | 137 |
| 138 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { | 138 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { |
| 139 updateShapeFromElement(); | 139 updateShapeFromElement(); |
| 140 m_needsShapeUpdate = false; | 140 m_needsShapeUpdate = false; |
| 141 updateRepaintBoundingBox(); | 141 updatePaintInvalidationBoundingBox(); |
| 142 m_needsBoundariesUpdate = false; | 142 m_needsBoundariesUpdate = false; |
| 143 updateCachedBoundariesInParents = true; | 143 updateCachedBoundariesInParents = true; |
| 144 } | 144 } |
| 145 | 145 |
| 146 if (m_needsTransformUpdate) { | 146 if (m_needsTransformUpdate) { |
| 147 m_localTransform = toSVGGraphicsElement(element())->animatedLocalTransf
orm(); | 147 m_localTransform = toSVGGraphicsElement(element())->animatedLocalTransf
orm(); |
| 148 m_needsTransformUpdate = false; | 148 m_needsTransformUpdate = false; |
| 149 updateCachedBoundariesInParents = true; | 149 updateCachedBoundariesInParents = true; |
| 150 } | 150 } |
| 151 | 151 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) | 231 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) |
| 232 { | 232 { |
| 233 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 233 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
| 234 if (paintInfo.phase != PaintPhaseForeground | 234 if (paintInfo.phase != PaintPhaseForeground |
| 235 || style()->visibility() == HIDDEN | 235 || style()->visibility() == HIDDEN |
| 236 || isShapeEmpty()) | 236 || isShapeEmpty()) |
| 237 return; | 237 return; |
| 238 | 238 |
| 239 FloatRect boundingBox = paintInvalidationRectInLocalCoordinates(); | 239 FloatRect boundingBox = paintInvalidationRectInLocalCoordinates(); |
| 240 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr
ansform, paintInfo)) | 240 if (!SVGRenderSupport::paintInfoIntersectsPaintInvalidationRect(boundingBox,
m_localTransform, paintInfo)) |
| 241 return; | 241 return; |
| 242 | 242 |
| 243 PaintInfo childPaintInfo(paintInfo); | 243 PaintInfo childPaintInfo(paintInfo); |
| 244 | 244 |
| 245 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); | 245 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); |
| 246 childPaintInfo.applyTransform(m_localTransform); | 246 childPaintInfo.applyTransform(m_localTransform); |
| 247 | 247 |
| 248 SVGRenderingContext renderingContext(this, childPaintInfo); | 248 SVGRenderingContext renderingContext(this, childPaintInfo); |
| 249 | 249 |
| 250 if (renderingContext.isRenderingPrepared()) { | 250 if (renderingContext.isRenderingPrepared()) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 strokeBoundingBox.unite(path().strokeBoundingRect(strokeData)); | 391 strokeBoundingBox.unite(path().strokeBoundingRect(strokeData)); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 if (!m_markerPositions.isEmpty()) | 395 if (!m_markerPositions.isEmpty()) |
| 396 strokeBoundingBox.unite(markerRect(strokeWidth())); | 396 strokeBoundingBox.unite(markerRect(strokeWidth())); |
| 397 | 397 |
| 398 return strokeBoundingBox; | 398 return strokeBoundingBox; |
| 399 } | 399 } |
| 400 | 400 |
| 401 void RenderSVGShape::updateRepaintBoundingBox() | 401 void RenderSVGShape::updatePaintInvalidationBoundingBox() |
| 402 { | 402 { |
| 403 m_repaintBoundingBox = strokeBoundingBox(); | 403 m_paintInvalidationBoundingBox = strokeBoundingBox(); |
| 404 if (strokeWidth() < 1.0f && !m_repaintBoundingBox.isEmpty()) | 404 if (strokeWidth() < 1.0f && !m_paintInvalidationBoundingBox.isEmpty()) |
| 405 m_repaintBoundingBox.inflate(1); | 405 m_paintInvalidationBoundingBox.inflate(1); |
| 406 SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingB
ox); | 406 SVGRenderSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); |
| 407 } | 407 } |
| 408 | 408 |
| 409 float RenderSVGShape::strokeWidth() const | 409 float RenderSVGShape::strokeWidth() const |
| 410 { | 410 { |
| 411 SVGLengthContext lengthContext(element()); | 411 SVGLengthContext lengthContext(element()); |
| 412 return style()->svgStyle().strokeWidth()->value(lengthContext); | 412 return style()->svgStyle().strokeWidth()->value(lengthContext); |
| 413 } | 413 } |
| 414 | 414 |
| 415 bool RenderSVGShape::hasSmoothStroke() const | 415 bool RenderSVGShape::hasSmoothStroke() const |
| 416 { | 416 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 return; | 451 return; |
| 452 | 452 |
| 453 ASSERT(m_path); | 453 ASSERT(m_path); |
| 454 | 454 |
| 455 SVGMarkerData markerData(m_markerPositions); | 455 SVGMarkerData markerData(m_markerPositions); |
| 456 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); | 456 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); |
| 457 markerData.pathIsDone(); | 457 markerData.pathIsDone(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 } | 460 } |
| OLD | NEW |