OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef SVGGeometryElement_h | 31 #ifndef SVGGeometryElement_h |
32 #define SVGGeometryElement_h | 32 #define SVGGeometryElement_h |
33 | 33 |
34 #include "core/svg/SVGAnimatedNumber.h" | |
34 #include "core/svg/SVGGraphicsElement.h" | 35 #include "core/svg/SVGGraphicsElement.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 class Path; | 39 class Path; |
39 class SVGPointTearOff; | 40 class SVGPointTearOff; |
40 | 41 |
41 class SVGGeometryElement : public SVGGraphicsElement { | 42 class SVGGeometryElement : public SVGGraphicsElement { |
42 DEFINE_WRAPPERTYPEINFO(); | 43 DEFINE_WRAPPERTYPEINFO(); |
43 | 44 |
44 public: | 45 public: |
45 virtual Path asPath() const = 0; | 46 virtual Path asPath() const = 0; |
46 bool isPointInFill(SVGPointTearOff*) const; | 47 bool isPointInFill(SVGPointTearOff*) const; |
47 bool isPointInStroke(SVGPointTearOff*) const; | 48 bool isPointInStroke(SVGPointTearOff*) const; |
48 | 49 |
49 void toClipPath(Path&) const; | 50 void toClipPath(Path&) const; |
50 | 51 |
52 SVGAnimatedNumber* pathLength() const { return m_pathLength.get(); } | |
fs
2016/11/24 11:57:59
I think we should hook this up to rendering too. t
Shanmuga Pandi
2016/11/28 10:14:47
Done.
| |
51 LayoutObject* createLayoutObject(const ComputedStyle&) override; | 53 LayoutObject* createLayoutObject(const ComputedStyle&) override; |
52 virtual float getTotalLength(); | 54 virtual float getTotalLength(); |
53 virtual SVGPointTearOff* getPointAtLength(float distance); | 55 virtual SVGPointTearOff* getPointAtLength(float distance); |
54 | 56 |
57 DECLARE_VIRTUAL_TRACE(); | |
58 | |
55 protected: | 59 protected: |
56 SVGGeometryElement(const QualifiedName&, | 60 SVGGeometryElement(const QualifiedName&, |
57 Document&, | 61 Document&, |
58 ConstructionType = CreateSVGElement); | 62 ConstructionType = CreateSVGElement); |
59 | 63 |
60 private: | 64 private: |
61 bool isSVGGeometryElement() const final { return true; } | 65 bool isSVGGeometryElement() const final { return true; } |
66 | |
67 Member<SVGAnimatedNumber> m_pathLength; | |
62 }; | 68 }; |
63 | 69 |
64 inline bool isSVGGeometryElement(const SVGElement& element) { | 70 inline bool isSVGGeometryElement(const SVGElement& element) { |
65 return element.isSVGGeometryElement(); | 71 return element.isSVGGeometryElement(); |
66 } | 72 } |
67 | 73 |
68 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGeometryElement); | 74 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGeometryElement); |
69 | 75 |
70 } // namespace blink | 76 } // namespace blink |
71 | 77 |
72 #endif // SVGGeometryElement_h | 78 #endif // SVGGeometryElement_h |
OLD | NEW |