Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: Source/core/paint/SVGShapePainter.cpp

Issue 1158583003: Reduce how often LayoutSVGShape::updateShapeFromElement is called (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Put selfHasRelativeLengths back Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/svg/LayoutSVGShape.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/layout/svg/LayoutSVGPath.h" 8 #include "core/layout/svg/LayoutSVGPath.h"
9 #include "core/layout/svg/LayoutSVGResourceMarker.h" 9 #include "core/layout/svg/LayoutSVGResourceMarker.h"
10 #include "core/layout/svg/LayoutSVGShape.h" 10 #include "core/layout/svg/LayoutSVGShape.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return; 164 return;
165 165
166 switch (m_layoutSVGShape.geometryCodePath()) { 166 switch (m_layoutSVGShape.geometryCodePath()) {
167 case RectGeometryFastPath: 167 case RectGeometryFastPath:
168 context->drawRect(m_layoutSVGShape.objectBoundingBox(), paint); 168 context->drawRect(m_layoutSVGShape.objectBoundingBox(), paint);
169 break; 169 break;
170 case EllipseGeometryFastPath: 170 case EllipseGeometryFastPath:
171 context->drawOval(m_layoutSVGShape.objectBoundingBox(), paint); 171 context->drawOval(m_layoutSVGShape.objectBoundingBox(), paint);
172 break; 172 break;
173 default: 173 default:
174 ASSERT(m_layoutSVGShape.hasPath());
175 Path* usePath = &m_layoutSVGShape.path(); 174 Path* usePath = &m_layoutSVGShape.path();
176 if (m_layoutSVGShape.hasNonScalingStroke()) 175 if (m_layoutSVGShape.hasNonScalingStroke())
177 usePath = m_layoutSVGShape.nonScalingStrokePath(usePath, m_layoutSVG Shape.nonScalingStrokeTransform()); 176 usePath = m_layoutSVGShape.nonScalingStrokePath(usePath, m_layoutSVG Shape.nonScalingStrokeTransform());
178 context->drawPath(usePath->skPath(), paint); 177 context->drawPath(usePath->skPath(), paint);
179 strokeZeroLengthLineCaps(context, paint); 178 strokeZeroLengthLineCaps(context, paint);
180 } 179 }
181 } 180 }
182 181
183 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo, const FloatRect& boundingBox) 182 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo, const FloatRect& boundingBox)
184 { 183 {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 position = nonScalingTransform.mapPoint(position); 256 position = nonScalingTransform.mapPoint(position);
258 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth()); 257 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth());
259 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap) 258 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap)
260 context->drawRect(subpathRect, fillPaint); 259 context->drawRect(subpathRect, fillPaint);
261 else 260 else
262 context->drawOval(subpathRect, fillPaint); 261 context->drawOval(subpathRect, fillPaint);
263 } 262 }
264 } 263 }
265 264
266 } // namespace blink 265 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698