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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2006 Apple Computer, Inc | 5 * Copyright (C) 2006 Apple Computer, Inc |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
8 * Copyright (C) 2011 University of Szeged | 8 * Copyright (C) 2011 University of Szeged |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const FloatPoint&, | 68 const FloatPoint&, |
69 PointerEventsHitRules); | 69 PointerEventsHitRules); |
70 | 70 |
71 Path& path() const { | 71 Path& path() const { |
72 DCHECK(m_path); | 72 DCHECK(m_path); |
73 return *m_path; | 73 return *m_path; |
74 } | 74 } |
75 bool hasPath() const { return m_path.get(); } | 75 bool hasPath() const { return m_path.get(); } |
76 float dashScaleFactor() const; | 76 float dashScaleFactor() const; |
77 | 77 |
78 // This method is sometimes (rarely) called with a null path and crashes. The
code managing | 78 // This method is sometimes (rarely) called with a null path and crashes. The |
79 // the path enforces the necessary invariants to ensure a valid path but someh
ow that fails. | 79 // code managing the path enforces the necessary invariants to ensure a valid |
80 // The assert and check for hasPath() are intended to detect and prevent crash
es. | 80 // path but somehow that fails. The assert and check for hasPath() are |
| 81 // intended to detect and prevent crashes. |
81 virtual bool isShapeEmpty() const { | 82 virtual bool isShapeEmpty() const { |
82 DCHECK(m_path); | 83 DCHECK(m_path); |
83 return !hasPath() || path().isEmpty(); | 84 return !hasPath() || path().isEmpty(); |
84 } | 85 } |
85 | 86 |
86 bool hasNonScalingStroke() const { | 87 bool hasNonScalingStroke() const { |
87 return style()->svgStyle().vectorEffect() == VE_NON_SCALING_STROKE; | 88 return style()->svgStyle().vectorEffect() == VE_NON_SCALING_STROKE; |
88 } | 89 } |
89 Path* nonScalingStrokePath(const Path*, const AffineTransform&) const; | 90 Path* nonScalingStrokePath(const Path*, const AffineTransform&) const; |
90 AffineTransform nonScalingStrokeTransform() const; | 91 AffineTransform nonScalingStrokeTransform() const; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 const FloatPoint& pointInParent, | 147 const FloatPoint& pointInParent, |
147 HitTestAction) final; | 148 HitTestAction) final; |
148 | 149 |
149 FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; } | 150 FloatRect strokeBoundingBox() const final { return m_strokeBoundingBox; } |
150 FloatRect calculateObjectBoundingBox() const; | 151 FloatRect calculateObjectBoundingBox() const; |
151 FloatRect calculateStrokeBoundingBox() const; | 152 FloatRect calculateStrokeBoundingBox() const; |
152 void updateLocalTransform(); | 153 void updateLocalTransform(); |
153 | 154 |
154 private: | 155 private: |
155 AffineTransform m_localTransform; | 156 AffineTransform m_localTransform; |
156 // TODO(fmalita): the Path is now cached in SVGPath; while this additional cac
he is just a | 157 // TODO(fmalita): the Path is now cached in SVGPath; while this additional |
157 // shallow copy, it certainly has a complexity/state management cost (plus all
ocation & storage | 158 // cache is just a shallow copy, it certainly has a complexity/state |
158 // overhead) - so we should look into removing it. | 159 // management cost (plus allocation & storage overhead) - so we should look |
| 160 // into removing it. |
159 std::unique_ptr<Path> m_path; | 161 std::unique_ptr<Path> m_path; |
160 mutable std::unique_ptr<LayoutSVGShapeRareData> m_rareData; | 162 mutable std::unique_ptr<LayoutSVGShapeRareData> m_rareData; |
161 | 163 |
162 bool m_needsBoundariesUpdate : 1; | 164 bool m_needsBoundariesUpdate : 1; |
163 bool m_needsShapeUpdate : 1; | 165 bool m_needsShapeUpdate : 1; |
164 bool m_needsTransformUpdate : 1; | 166 bool m_needsTransformUpdate : 1; |
165 }; | 167 }; |
166 | 168 |
167 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape()); | 169 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutSVGShape, isSVGShape()); |
168 | 170 |
169 } // namespace blink | 171 } // namespace blink |
170 | 172 |
171 #endif | 173 #endif |
OLD | NEW |