OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (!visible && !m_timer.isActive()) { | 53 if (!visible && !m_timer.isActive()) { |
54 m_timer.startOneShot(0, FROM_HERE); | 54 m_timer.startOneShot(0, FROM_HERE); |
55 } | 55 } |
56 } | 56 } |
57 | 57 |
58 bool CompositorPendingAnimations::update(bool startOnCompositor) | 58 bool CompositorPendingAnimations::update(bool startOnCompositor) |
59 { | 59 { |
60 WillBeHeapVector<RawPtrWillBeMember<AnimationPlayer>> waitingForStartTime; | 60 WillBeHeapVector<RawPtrWillBeMember<AnimationPlayer>> waitingForStartTime; |
61 bool startedSynchronizedOnCompositor = false; | 61 bool startedSynchronizedOnCompositor = false; |
62 | 62 |
63 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > players; | 63 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> players; |
64 players.swap(m_pending); | 64 players.swap(m_pending); |
65 int compositorGroup = ++m_compositorGroup; | 65 int compositorGroup = ++m_compositorGroup; |
66 if (compositorGroup == 0) { | 66 if (compositorGroup == 0) { |
67 // Wrap around, skipping 0. | 67 // Wrap around, skipping 0. |
68 compositorGroup = ++m_compositorGroup; | 68 compositorGroup = ++m_compositorGroup; |
69 } | 69 } |
70 | 70 |
71 for (auto& player : players) { | 71 for (auto& player : players) { |
72 bool hadCompositorAnimation = player->hasActiveAnimationsOnCompositor(); | 72 bool hadCompositorAnimation = player->hasActiveAnimationsOnCompositor(); |
73 player->preCommit(compositorGroup, startOnCompositor); | 73 player->preCommit(compositorGroup, startOnCompositor); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // If not, go ahead and start any animations that were waiting. | 118 // If not, go ahead and start any animations that were waiting. |
119 notifyCompositorAnimationStarted(monotonicallyIncreasingTime()); | 119 notifyCompositorAnimationStarted(monotonicallyIncreasingTime()); |
120 | 120 |
121 ASSERT(m_pending.isEmpty()); | 121 ASSERT(m_pending.isEmpty()); |
122 return false; | 122 return false; |
123 } | 123 } |
124 | 124 |
125 void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monoto
nicAnimationStartTime, int compositorGroup) | 125 void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monoto
nicAnimationStartTime, int compositorGroup) |
126 { | 126 { |
127 TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimatio
nStarted"); | 127 TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimatio
nStarted"); |
128 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > players; | 128 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> players; |
129 players.swap(m_waitingForCompositorAnimationStart); | 129 players.swap(m_waitingForCompositorAnimationStart); |
130 | 130 |
131 for (auto player : players) { | 131 for (auto player : players) { |
132 if (player->hasStartTime() || player->playStateInternal() != AnimationPl
ayer::Pending) { | 132 if (player->hasStartTime() || player->playStateInternal() != AnimationPl
ayer::Pending) { |
133 // Already started or no longer relevant. | 133 // Already started or no longer relevant. |
134 continue; | 134 continue; |
135 } | 135 } |
136 if (compositorGroup && player->compositorGroup() != compositorGroup) { | 136 if (compositorGroup && player->compositorGroup() != compositorGroup) { |
137 // Still waiting. | 137 // Still waiting. |
138 m_waitingForCompositorAnimationStart.append(player); | 138 m_waitingForCompositorAnimationStart.append(player); |
139 continue; | 139 continue; |
140 } | 140 } |
141 player->notifyCompositorStartTime(monotonicAnimationStartTime - player->
timeline()->zeroTime()); | 141 player->notifyCompositorStartTime(monotonicAnimationStartTime - player->
timeline()->zeroTime()); |
142 } | 142 } |
143 | 143 |
144 } | 144 } |
145 | 145 |
146 DEFINE_TRACE(CompositorPendingAnimations) | 146 DEFINE_TRACE(CompositorPendingAnimations) |
147 { | 147 { |
148 visitor->trace(m_pending); | 148 visitor->trace(m_pending); |
149 visitor->trace(m_waitingForCompositorAnimationStart); | 149 visitor->trace(m_waitingForCompositorAnimationStart); |
150 } | 150 } |
151 | 151 |
152 } // namespace | 152 } // namespace |
OLD | NEW |