OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/SVGShapePainter.h" | 6 #include "core/paint/SVGShapePainter.h" |
7 | 7 |
8 #include "core/paint/GraphicsContextAnnotator.h" | 8 #include "core/paint/GraphicsContextAnnotator.h" |
9 #include "core/paint/ObjectPainter.h" | 9 #include "core/paint/ObjectPainter.h" |
10 #include "core/paint/RenderDrawingRecorder.h" | 10 #include "core/paint/RenderDrawingRecorder.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 strokeZeroLengthLineCaps(context); | 145 strokeZeroLengthLineCaps(context); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo) | 149 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo) |
150 { | 150 { |
151 const Vector<MarkerPosition>* markerPositions = m_renderSVGShape.markerPosit
ions(); | 151 const Vector<MarkerPosition>* markerPositions = m_renderSVGShape.markerPosit
ions(); |
152 if (!markerPositions || markerPositions->isEmpty()) | 152 if (!markerPositions || markerPositions->isEmpty()) |
153 return; | 153 return; |
154 | 154 |
155 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
&m_renderSVGShape); | 155 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(
&m_renderSVGShape); |
156 if (!resources) | 156 if (!resources) |
157 return; | 157 return; |
158 | 158 |
159 RenderSVGResourceMarker* markerStart = resources->markerStart(); | 159 RenderSVGResourceMarker* markerStart = resources->markerStart(); |
160 RenderSVGResourceMarker* markerMid = resources->markerMid(); | 160 RenderSVGResourceMarker* markerMid = resources->markerMid(); |
161 RenderSVGResourceMarker* markerEnd = resources->markerEnd(); | 161 RenderSVGResourceMarker* markerEnd = resources->markerEnd(); |
162 if (!markerStart && !markerMid && !markerEnd) | 162 if (!markerStart && !markerMid && !markerEnd) |
163 return; | 163 return; |
164 | 164 |
165 float strokeWidth = m_renderSVGShape.strokeWidth(); | 165 float strokeWidth = m_renderSVGShape.strokeWidth(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 tempPath.clear(); | 230 tempPath.clear(); |
231 if (m_renderSVGShape.style()->svgStyle().capStyle() == SquareCap) | 231 if (m_renderSVGShape.style()->svgStyle().capStyle() == SquareCap) |
232 tempPath.addRect(RenderSVGPath::zeroLengthSubpathRect(linecapPosition, m
_renderSVGShape.strokeWidth())); | 232 tempPath.addRect(RenderSVGPath::zeroLengthSubpathRect(linecapPosition, m
_renderSVGShape.strokeWidth())); |
233 else | 233 else |
234 tempPath.addEllipse(RenderSVGPath::zeroLengthSubpathRect(linecapPosition
, m_renderSVGShape.strokeWidth())); | 234 tempPath.addEllipse(RenderSVGPath::zeroLengthSubpathRect(linecapPosition
, m_renderSVGShape.strokeWidth())); |
235 | 235 |
236 return &tempPath; | 236 return &tempPath; |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |