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

Unified Diff: cc/layers/layer.cc

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: skip irrelevant test on mac 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index a453f4f46059d52a4738ca5a86ca33d84fe39bd3..e7053a818eb0e98ff55d4d820298846a488fb5b3 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -966,18 +966,23 @@ void Layer::AddMainThreadScrollingReasons(
uint32_t main_thread_scrolling_reasons) {
DCHECK(IsPropertyChangeAllowed());
DCHECK(main_thread_scrolling_reasons);
- if (main_thread_scrolling_reasons_ == main_thread_scrolling_reasons)
+ uint32_t new_reasons =
+ main_thread_scrolling_reasons_ | main_thread_scrolling_reasons;
+ if (main_thread_scrolling_reasons_ == new_reasons)
return;
- main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons;
+ main_thread_scrolling_reasons_ = new_reasons;
SetNeedsCommit();
}
-void Layer::ClearMainThreadScrollingReasons() {
+void Layer::ClearMainThreadScrollingReasons(
+ uint32_t main_thread_scrolling_reasons_to_clear) {
DCHECK(IsPropertyChangeAllowed());
- if (!main_thread_scrolling_reasons_)
+ DCHECK(main_thread_scrolling_reasons_to_clear);
+ uint32_t new_reasons =
+ ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
+ if (new_reasons == main_thread_scrolling_reasons_)
return;
- main_thread_scrolling_reasons_ =
- MainThreadScrollingReason::kNotScrollingOnMain;
+ main_thread_scrolling_reasons_ = new_reasons;
SetNeedsCommit();
}
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698