OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool hasActiveAnimation() const; | 83 bool hasActiveAnimation() const; |
84 | 84 |
85 // Returns true if there is an animation currently animating the given prope
rty, or | 85 // Returns true if there is an animation currently animating the given prope
rty, or |
86 // if there is an animation scheduled to animate this property in the future
. | 86 // if there is an animation scheduled to animate this property in the future
. |
87 bool isAnimatingProperty(CCActiveAnimation::TargetProperty) const; | 87 bool isAnimatingProperty(CCActiveAnimation::TargetProperty) const; |
88 | 88 |
89 // This is called in response to an animation being started on the impl thre
ad. This | 89 // This is called in response to an animation being started on the impl thre
ad. This |
90 // function updates the corresponding main thread animation's start time. | 90 // function updates the corresponding main thread animation's start time. |
91 void notifyAnimationStarted(const CCAnimationEvent&); | 91 void notifyAnimationStarted(const CCAnimationEvent&); |
92 | 92 |
| 93 // If a sync is forced, then the next time animation updates are pushed to t
he impl |
| 94 // thread, all animations will be transferred. |
| 95 void setForceSync() { m_forceSync = true; } |
| 96 |
| 97 void setClient(CCLayerAnimationControllerClient*); |
| 98 |
93 protected: | 99 protected: |
94 explicit CCLayerAnimationController(CCLayerAnimationControllerClient*); | 100 explicit CCLayerAnimationController(CCLayerAnimationControllerClient*); |
95 | 101 |
96 private: | 102 private: |
97 typedef HashSet<int> TargetProperties; | 103 typedef HashSet<int> TargetProperties; |
98 | 104 |
99 void pushNewAnimationsToImplThread(CCLayerAnimationController*) const; | 105 void pushNewAnimationsToImplThread(CCLayerAnimationController*) const; |
100 void removeAnimationsCompletedOnMainThread(CCLayerAnimationController*) cons
t; | 106 void removeAnimationsCompletedOnMainThread(CCLayerAnimationController*) cons
t; |
101 void pushPropertiesToImplThread(CCLayerAnimationController*) const; | 107 void pushPropertiesToImplThread(CCLayerAnimationController*) const; |
| 108 void replaceImplThreadAnimations(CCLayerAnimationController*) const; |
102 | 109 |
103 void startAnimationsWaitingForNextTick(double monotonicTime, CCAnimationEven
tsVector*); | 110 void startAnimationsWaitingForNextTick(double monotonicTime, CCAnimationEven
tsVector*); |
104 void startAnimationsWaitingForStartTime(double monotonicTime, CCAnimationEve
ntsVector*); | 111 void startAnimationsWaitingForStartTime(double monotonicTime, CCAnimationEve
ntsVector*); |
105 void startAnimationsWaitingForTargetAvailability(double monotonicTime, CCAni
mationEventsVector*); | 112 void startAnimationsWaitingForTargetAvailability(double monotonicTime, CCAni
mationEventsVector*); |
106 void resolveConflicts(double monotonicTime); | 113 void resolveConflicts(double monotonicTime); |
107 void purgeFinishedAnimations(double monotonicTime, CCAnimationEventsVector*)
; | 114 void purgeFinishedAnimations(double monotonicTime, CCAnimationEventsVector*)
; |
108 | 115 |
109 void tickAnimations(double monotonicTime); | 116 void tickAnimations(double monotonicTime); |
110 | 117 |
| 118 // If this is true, we force a sync to the impl thread. |
| 119 bool m_forceSync; |
| 120 |
111 CCLayerAnimationControllerClient* m_client; | 121 CCLayerAnimationControllerClient* m_client; |
112 Vector<OwnPtr<CCActiveAnimation> > m_activeAnimations; | 122 Vector<OwnPtr<CCActiveAnimation> > m_activeAnimations; |
113 }; | 123 }; |
114 | 124 |
115 } // namespace WebCore | 125 } // namespace WebCore |
116 | 126 |
117 #endif // CCLayerAnimationController_h | 127 #endif // CCLayerAnimationController_h |
OLD | NEW |