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

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

Issue 1224933002: Combine outline and focus ring code paths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 3 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 paintMarkers(paintContext.paintInfo(), boundingBox); 106 paintMarkers(paintContext.paintInfo(), boundingBox);
107 break; 107 break;
108 default: 108 default:
109 ASSERT_NOT_REACHED(); 109 ASSERT_NOT_REACHED();
110 break; 110 break;
111 } 111 }
112 } 112 }
113 } 113 }
114 } 114 }
115 115
116 if (m_layoutSVGShape.style()->outlineWidth()) { 116 if (m_layoutSVGShape.style()->outlineWidth())
117 PaintInfo outlinePaintInfo(paintInfoBeforeFiltering); 117 ObjectPainter(m_layoutSVGShape).paintOutline(paintInfoBeforeFiltering, L ayoutPoint(boundingBox.location()));
118 outlinePaintInfo.phase = PaintPhaseSelfOutline;
119 LayoutRect layoutBoundingBox(boundingBox);
120 ObjectPainter(m_layoutSVGShape).paintOutline(outlinePaintInfo, m_layoutS VGShape.outlineVisualOverflowRect(), layoutBoundingBox.size(), layoutBoundingBox .location());
121 }
122 } 118 }
123 119
124 class PathWithTemporaryWindingRule { 120 class PathWithTemporaryWindingRule {
125 public: 121 public:
126 PathWithTemporaryWindingRule(Path& path, SkPath::FillType fillType) 122 PathWithTemporaryWindingRule(Path& path, SkPath::FillType fillType)
127 : m_path(const_cast<SkPath&>(path.skPath())) 123 : m_path(const_cast<SkPath&>(path.skPath()))
128 { 124 {
129 m_savedFillType = m_path.getFillType(); 125 m_savedFillType = m_path.getFillType();
130 m_path.setFillType(fillType); 126 m_path.setFillType(fillType);
131 } 127 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 position = nonScalingTransform.mapPoint(position); 251 position = nonScalingTransform.mapPoint(position);
256 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth()); 252 FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m _layoutSVGShape.strokeWidth());
257 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap) 253 if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap)
258 context->drawRect(subpathRect, fillPaint); 254 context->drawRect(subpathRect, fillPaint);
259 else 255 else
260 context->drawOval(subpathRect, fillPaint); 256 context->drawOval(subpathRect, fillPaint);
261 } 257 }
262 } 258 }
263 259
264 } // namespace blink 260 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698