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 25 matching lines...) Expand all Loading... |
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 "platform/geometry/FloatPoint.h" | 39 #include "platform/geometry/FloatPoint.h" |
40 #include "platform/graphics/StrokeData.h" | 40 #include "platform/graphics/StrokeData.h" |
41 #include "wtf/MathExtras.h" | 41 #include "wtf/MathExtras.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 LayoutSVGShape::LayoutSVGShape(SVGGraphicsElement* node) | 45 LayoutSVGShape::LayoutSVGShape(SVGGraphicsElement* node) |
46 : RenderSVGModelObject(node) | 46 : LayoutSVGModelObject(node) |
47 , m_needsBoundariesUpdate(false) // Default is false, the cached rects are e
mpty from the beginning. | 47 , 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. | 48 , m_needsShapeUpdate(true) // Default is true, so we grab a Path object once
from SVGGraphicsElement. |
49 , m_needsTransformUpdate(true) // Default is true, so we grab a AffineTransf
orm object once from SVGGraphicsElement. | 49 , m_needsTransformUpdate(true) // Default is true, so we grab a AffineTransf
orm object once from SVGGraphicsElement. |
50 { | 50 { |
51 } | 51 } |
52 | 52 |
53 LayoutSVGShape::~LayoutSVGShape() | 53 LayoutSVGShape::~LayoutSVGShape() |
54 { | 54 { |
55 } | 55 } |
56 | 56 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 m_needsTransformUpdate = false; | 145 m_needsTransformUpdate = false; |
146 updateCachedBoundariesInParents = true; | 146 updateCachedBoundariesInParents = true; |
147 } | 147 } |
148 | 148 |
149 // Invalidate all resources of this client if our layout changed. | 149 // Invalidate all resources of this client if our layout changed. |
150 if (everHadLayout() && selfNeedsLayout()) | 150 if (everHadLayout() && selfNeedsLayout()) |
151 SVGResourcesCache::clientLayoutChanged(this); | 151 SVGResourcesCache::clientLayoutChanged(this); |
152 | 152 |
153 // If our bounds changed, notify the parents. | 153 // If our bounds changed, notify the parents. |
154 if (updateCachedBoundariesInParents) | 154 if (updateCachedBoundariesInParents) |
155 RenderSVGModelObject::setNeedsBoundariesUpdate(); | 155 LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
156 | 156 |
157 clearNeedsLayout(); | 157 clearNeedsLayout(); |
158 } | 158 } |
159 | 159 |
160 Path* LayoutSVGShape::nonScalingStrokePath(const Path* path, const AffineTransfo
rm& strokeTransform) const | 160 Path* LayoutSVGShape::nonScalingStrokePath(const Path* path, const AffineTransfo
rm& strokeTransform) const |
161 { | 161 { |
162 DEFINE_STATIC_LOCAL(Path, tempPath, ()); | 162 DEFINE_STATIC_LOCAL(Path, tempPath, ()); |
163 | 163 |
164 tempPath = *path; | 164 tempPath = *path; |
165 tempPath.transform(strokeTransform); | 165 tempPath.transform(strokeTransform); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); | 258 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI
nvalidationBoundingBox); |
259 } | 259 } |
260 | 260 |
261 float LayoutSVGShape::strokeWidth() const | 261 float LayoutSVGShape::strokeWidth() const |
262 { | 262 { |
263 SVGLengthContext lengthContext(element()); | 263 SVGLengthContext lengthContext(element()); |
264 return style()->svgStyle().strokeWidth()->value(lengthContext); | 264 return style()->svgStyle().strokeWidth()->value(lengthContext); |
265 } | 265 } |
266 | 266 |
267 } | 267 } |
OLD | NEW |