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" | |
24 #include "platform/geometry/FloatPoint.h" | 23 #include "platform/geometry/FloatPoint.h" |
25 #include "platform/heap/Handle.h" | 24 #include "platform/heap/Handle.h" |
| 25 #include "wtf/Noncopyable.h" |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 | 28 |
29 enum FloatBlendMode { | 29 enum FloatBlendMode { |
30 BlendHorizontal, | 30 BlendHorizontal, |
31 BlendVertical | 31 BlendVertical |
32 }; | 32 }; |
33 | 33 |
34 struct PathSegmentData; | 34 struct PathSegmentData; |
| 35 class SVGPathConsumer; |
35 class SVGPathSource; | 36 class SVGPathSource; |
36 | 37 |
37 class SVGPathBlender : public NoBaseWillBeGarbageCollectedFinalized<SVGPathBlend
er> { | 38 class SVGPathBlender : public NoBaseWillBeGarbageCollectedFinalized<SVGPathBlend
er> { |
38 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVE
D(SVGPathBlender); | 39 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVE
D(SVGPathBlender); |
39 public: | 40 public: |
40 SVGPathBlender(SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathCo
nsumer*); | 41 SVGPathBlender(SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathCo
nsumer*); |
41 | 42 |
42 bool addAnimatedPath(unsigned repeatCount); | 43 bool addAnimatedPath(unsigned repeatCount); |
43 bool blendAnimatedPath(float); | 44 bool blendAnimatedPath(float); |
44 | 45 |
(...skipping 15 matching lines...) Expand all Loading... |
60 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); | 61 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); |
61 FloatPoint blendAnimatedFloatPointSameCoordinates(const FloatPoint& from, co
nst FloatPoint& to); | 62 FloatPoint blendAnimatedFloatPointSameCoordinates(const FloatPoint& from, co
nst FloatPoint& to); |
62 | 63 |
63 RawPtrWillBeMember<SVGPathSource> m_fromSource; | 64 RawPtrWillBeMember<SVGPathSource> m_fromSource; |
64 RawPtrWillBeMember<SVGPathSource> m_toSource; | 65 RawPtrWillBeMember<SVGPathSource> m_toSource; |
65 RawPtrWillBeMember<SVGPathConsumer> m_consumer; | 66 RawPtrWillBeMember<SVGPathConsumer> m_consumer; |
66 | 67 |
67 FloatPoint m_fromCurrentPoint; | 68 FloatPoint m_fromCurrentPoint; |
68 FloatPoint m_toCurrentPoint; | 69 FloatPoint m_toCurrentPoint; |
69 | 70 |
70 PathCoordinateMode m_fromMode; | |
71 PathCoordinateMode m_toMode; | |
72 float m_progress; | 71 float m_progress; |
73 unsigned m_addTypesCount; | 72 unsigned m_addTypesCount; |
74 bool m_isInFirstHalfOfAnimation; | 73 bool m_isInFirstHalfOfAnimation; |
| 74 // This is per-segment blend state corresponding to the 'from' and 'to' |
| 75 // segments currently being blended, and only used within blendSegments(). |
| 76 bool m_typesAreEqual; |
| 77 bool m_fromIsAbsolute; |
| 78 bool m_toIsAbsolute; |
75 }; | 79 }; |
76 | 80 |
77 } // namespace blink | 81 } // namespace blink |
78 | 82 |
79 #endif // SVGPathBlender_h | 83 #endif // SVGPathBlender_h |
OLD | NEW |