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

Side by Side 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: 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 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 void Layer::AddMainThreadScrollingReasons( 953 void Layer::AddMainThreadScrollingReasons(
954 uint32_t main_thread_scrolling_reasons) { 954 uint32_t main_thread_scrolling_reasons) {
955 DCHECK(IsPropertyChangeAllowed()); 955 DCHECK(IsPropertyChangeAllowed());
956 DCHECK(main_thread_scrolling_reasons); 956 DCHECK(main_thread_scrolling_reasons);
957 if (main_thread_scrolling_reasons_ == main_thread_scrolling_reasons) 957 if (main_thread_scrolling_reasons_ == main_thread_scrolling_reasons)
958 return; 958 return;
959 main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons; 959 main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons;
960 SetNeedsCommit(); 960 SetNeedsCommit();
961 } 961 }
962 962
963 void Layer::ClearMainThreadScrollingReasons() { 963 void Layer::ClearMainThreadScrollingReasons(
964 uint32_t main_thread_scrolling_reasons_to_clear) {
964 DCHECK(IsPropertyChangeAllowed()); 965 DCHECK(IsPropertyChangeAllowed());
965 if (!main_thread_scrolling_reasons_) 966 DCHECK(main_thread_scrolling_reasons_to_clear);
ajuma 2016/02/04 20:08:40 Is it possible that we reach here and main_thread_
ymalik 2016/02/04 21:53:20 Yeah totally. Perhaps we should do the same for Ad
ajuma 2016/02/04 22:45:29 Yes, please do.
966 return;
967 main_thread_scrolling_reasons_ = 967 main_thread_scrolling_reasons_ =
968 MainThreadScrollingReason::kNotScrollingOnMain; 968 ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
969 SetNeedsCommit(); 969 SetNeedsCommit();
970 } 970 }
971 971
972 void Layer::SetNonFastScrollableRegion(const Region& region) { 972 void Layer::SetNonFastScrollableRegion(const Region& region) {
973 DCHECK(IsPropertyChangeAllowed()); 973 DCHECK(IsPropertyChangeAllowed());
974 if (non_fast_scrollable_region_ == region) 974 if (non_fast_scrollable_region_ == region)
975 return; 975 return;
976 non_fast_scrollable_region_ = region; 976 non_fast_scrollable_region_ = region;
977 SetNeedsCommit(); 977 SetNeedsCommit();
978 } 978 }
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 this, layer_tree_host_->property_trees()->transform_tree); 2011 this, layer_tree_host_->property_trees()->transform_tree);
2012 } 2012 }
2013 2013
2014 gfx::Transform Layer::screen_space_transform() const { 2014 gfx::Transform Layer::screen_space_transform() const {
2015 DCHECK_NE(transform_tree_index_, -1); 2015 DCHECK_NE(transform_tree_index_, -1);
2016 return ScreenSpaceTransformFromPropertyTrees( 2016 return ScreenSpaceTransformFromPropertyTrees(
2017 this, layer_tree_host_->property_trees()->transform_tree); 2017 this, layer_tree_host_->property_trees()->transform_tree);
2018 } 2018 }
2019 2019
2020 } // namespace cc 2020 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698