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

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

Issue 1144203004: Allow certain SP recorder classes to defer their "begin" operation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/paint/SVGRootPainter.cpp ('k') | Source/core/paint/ScopeRecorder.h » ('j') | 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT(markerElement); 205 ASSERT(markerElement);
206 if (markerElement->hasAttribute(SVGNames::viewBoxAttr) && markerElement->vie wBox()->currentValue()->isValid() && markerElement->viewBox()->currentValue()->v alue().isEmpty()) 206 if (markerElement->hasAttribute(SVGNames::viewBoxAttr) && markerElement->vie wBox()->currentValue()->isValid() && markerElement->viewBox()->currentValue()->v alue().isEmpty())
207 return; 207 return;
208 208
209 { 209 {
210 DisplayItemListContextRecorder contextRecorder(*paintInfo.context); 210 DisplayItemListContextRecorder contextRecorder(*paintInfo.context);
211 PaintInfo markerPaintInfo(paintInfo); 211 PaintInfo markerPaintInfo(paintInfo);
212 markerPaintInfo.context = &contextRecorder.context(); 212 markerPaintInfo.context = &contextRecorder.context();
213 213
214 TransformRecorder transformRecorder(*markerPaintInfo.context, marker, ma rker.markerTransformation(position.origin, position.angle, strokeWidth)); 214 TransformRecorder transformRecorder(*markerPaintInfo.context, marker, ma rker.markerTransformation(position.origin, position.angle, strokeWidth));
215 OwnPtr<FloatClipRecorder> clipRecorder; 215 FloatClipRecorder clipRecorder(*markerPaintInfo.context, marker, markerP aintInfo.phase);
216 if (SVGLayoutSupport::isOverflowHidden(&marker)) 216 if (SVGLayoutSupport::isOverflowHidden(&marker))
217 clipRecorder = adoptPtr(new FloatClipRecorder(*markerPaintInfo.conte xt, marker, markerPaintInfo.phase, marker.viewport())); 217 clipRecorder.begin(marker.viewport());
218 218
219 SVGContainerPainter(marker).paint(markerPaintInfo); 219 SVGContainerPainter(marker).paint(markerPaintInfo);
220 } 220 }
221 } 221 }
222 222
223 void SVGShapePainter::strokeZeroLengthLineCaps(GraphicsContext* context, const S kPaint& strokePaint) 223 void SVGShapePainter::strokeZeroLengthLineCaps(GraphicsContext* context, const S kPaint& strokePaint)
224 { 224 {
225 const Vector<FloatPoint>* zeroLengthLineCaps = m_layoutSVGShape.zeroLengthLi neCaps(); 225 const Vector<FloatPoint>* zeroLengthLineCaps = m_layoutSVGShape.zeroLengthLi neCaps();
226 if (!zeroLengthLineCaps || zeroLengthLineCaps->isEmpty()) 226 if (!zeroLengthLineCaps || zeroLengthLineCaps->isEmpty())
227 return; 227 return;
(...skipping 17 matching lines...) Expand all
245 // This open-codes LayoutSVGShape::nonScalingStrokePath, because the 245 // This open-codes LayoutSVGShape::nonScalingStrokePath, because the
246 // requirements here differ (we have a temporary path that we can 246 // requirements here differ (we have a temporary path that we can
247 // mutate.) 247 // mutate.)
248 if (m_layoutSVGShape.hasNonScalingStroke()) 248 if (m_layoutSVGShape.hasNonScalingStroke())
249 tempPath.transform(nonScalingTransform); 249 tempPath.transform(nonScalingTransform);
250 context->drawPath(tempPath.skPath(), fillPaint); 250 context->drawPath(tempPath.skPath(), fillPaint);
251 } 251 }
252 } 252 }
253 253
254 } // namespace blink 254 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGRootPainter.cpp ('k') | Source/core/paint/ScopeRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698