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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 int compositorGroup = ++m_compositorGroup; | 64 int compositorGroup = ++m_compositorGroup; |
65 while (compositorGroup == 0 || compositorGroup == 1) { | 65 while (compositorGroup == 0 || compositorGroup == 1) { |
66 // Wrap around, skipping 0, 1. | 66 // Wrap around, skipping 0, 1. |
67 // * 0 is reserved for automatic assignment | 67 // * 0 is reserved for automatic assignment |
68 // * 1 is used for animations with a specified start time | 68 // * 1 is used for animations with a specified start time |
69 compositorGroup = ++m_compositorGroup; | 69 compositorGroup = ++m_compositorGroup; |
70 } | 70 } |
71 | 71 |
72 for (auto& animation : animations) { | 72 for (auto& animation : animations) { |
73 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor(); | 73 bool hadCompositorAnimation = animation->hasActiveAnimationsOnCompositor(); |
74 // Animations with a start time do not participate in compositor start-time
grouping. | 74 // Animations with a start time do not participate in compositor start-time |
| 75 // grouping. |
75 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup, | 76 if (animation->preCommit(animation->hasStartTime() ? 1 : compositorGroup, |
76 startOnCompositor)) { | 77 startOnCompositor)) { |
77 if (animation->hasActiveAnimationsOnCompositor() && | 78 if (animation->hasActiveAnimationsOnCompositor() && |
78 !hadCompositorAnimation) { | 79 !hadCompositorAnimation) { |
79 startedSynchronizedOnCompositor = true; | 80 startedSynchronizedOnCompositor = true; |
80 } | 81 } |
81 | 82 |
82 if (animation->playing() && !animation->hasStartTime() && | 83 if (animation->playing() && !animation->hasStartTime() && |
83 animation->timeline() && animation->timeline()->isActive()) { | 84 animation->timeline() && animation->timeline()->isActive()) { |
84 waitingForStartTime.append(animation.get()); | 85 waitingForStartTime.append(animation.get()); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 animation->timeline()->zeroTime()); | 160 animation->timeline()->zeroTime()); |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
163 DEFINE_TRACE(CompositorPendingAnimations) { | 164 DEFINE_TRACE(CompositorPendingAnimations) { |
164 visitor->trace(m_pending); | 165 visitor->trace(m_pending); |
165 visitor->trace(m_waitingForCompositorAnimationStart); | 166 visitor->trace(m_waitingForCompositorAnimationStart); |
166 } | 167 } |
167 | 168 |
168 } // namespace blink | 169 } // namespace blink |
OLD | NEW |