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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp

Issue 2753013004: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text
Patch Set: Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 30 matching lines...) Expand all
41 #include "platform/geometry/FloatPoint.h" 41 #include "platform/geometry/FloatPoint.h"
42 #include "platform/graphics/StrokeData.h" 42 #include "platform/graphics/StrokeData.h"
43 #include "wtf/MathExtras.h" 43 #include "wtf/MathExtras.h"
44 #include "wtf/PtrUtil.h" 44 #include "wtf/PtrUtil.h"
45 45
46 namespace blink { 46 namespace blink {
47 47
48 bool LayoutSVGShape::adjustVisualRectForRasterEffects( 48 bool LayoutSVGShape::adjustVisualRectForRasterEffects(
49 LayoutRect& visualRect) const { 49 LayoutRect& visualRect) const {
50 // Account for raster expansions due to SVG stroke hairline raster effects. 50 // Account for raster expansions due to SVG stroke hairline raster effects.
51 if (!visualRect.isEmpty() && styleRef().svgStyle().hasVisibleStroke()) { 51 if (!visualRect.isEmpty() && styleRef().hasVisibleStroke()) {
52 LayoutUnit pad(0.5f); 52 LayoutUnit pad(0.5f);
53 if (styleRef().svgStyle().capStyle() != ButtCap) 53 if (styleRef().capStyle() != ButtCap)
54 pad += 0.5f; 54 pad += 0.5f;
55 visualRect.inflate(pad); 55 visualRect.inflate(pad);
56 return true; 56 return true;
57 } 57 }
58 return false; 58 return false;
59 } 59 }
60 60
61 LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node) 61 LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node)
62 : LayoutSVGModelObject(node), 62 : LayoutSVGModelObject(node),
63 // Default is false, the cached rects are empty from the beginning. 63 // Default is false, the cached rects are empty from the beginning.
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } else { 320 } else {
321 strokeBoundingBox.unite(path().strokeBoundingRect(strokeData)); 321 strokeBoundingBox.unite(path().strokeBoundingRect(strokeData));
322 } 322 }
323 } 323 }
324 324
325 return strokeBoundingBox; 325 return strokeBoundingBox;
326 } 326 }
327 327
328 float LayoutSVGShape::strokeWidth() const { 328 float LayoutSVGShape::strokeWidth() const {
329 SVGLengthContext lengthContext(element()); 329 SVGLengthContext lengthContext(element());
330 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 330 return lengthContext.valueForLength(style()->strokeWidth());
331 } 331 }
332 332
333 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { 333 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const {
334 if (!m_rareData) 334 if (!m_rareData)
335 m_rareData = WTF::makeUnique<LayoutSVGShapeRareData>(); 335 m_rareData = WTF::makeUnique<LayoutSVGShapeRareData>();
336 return *m_rareData.get(); 336 return *m_rareData.get();
337 } 337 }
338 338
339 } // namespace blink 339 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698