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

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: Fix marker regression 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return; 163 return;
164 164
165 switch (m_layoutSVGShape.geometryCodePath()) { 165 switch (m_layoutSVGShape.geometryCodePath()) {
166 case RectGeometryFastPath: 166 case RectGeometryFastPath:
167 context->drawRect(m_layoutSVGShape.objectBoundingBox(), paint); 167 context->drawRect(m_layoutSVGShape.objectBoundingBox(), paint);
168 break; 168 break;
169 case EllipseGeometryFastPath: 169 case EllipseGeometryFastPath:
170 context->drawOval(m_layoutSVGShape.objectBoundingBox(), paint); 170 context->drawOval(m_layoutSVGShape.objectBoundingBox(), paint);
171 break; 171 break;
172 default: 172 default:
173 ASSERT(m_layoutSVGShape.hasPath());
174 Path* usePath = &m_layoutSVGShape.path(); 173 Path* usePath = &m_layoutSVGShape.path();
175 if (m_layoutSVGShape.hasNonScalingStroke()) 174 if (m_layoutSVGShape.hasNonScalingStroke())
176 usePath = m_layoutSVGShape.nonScalingStrokePath(usePath, m_layoutSVG Shape.nonScalingStrokeTransform()); 175 usePath = m_layoutSVGShape.nonScalingStrokePath(usePath, m_layoutSVG Shape.nonScalingStrokeTransform());
177 context->drawPath(usePath->skPath(), paint); 176 context->drawPath(usePath->skPath(), paint);
178 strokeZeroLengthLineCaps(context, paint); 177 strokeZeroLengthLineCaps(context, paint);
179 } 178 }
180 } 179 }
181 180
182 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo) 181 void SVGShapePainter::paintMarkers(const PaintInfo& paintInfo)
183 { 182 {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 position = nonScalingTransform.mapPoint(position); 254 position = nonScalingTransform.mapPoint(position);
256 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth()); 255 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth());
257 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap) 256 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap)
258 context->drawRect(subpathRect, fillPaint); 257 context->drawRect(subpathRect, fillPaint);
259 else 258 else
260 context->drawOval(subpathRect, fillPaint); 259 context->drawOval(subpathRect, fillPaint);
261 } 260 }
262 } 261 }
263 262
264 } // namespace blink 263 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698