OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 int animationGroupId = animation->group(); | 252 int animationGroupId = animation->group(); |
253 | 253 |
254 sentToCompositor = addAnimation(animation.release()); | 254 sentToCompositor = addAnimation(animation.release()); |
255 if (sentToCompositor) { | 255 if (sentToCompositor) { |
256 m_runState = RunState::RunningOnCompositor; | 256 m_runState = RunState::RunningOnCompositor; |
257 m_compositorAnimationId = animationId; | 257 m_compositorAnimationId = animationId; |
258 m_compositorAnimationGroupId = animationGroupId; | 258 m_compositorAnimationGroupId = animationGroupId; |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
| 262 bool runningOnMainThread = false; |
262 if (!sentToCompositor) { | 263 if (!sentToCompositor) { |
263 if (registerAndScheduleAnimation()) | 264 runningOnMainThread = registerAndScheduleAnimation(); |
| 265 if (runningOnMainThread) |
264 m_runState = RunState::RunningOnMainThread; | 266 m_runState = RunState::RunningOnMainThread; |
265 } | 267 } |
| 268 |
| 269 // Main thread should deal with the scroll animations it started. |
| 270 if (sentToCompositor || runningOnMainThread) |
| 271 addMainThreadScrollingReason(); |
266 } | 272 } |
267 } | 273 } |
268 | 274 |
269 void ScrollAnimator::notifyCompositorAnimationAborted(int groupId) | 275 void ScrollAnimator::notifyCompositorAnimationAborted(int groupId) |
270 { | 276 { |
271 // An animation aborted by the compositor is treated as a finished | 277 // An animation aborted by the compositor is treated as a finished |
272 // animation. | 278 // animation. |
273 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId); | 279 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId); |
274 } | 280 } |
275 | 281 |
(...skipping 23 matching lines...) Expand all Loading... |
299 } | 305 } |
300 return true; | 306 return true; |
301 } | 307 } |
302 | 308 |
303 DEFINE_TRACE(ScrollAnimator) | 309 DEFINE_TRACE(ScrollAnimator) |
304 { | 310 { |
305 ScrollAnimatorBase::trace(visitor); | 311 ScrollAnimatorBase::trace(visitor); |
306 } | 312 } |
307 | 313 |
308 } // namespace blink | 314 } // namespace blink |
OLD | NEW |