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

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

Issue 2531603003: Only scroll on main if the targeted frames need to scroll on main (Closed)
Patch Set: Resolve conflict Created 4 years 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 // Main thread should deal with the scroll animations it started. 355 // Main thread should deal with the scroll animations it started.
356 if (sentToCompositor || runningOnMainThread) 356 if (sentToCompositor || runningOnMainThread)
357 addMainThreadScrollingReason(); 357 addMainThreadScrollingReason();
358 else 358 else
359 removeMainThreadScrollingReason(); 359 removeMainThreadScrollingReason();
360 } 360 }
361 } 361 }
362 362
363 void ScrollAnimator::addMainThreadScrollingReason() { 363 void ScrollAnimator::addMainThreadScrollingReason() {
364 // TODO(yigu): Should update the frame tree to make sure
365 // the same reason is set for subframes. crbug.com/675677.
364 if (WebLayer* scrollLayer = 366 if (WebLayer* scrollLayer =
365 toWebLayer(getScrollableArea()->layerForScrolling())) { 367 toWebLayer(getScrollableArea()->layerForScrolling())) {
366 scrollLayer->addMainThreadScrollingReasons( 368 scrollLayer->addMainThreadScrollingReasons(
367 MainThreadScrollingReason::kHandlingScrollFromMainThread); 369 MainThreadScrollingReason::kHandlingScrollFromMainThread);
368 } 370 }
369 } 371 }
370 372
371 void ScrollAnimator::removeMainThreadScrollingReason() { 373 void ScrollAnimator::removeMainThreadScrollingReason() {
372 if (WebLayer* scrollLayer = 374 if (WebLayer* scrollLayer =
373 toWebLayer(getScrollableArea()->layerForScrolling())) { 375 toWebLayer(getScrollableArea()->layerForScrolling())) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 return false; 434 return false;
433 } 435 }
434 return true; 436 return true;
435 } 437 }
436 438
437 DEFINE_TRACE(ScrollAnimator) { 439 DEFINE_TRACE(ScrollAnimator) {
438 ScrollAnimatorBase::trace(visitor); 440 ScrollAnimatorBase::trace(visitor);
439 } 441 }
440 442
441 } // namespace blink 443 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698