OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #ifndef SVGPathBlender_h | 20 #ifndef SVGPathBlender_h |
21 #define SVGPathBlender_h | 21 #define SVGPathBlender_h |
22 | 22 |
23 #include "core/svg/SVGPathConsumer.h" | 23 #include "core/svg/SVGPathConsumer.h" |
| 24 #include "platform/heap/Handle.h" |
24 | 25 |
25 namespace blink { | 26 namespace blink { |
26 | 27 |
27 enum FloatBlendMode { | 28 enum FloatBlendMode { |
28 BlendHorizontal, | 29 BlendHorizontal, |
29 BlendVertical | 30 BlendVertical |
30 }; | 31 }; |
31 | 32 |
32 class SVGPathSource; | 33 class SVGPathSource; |
33 | 34 |
34 class SVGPathBlender { | 35 class SVGPathBlender : public NoBaseWillBeGarbageCollectedFinalized<SVGPathBlend
er> { |
35 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED; | 36 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVE
D; |
36 public: | 37 public: |
37 SVGPathBlender(); | 38 SVGPathBlender(); |
38 | 39 |
39 bool addAnimatedPath(SVGPathSource*, SVGPathSource*, SVGPathConsumer*, unsig
ned repeatCount); | 40 bool addAnimatedPath(SVGPathSource*, SVGPathSource*, SVGPathConsumer*, unsig
ned repeatCount); |
40 bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsume
r*); | 41 bool blendAnimatedPath(float, SVGPathSource*, SVGPathSource*, SVGPathConsume
r*); |
41 void cleanup(); | 42 void cleanup(); |
42 | 43 |
| 44 void trace(Visitor*); |
| 45 |
43 private: | 46 private: |
44 bool blendMoveToSegment(); | 47 bool blendMoveToSegment(); |
45 bool blendLineToSegment(); | 48 bool blendLineToSegment(); |
46 bool blendLineToHorizontalSegment(); | 49 bool blendLineToHorizontalSegment(); |
47 bool blendLineToVerticalSegment(); | 50 bool blendLineToVerticalSegment(); |
48 bool blendCurveToCubicSegment(); | 51 bool blendCurveToCubicSegment(); |
49 bool blendCurveToCubicSmoothSegment(); | 52 bool blendCurveToCubicSmoothSegment(); |
50 bool blendCurveToQuadraticSegment(); | 53 bool blendCurveToQuadraticSegment(); |
51 bool blendCurveToQuadraticSmoothSegment(); | 54 bool blendCurveToQuadraticSmoothSegment(); |
52 bool blendArcToSegment(); | 55 bool blendArcToSegment(); |
53 | 56 |
54 float blendAnimatedDimensonalFloat(float, float, FloatBlendMode); | 57 float blendAnimatedDimensonalFloat(float, float, FloatBlendMode); |
55 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); | 58 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); |
56 | 59 |
57 SVGPathSource* m_fromSource; | 60 RawPtrWillBeMember<SVGPathSource> m_fromSource; |
58 SVGPathSource* m_toSource; | 61 RawPtrWillBeMember<SVGPathSource> m_toSource; |
59 SVGPathConsumer* m_consumer; | 62 RawPtrWillBeMember<SVGPathConsumer> m_consumer; |
60 | 63 |
61 FloatPoint m_fromCurrentPoint; | 64 FloatPoint m_fromCurrentPoint; |
62 FloatPoint m_toCurrentPoint; | 65 FloatPoint m_toCurrentPoint; |
63 | 66 |
64 PathCoordinateMode m_fromMode; | 67 PathCoordinateMode m_fromMode; |
65 PathCoordinateMode m_toMode; | 68 PathCoordinateMode m_toMode; |
66 float m_progress; | 69 float m_progress; |
67 unsigned m_addTypesCount; | 70 unsigned m_addTypesCount; |
68 bool m_isInFirstHalfOfAnimation; | 71 bool m_isInFirstHalfOfAnimation; |
69 }; | 72 }; |
70 | 73 |
71 } // namespace blink | 74 } // namespace blink |
72 | 75 |
73 #endif // SVGPathBlender_h | 76 #endif // SVGPathBlender_h |
OLD | NEW |