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/geometry/FloatPoint.h" |
24 #include "platform/heap/Handle.h" | 25 #include "platform/heap/Handle.h" |
25 | 26 |
26 namespace blink { | 27 namespace blink { |
27 | 28 |
28 enum FloatBlendMode { | 29 enum FloatBlendMode { |
29 BlendHorizontal, | 30 BlendHorizontal, |
30 BlendVertical | 31 BlendVertical |
31 }; | 32 }; |
32 | 33 |
33 struct PathSegmentData; | 34 struct PathSegmentData; |
34 class SVGPathSource; | 35 class SVGPathSource; |
35 | 36 |
36 class SVGPathBlender : public NoBaseWillBeGarbageCollectedFinalized<SVGPathBlend
er> { | 37 class SVGPathBlender : public NoBaseWillBeGarbageCollectedFinalized<SVGPathBlend
er> { |
37 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVE
D(SVGPathBlender); | 38 WTF_MAKE_NONCOPYABLE(SVGPathBlender); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVE
D(SVGPathBlender); |
38 public: | 39 public: |
39 SVGPathBlender(SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathCo
nsumer*); | 40 SVGPathBlender(SVGPathSource* fromSource, SVGPathSource* toSource, SVGPathCo
nsumer*); |
40 | 41 |
41 bool addAnimatedPath(unsigned repeatCount); | 42 bool addAnimatedPath(unsigned repeatCount); |
42 bool blendAnimatedPath(float); | 43 bool blendAnimatedPath(float); |
43 | 44 |
44 DECLARE_TRACE(); | 45 DECLARE_TRACE(); |
45 | 46 |
46 private: | 47 private: |
47 void blendMoveToSegment(const PathSegmentData& fromSeg, const PathSegmentDat
a& toSeg); | 48 PathSegmentData blendMoveToSegment(const PathSegmentData& fromSeg, const Pat
hSegmentData& toSeg); |
48 void blendLineToSegment(const PathSegmentData& fromSeg, const PathSegmentDat
a& toSeg); | 49 PathSegmentData blendLineToSegment(const PathSegmentData& fromSeg, const Pat
hSegmentData& toSeg); |
49 void blendLineToHorizontalSegment(const PathSegmentData& fromSeg, const Path
SegmentData& toSeg); | 50 PathSegmentData blendLineToHorizontalSegment(const PathSegmentData& fromSeg,
const PathSegmentData& toSeg); |
50 void blendLineToVerticalSegment(const PathSegmentData& fromSeg, const PathSe
gmentData& toSeg); | 51 PathSegmentData blendLineToVerticalSegment(const PathSegmentData& fromSeg, c
onst PathSegmentData& toSeg); |
51 void blendCurveToCubicSegment(const PathSegmentData& fromSeg, const PathSegm
entData& toSeg); | 52 PathSegmentData blendCurveToCubicSegment(const PathSegmentData& fromSeg, con
st PathSegmentData& toSeg); |
52 void blendCurveToCubicSmoothSegment(const PathSegmentData& fromSeg, const Pa
thSegmentData& toSeg); | 53 PathSegmentData blendCurveToCubicSmoothSegment(const PathSegmentData& fromSe
g, const PathSegmentData& toSeg); |
53 void blendCurveToQuadraticSegment(const PathSegmentData& fromSeg, const Path
SegmentData& toSeg); | 54 PathSegmentData blendCurveToQuadraticSegment(const PathSegmentData& fromSeg,
const PathSegmentData& toSeg); |
54 void blendCurveToQuadraticSmoothSegment(const PathSegmentData& fromSeg, cons
t PathSegmentData& toSeg); | 55 PathSegmentData blendCurveToQuadraticSmoothSegment(const PathSegmentData& fr
omSeg, const PathSegmentData& toSeg); |
55 void blendArcToSegment(const PathSegmentData& fromSeg, const PathSegmentData
& toSeg); | 56 PathSegmentData blendArcToSegment(const PathSegmentData& fromSeg, const Path
SegmentData& toSeg); |
| 57 void blendSegments(const PathSegmentData& fromSeg, const PathSegmentData& to
Seg); |
56 | 58 |
57 float blendAnimatedDimensonalFloat(float, float, FloatBlendMode); | 59 float blendAnimatedDimensonalFloat(float, float, FloatBlendMode); |
58 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); | 60 FloatPoint blendAnimatedFloatPoint(const FloatPoint& from, const FloatPoint&
to); |
59 FloatPoint blendAnimatedFloatPointSameCoordinates(const FloatPoint& from, co
nst FloatPoint& to); | 61 FloatPoint blendAnimatedFloatPointSameCoordinates(const FloatPoint& from, co
nst FloatPoint& to); |
60 | 62 |
61 RawPtrWillBeMember<SVGPathSource> m_fromSource; | 63 RawPtrWillBeMember<SVGPathSource> m_fromSource; |
62 RawPtrWillBeMember<SVGPathSource> m_toSource; | 64 RawPtrWillBeMember<SVGPathSource> m_toSource; |
63 RawPtrWillBeMember<SVGPathConsumer> m_consumer; | 65 RawPtrWillBeMember<SVGPathConsumer> m_consumer; |
64 | 66 |
65 FloatPoint m_fromCurrentPoint; | 67 FloatPoint m_fromCurrentPoint; |
66 FloatPoint m_toCurrentPoint; | 68 FloatPoint m_toCurrentPoint; |
67 | 69 |
68 PathCoordinateMode m_fromMode; | 70 PathCoordinateMode m_fromMode; |
69 PathCoordinateMode m_toMode; | 71 PathCoordinateMode m_toMode; |
70 float m_progress; | 72 float m_progress; |
71 unsigned m_addTypesCount; | 73 unsigned m_addTypesCount; |
72 bool m_isInFirstHalfOfAnimation; | 74 bool m_isInFirstHalfOfAnimation; |
73 }; | 75 }; |
74 | 76 |
75 } // namespace blink | 77 } // namespace blink |
76 | 78 |
77 #endif // SVGPathBlender_h | 79 #endif // SVGPathBlender_h |
OLD | NEW |