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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 for (auto& animation : animations) { | 75 for (auto& animation : animations) { |
76 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor
(); | 76 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor
(); |
77 // Animations with a start time do not participate in compositor start-t
ime grouping. | 77 // Animations with a start time do not participate in compositor start-t
ime grouping. |
78 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup
, startOnCompositor)) { | 78 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup
, startOnCompositor)) { |
79 if (animation->hasActiveAnimationsOnCompositor() && !hadCompositorAn
imation) { | 79 if (animation->hasActiveAnimationsOnCompositor() && !hadCompositorAn
imation) { |
80 startedSynchronizedOnCompositor = true; | 80 startedSynchronizedOnCompositor = true; |
81 } | 81 } |
82 | 82 |
83 if (animation->playing() && !animation->hasStartTime() && animation-
>timeline() && animation->timeline()->isActive()) { | 83 if (animation->playing() && !animation->hasStartTime()) { |
84 waitingForStartTime.append(animation.get()); | 84 waitingForStartTime.append(animation.get()); |
85 } | 85 } |
86 } else { | 86 } else { |
87 deferred.append(animation); | 87 deferred.append(animation); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 // If any synchronized animations were started on the compositor, all | 91 // If any synchronized animations were started on the compositor, all |
92 // remaning synchronized animations need to wait for the synchronized | 92 // remaning synchronized animations need to wait for the synchronized |
93 // start time. Otherwise they may start immediately. | 93 // start time. Otherwise they may start immediately. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return false; | 135 return false; |
136 } | 136 } |
137 | 137 |
138 void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monoto
nicAnimationStartTime, int compositorGroup) | 138 void CompositorPendingAnimations::notifyCompositorAnimationStarted(double monoto
nicAnimationStartTime, int compositorGroup) |
139 { | 139 { |
140 TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimatio
nStarted"); | 140 TRACE_EVENT0("blink", "CompositorPendingAnimations::notifyCompositorAnimatio
nStarted"); |
141 HeapVector<Member<Animation>> animations; | 141 HeapVector<Member<Animation>> animations; |
142 animations.swap(m_waitingForCompositorAnimationStart); | 142 animations.swap(m_waitingForCompositorAnimationStart); |
143 | 143 |
144 for (auto animation : animations) { | 144 for (auto animation : animations) { |
145 if (animation->hasStartTime() || animation->playStateInternal() != Anima
tion::Pending || !animation->timeline() || !animation->timeline()->isActive()) { | 145 if (animation->hasStartTime() || animation->playStateInternal() != Anima
tion::Pending) { |
146 // Already started or no longer relevant. | 146 // Already started or no longer relevant. |
147 continue; | 147 continue; |
148 } | 148 } |
149 if (compositorGroup && animation->compositorGroup() != compositorGroup)
{ | 149 if (compositorGroup && animation->compositorGroup() != compositorGroup)
{ |
150 // Still waiting. | 150 // Still waiting. |
151 m_waitingForCompositorAnimationStart.append(animation); | 151 m_waitingForCompositorAnimationStart.append(animation); |
152 continue; | 152 continue; |
153 } | 153 } |
154 animation->notifyCompositorStartTime(monotonicAnimationStartTime - anima
tion->timeline()->zeroTime()); | 154 animation->notifyCompositorStartTime(monotonicAnimationStartTime - anima
tion->timeline()->zeroTime()); |
155 } | 155 } |
156 | 156 |
157 } | 157 } |
158 | 158 |
159 DEFINE_TRACE(CompositorPendingAnimations) | 159 DEFINE_TRACE(CompositorPendingAnimations) |
160 { | 160 { |
161 visitor->trace(m_pending); | 161 visitor->trace(m_pending); |
162 visitor->trace(m_waitingForCompositorAnimationStart); | 162 visitor->trace(m_waitingForCompositorAnimationStart); |
163 } | 163 } |
164 | 164 |
165 } // namespace | 165 } // namespace |
OLD | NEW |