| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 FloatRect LayoutSVGPath::calculateUpdatedStrokeBoundingBox() const { | 82 FloatRect LayoutSVGPath::calculateUpdatedStrokeBoundingBox() const { |
| 83 FloatRect strokeBoundingBox = m_strokeBoundingBox; | 83 FloatRect strokeBoundingBox = m_strokeBoundingBox; |
| 84 if (!m_markerPositions.isEmpty()) | 84 if (!m_markerPositions.isEmpty()) |
| 85 strokeBoundingBox.unite(markerRect(strokeWidth())); | 85 strokeBoundingBox.unite(markerRect(strokeWidth())); |
| 86 return strokeBoundingBox; | 86 return strokeBoundingBox; |
| 87 } | 87 } |
| 88 | 88 |
| 89 FloatRect LayoutSVGPath::markerRect(float strokeWidth) const { | 89 FloatRect LayoutSVGPath::markerRect(float strokeWidth) const { |
| 90 ASSERT(!m_markerPositions.isEmpty()); | 90 DCHECK(!m_markerPositions.isEmpty()); |
| 91 | 91 |
| 92 SVGResources* resources = | 92 SVGResources* resources = |
| 93 SVGResourcesCache::cachedResourcesForLayoutObject(this); | 93 SVGResourcesCache::cachedResourcesForLayoutObject(this); |
| 94 ASSERT(resources); | 94 DCHECK(resources); |
| 95 | 95 |
| 96 LayoutSVGResourceMarker* markerStart = resources->markerStart(); | 96 LayoutSVGResourceMarker* markerStart = resources->markerStart(); |
| 97 LayoutSVGResourceMarker* markerMid = resources->markerMid(); | 97 LayoutSVGResourceMarker* markerMid = resources->markerMid(); |
| 98 LayoutSVGResourceMarker* markerEnd = resources->markerEnd(); | 98 LayoutSVGResourceMarker* markerEnd = resources->markerEnd(); |
| 99 ASSERT(markerStart || markerMid || markerEnd); | 99 DCHECK(markerStart || markerMid || markerEnd); |
| 100 | 100 |
| 101 FloatRect boundaries; | 101 FloatRect boundaries; |
| 102 unsigned size = m_markerPositions.size(); | 102 unsigned size = m_markerPositions.size(); |
| 103 for (unsigned i = 0; i < size; ++i) { | 103 for (unsigned i = 0; i < size; ++i) { |
| 104 if (LayoutSVGResourceMarker* marker = SVGMarkerData::markerForType( | 104 if (LayoutSVGResourceMarker* marker = SVGMarkerData::markerForType( |
| 105 m_markerPositions[i].type, markerStart, markerMid, markerEnd)) | 105 m_markerPositions[i].type, markerStart, markerMid, markerEnd)) |
| 106 boundaries.unite(marker->markerBoundaries(marker->markerTransformation( | 106 boundaries.unite(marker->markerBoundaries(marker->markerTransformation( |
| 107 m_markerPositions[i].origin, m_markerPositions[i].angle, | 107 m_markerPositions[i].origin, m_markerPositions[i].angle, |
| 108 strokeWidth))); | 108 strokeWidth))); |
| 109 } | 109 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 127 } | 127 } |
| 128 | 128 |
| 129 void LayoutSVGPath::processMarkerPositions() { | 129 void LayoutSVGPath::processMarkerPositions() { |
| 130 m_markerPositions.clear(); | 130 m_markerPositions.clear(); |
| 131 | 131 |
| 132 if (!shouldGenerateMarkerPositions()) | 132 if (!shouldGenerateMarkerPositions()) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 SVGResources* resources = | 135 SVGResources* resources = |
| 136 SVGResourcesCache::cachedResourcesForLayoutObject(this); | 136 SVGResourcesCache::cachedResourcesForLayoutObject(this); |
| 137 ASSERT(resources); | 137 DCHECK(resources); |
| 138 | 138 |
| 139 LayoutSVGResourceMarker* markerStart = resources->markerStart(); | 139 LayoutSVGResourceMarker* markerStart = resources->markerStart(); |
| 140 | 140 |
| 141 SVGMarkerData markerData( | 141 SVGMarkerData markerData( |
| 142 m_markerPositions, | 142 m_markerPositions, |
| 143 markerStart ? markerStart->orientType() == SVGMarkerOrientAutoStartReverse | 143 markerStart ? markerStart->orientType() == SVGMarkerOrientAutoStartReverse |
| 144 : false); | 144 : false); |
| 145 path().apply(&markerData, SVGMarkerData::updateFromPathElement); | 145 path().apply(&markerData, SVGMarkerData::updateFromPathElement); |
| 146 markerData.pathIsDone(); | 146 markerData.pathIsDone(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace blink | 149 } // namespace blink |
| OLD | NEW |