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

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: todo + nit 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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 return; 949 return;
950 user_scrollable_horizontal_ = horizontal; 950 user_scrollable_horizontal_ = horizontal;
951 user_scrollable_vertical_ = vertical; 951 user_scrollable_vertical_ = vertical;
952 SetNeedsCommit(); 952 SetNeedsCommit();
953 } 953 }
954 954
955 void Layer::AddMainThreadScrollingReasons( 955 void Layer::AddMainThreadScrollingReasons(
956 uint32_t main_thread_scrolling_reasons) { 956 uint32_t main_thread_scrolling_reasons) {
957 DCHECK(IsPropertyChangeAllowed()); 957 DCHECK(IsPropertyChangeAllowed());
958 DCHECK(main_thread_scrolling_reasons); 958 DCHECK(main_thread_scrolling_reasons);
959 if (main_thread_scrolling_reasons_ == main_thread_scrolling_reasons) 959 uint32_t new_reasons =
960 main_thread_scrolling_reasons_ | main_thread_scrolling_reasons;
961 if (main_thread_scrolling_reasons_ == new_reasons)
960 return; 962 return;
961 main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons; 963 main_thread_scrolling_reasons_ = new_reasons;
962 SetNeedsCommit(); 964 SetNeedsCommit();
963 } 965 }
964 966
965 void Layer::ClearMainThreadScrollingReasons() { 967 void Layer::ClearMainThreadScrollingReasons(
968 uint32_t main_thread_scrolling_reasons_to_clear) {
966 DCHECK(IsPropertyChangeAllowed()); 969 DCHECK(IsPropertyChangeAllowed());
967 if (!main_thread_scrolling_reasons_) 970 DCHECK(main_thread_scrolling_reasons_to_clear);
971 uint32_t new_reasons =
972 ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
973 if (new_reasons == main_thread_scrolling_reasons_)
968 return; 974 return;
969 main_thread_scrolling_reasons_ = 975 main_thread_scrolling_reasons_ = new_reasons;
970 MainThreadScrollingReason::kNotScrollingOnMain;
971 SetNeedsCommit(); 976 SetNeedsCommit();
972 } 977 }
973 978
974 void Layer::SetNonFastScrollableRegion(const Region& region) { 979 void Layer::SetNonFastScrollableRegion(const Region& region) {
975 DCHECK(IsPropertyChangeAllowed()); 980 DCHECK(IsPropertyChangeAllowed());
976 if (non_fast_scrollable_region_ == region) 981 if (non_fast_scrollable_region_ == region)
977 return; 982 return;
978 non_fast_scrollable_region_ = region; 983 non_fast_scrollable_region_ = region;
979 SetNeedsCommit(); 984 SetNeedsCommit();
980 } 985 }
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 this, layer_tree_host_->property_trees()->transform_tree); 2032 this, layer_tree_host_->property_trees()->transform_tree);
2028 } 2033 }
2029 2034
2030 gfx::Transform Layer::screen_space_transform() const { 2035 gfx::Transform Layer::screen_space_transform() const {
2031 DCHECK_NE(transform_tree_index_, -1); 2036 DCHECK_NE(transform_tree_index_, -1);
2032 return ScreenSpaceTransformFromPropertyTrees( 2037 return ScreenSpaceTransformFromPropertyTrees(
2033 this, layer_tree_host_->property_trees()->transform_tree); 2038 this, layer_tree_host_->property_trees()->transform_tree);
2034 } 2039 }
2035 2040
2036 } // namespace cc 2041 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698