Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 27 matching lines...) Expand all Loading... | |
| 38 #include "core/svg/SVGGeometryElement.h" | 38 #include "core/svg/SVGGeometryElement.h" |
| 39 #include "core/svg/SVGLengthContext.h" | 39 #include "core/svg/SVGLengthContext.h" |
| 40 #include "core/svg/SVGPathElement.h" | 40 #include "core/svg/SVGPathElement.h" |
| 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 void LayoutSVGShape::adjustVisualRectForRasterEffects( | |
| 49 LayoutRect& visualRect) const { | |
| 50 // Account for raster expansions due to SVG stroke hairline raster effects. | |
| 51 if (styleRef().svgStyle().hasStroke()) | |
| 52 visualRect.expand(IntRectOutsets(2, 2, 2, 2)); | |
|
chrishtr
2016/10/22 00:01:11
Because this code doesn't understand anything exce
Xianzhu
2016/10/22 00:35:46
It seems too much to expand by 2 pixels each side.
chrishtr
2016/10/22 06:21:04
Done.
| |
| 53 } | |
| 54 | |
| 48 LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node) | 55 LayoutSVGShape::LayoutSVGShape(SVGGeometryElement* node) |
| 49 : LayoutSVGModelObject(node), | 56 : LayoutSVGModelObject(node), |
| 50 // Default is false, the cached rects are empty from the beginning. | 57 // Default is false, the cached rects are empty from the beginning. |
| 51 m_needsBoundariesUpdate(false), | 58 m_needsBoundariesUpdate(false), |
| 52 // Default is true, so we grab a Path object once from SVGGeometryElement. | 59 // Default is true, so we grab a Path object once from SVGGeometryElement. |
| 53 m_needsShapeUpdate(true), | 60 m_needsShapeUpdate(true), |
| 54 // Default is true, so we grab a AffineTransform object once from | 61 // Default is true, so we grab a AffineTransform object once from |
| 55 // SVGGeometryElement. | 62 // SVGGeometryElement. |
| 56 m_needsTransformUpdate(true) {} | 63 m_needsTransformUpdate(true) {} |
| 57 | 64 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); | 323 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); |
| 317 } | 324 } |
| 318 | 325 |
| 319 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { | 326 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { |
| 320 if (!m_rareData) | 327 if (!m_rareData) |
| 321 m_rareData = wrapUnique(new LayoutSVGShapeRareData()); | 328 m_rareData = wrapUnique(new LayoutSVGShapeRareData()); |
| 322 return *m_rareData.get(); | 329 return *m_rareData.get(); |
| 323 } | 330 } |
| 324 | 331 |
| 325 } // namespace blink | 332 } // namespace blink |
| OLD | NEW |