Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove fn to clear all main thread scrolling reasons Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698