Chromium Code Reviews| Index: Source/core/layout/svg/LayoutSVGPath.cpp |
| diff --git a/Source/core/layout/svg/LayoutSVGPath.cpp b/Source/core/layout/svg/LayoutSVGPath.cpp |
| index 72ccd5e6427f4b16083c99380c8318393c0d6d8e..b66a352f6f1ae6bc94e1ab7fa29e2f7259ede282 100644 |
| --- a/Source/core/layout/svg/LayoutSVGPath.cpp |
| +++ b/Source/core/layout/svg/LayoutSVGPath.cpp |
| @@ -50,10 +50,25 @@ LayoutSVGPath::~LayoutSVGPath() |
| void LayoutSVGPath::updateShapeFromElement() |
| { |
| LayoutSVGShape::updateShapeFromElement(); |
| - processMarkerPositions(); |
| updateZeroLengthSubpaths(); |
| +} |
| + |
| +void LayoutSVGPath::updateStrokeAndFillBoundingBoxes() |
| +{ |
| + LayoutSVGShape::updateStrokeAndFillBoundingBoxes(); |
| + |
| + // TODO(pdr): It would be ideal to only call this in updateShapeFromElement |
|
fs
2015/06/16 10:54:02
I think the first part (line) of this makes sense.
pdr.
2015/06/17 03:50:49
Done
|
| + // and have marker invalidation call setNeedsShapeUpdate. |
| + processMarkerPositions(); |
| + if (!m_markerPositions.isEmpty()) |
| + m_strokeBoundingBox.unite(markerRect(strokeWidth())); |
| - m_strokeBoundingBox = calculateUpdatedStrokeBoundingBox(); |
| + if (style()->svgStyle().hasStroke()) { |
| + // FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke. |
| + float strokeWidth = this->strokeWidth(); |
| + for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) |
| + m_strokeBoundingBox.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth)); |
| + } |
| } |
| FloatRect LayoutSVGPath::hitTestStrokeBoundingBox() const |
| @@ -91,23 +106,6 @@ FloatRect LayoutSVGPath::hitTestStrokeBoundingBox() const |
| return box; |
| } |
| -FloatRect LayoutSVGPath::calculateUpdatedStrokeBoundingBox() const |
| -{ |
| - FloatRect strokeBoundingBox = m_strokeBoundingBox; |
| - |
| - if (!m_markerPositions.isEmpty()) |
| - strokeBoundingBox.unite(markerRect(strokeWidth())); |
| - |
| - if (style()->svgStyle().hasStroke()) { |
| - // FIXME: zero-length subpaths do not respect vector-effect = non-scaling-stroke. |
| - float strokeWidth = this->strokeWidth(); |
| - for (size_t i = 0; i < m_zeroLengthLinecapLocations.size(); ++i) |
| - strokeBoundingBox.unite(zeroLengthSubpathRect(m_zeroLengthLinecapLocations[i], strokeWidth)); |
| - } |
| - |
| - return strokeBoundingBox; |
| -} |
| - |
| bool LayoutSVGPath::shapeDependentStrokeContains(const FloatPoint& point) |
| { |
| if (LayoutSVGShape::shapeDependentStrokeContains(point)) |