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 18 matching lines...) Expand all Loading... |
29 #include "core/layout/svg/LayoutSVGShape.h" | 29 #include "core/layout/svg/LayoutSVGShape.h" |
30 | 30 |
31 #include "core/layout/HitTestRequest.h" | 31 #include "core/layout/HitTestRequest.h" |
32 #include "core/layout/PointerEventsHitRules.h" | 32 #include "core/layout/PointerEventsHitRules.h" |
33 #include "core/layout/svg/SVGLayoutSupport.h" | 33 #include "core/layout/svg/SVGLayoutSupport.h" |
34 #include "core/layout/svg/SVGPathData.h" | 34 #include "core/layout/svg/SVGPathData.h" |
35 #include "core/layout/svg/SVGResources.h" | 35 #include "core/layout/svg/SVGResources.h" |
36 #include "core/layout/svg/SVGResourcesCache.h" | 36 #include "core/layout/svg/SVGResourcesCache.h" |
37 #include "core/paint/SVGShapePainter.h" | 37 #include "core/paint/SVGShapePainter.h" |
38 #include "core/svg/SVGGraphicsElement.h" | 38 #include "core/svg/SVGGraphicsElement.h" |
| 39 #include "core/svg/SVGLengthContext.h" |
39 #include "platform/geometry/FloatPoint.h" | 40 #include "platform/geometry/FloatPoint.h" |
40 #include "platform/graphics/StrokeData.h" | 41 #include "platform/graphics/StrokeData.h" |
41 #include "wtf/MathExtras.h" | 42 #include "wtf/MathExtras.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 LayoutSVGShape::LayoutSVGShape(SVGGraphicsElement* node) | 46 LayoutSVGShape::LayoutSVGShape(SVGGraphicsElement* node) |
46 : LayoutSVGModelObject(node) | 47 : LayoutSVGModelObject(node) |
47 , m_needsBoundariesUpdate(false) // Default is false, the cached rects are e
mpty from the beginning. | 48 , m_needsBoundariesUpdate(false) // Default is false, the cached rects are e
mpty from the beginning. |
48 , m_needsShapeUpdate(true) // Default is true, so we grab a Path object once
from SVGGraphicsElement. | 49 , m_needsShapeUpdate(true) // Default is true, so we grab a Path object once
from SVGGraphicsElement. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 { | 254 { |
254 m_paintInvalidationBoundingBox = strokeBoundingBox(); | 255 m_paintInvalidationBoundingBox = strokeBoundingBox(); |
255 if (strokeWidth() < 1.0f && !m_paintInvalidationBoundingBox.isEmpty()) | 256 if (strokeWidth() < 1.0f && !m_paintInvalidationBoundingBox.isEmpty()) |
256 m_paintInvalidationBoundingBox.inflate(1); | 257 m_paintInvalidationBoundingBox.inflate(1); |
257 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); | 258 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); |
258 } | 259 } |
259 | 260 |
260 float LayoutSVGShape::strokeWidth() const | 261 float LayoutSVGShape::strokeWidth() const |
261 { | 262 { |
262 SVGLengthContext lengthContext(element()); | 263 SVGLengthContext lengthContext(element()); |
263 return style()->svgStyle().strokeWidth()->value(lengthContext); | 264 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); |
264 } | 265 } |
265 | 266 |
266 } | 267 } |
OLD | NEW |