Chromium Code Reviews| Index: Source/core/animation/CompositorPendingAnimations.cpp |
| diff --git a/Source/core/animation/CompositorPendingAnimations.cpp b/Source/core/animation/CompositorPendingAnimations.cpp |
| index 06c0fd0c8c23e5c481deb94c3979575afdd2a711..28ee306a8579feb2980ecd42c562e05bc598b356 100644 |
| --- a/Source/core/animation/CompositorPendingAnimations.cpp |
| +++ b/Source/core/animation/CompositorPendingAnimations.cpp |
| @@ -65,14 +65,17 @@ bool CompositorPendingAnimations::update(bool startOnCompositor) |
| HeapVector<Member<Animation>> deferred; |
| animations.swap(m_pending); |
| int compositorGroup = ++m_compositorGroup; |
| - if (compositorGroup == 0) { |
| - // Wrap around, skipping 0. |
| + while (compositorGroup == 0 || compositorGroup == 1) { |
|
alancutter (OOO until 2018)
2015/09/16 05:35:30
Nit: We should use an enum instead of magic number
|
| + // Wrap around, skipping 0, 1. |
| + // * 0 is reserved for automatic assignment |
| + // * 1 is used for animations with a specified start time |
| compositorGroup = ++m_compositorGroup; |
| } |
| for (auto& animation : animations) { |
| bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor(); |
| - if (animation->preCommit(compositorGroup, startOnCompositor)) { |
| + // Animations with a start time do not participate in compositor start-time grouping. |
| + if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup, startOnCompositor)) { |
| if (animation->hasActiveAnimationsOnCompositor() && !hadCompositorAnimation) { |
| startedSynchronizedOnCompositor = true; |
| } |