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

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: 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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 return; 959 return;
960 user_scrollable_horizontal_ = horizontal; 960 user_scrollable_horizontal_ = horizontal;
961 user_scrollable_vertical_ = vertical; 961 user_scrollable_vertical_ = vertical;
962 SetNeedsCommit(); 962 SetNeedsCommit();
963 } 963 }
964 964
965 void Layer::AddMainThreadScrollingReasons( 965 void Layer::AddMainThreadScrollingReasons(
966 uint32_t main_thread_scrolling_reasons) { 966 uint32_t main_thread_scrolling_reasons) {
967 DCHECK(IsPropertyChangeAllowed()); 967 DCHECK(IsPropertyChangeAllowed());
968 DCHECK(main_thread_scrolling_reasons); 968 DCHECK(main_thread_scrolling_reasons);
969 if (main_thread_scrolling_reasons_ == main_thread_scrolling_reasons) 969 uint32_t new_reasons =
970 main_thread_scrolling_reasons_ | main_thread_scrolling_reasons;
971 if (main_thread_scrolling_reasons_ == new_reasons)
970 return; 972 return;
971 main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons; 973 main_thread_scrolling_reasons_ = new_reasons;
972 SetNeedsCommit(); 974 SetNeedsCommit();
973 } 975 }
974 976
975 void Layer::ClearMainThreadScrollingReasons() { 977 void Layer::ClearMainThreadScrollingReasons(
978 uint32_t main_thread_scrolling_reasons_to_clear) {
976 DCHECK(IsPropertyChangeAllowed()); 979 DCHECK(IsPropertyChangeAllowed());
977 if (!main_thread_scrolling_reasons_) 980 DCHECK(main_thread_scrolling_reasons_to_clear);
981 uint32_t new_reasons =
982 ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
983 if (new_reasons == main_thread_scrolling_reasons_)
978 return; 984 return;
979 main_thread_scrolling_reasons_ = 985 main_thread_scrolling_reasons_ = new_reasons;
980 MainThreadScrollingReason::kNotScrollingOnMain;
981 SetNeedsCommit(); 986 SetNeedsCommit();
982 } 987 }
983 988
984 void Layer::SetNonFastScrollableRegion(const Region& region) { 989 void Layer::SetNonFastScrollableRegion(const Region& region) {
985 DCHECK(IsPropertyChangeAllowed()); 990 DCHECK(IsPropertyChangeAllowed());
986 if (non_fast_scrollable_region_ == region) 991 if (non_fast_scrollable_region_ == region)
987 return; 992 return;
988 non_fast_scrollable_region_ = region; 993 non_fast_scrollable_region_ = region;
989 SetNeedsCommit(); 994 SetNeedsCommit();
990 } 995 }
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 this, layer_tree_host_->property_trees()->transform_tree); 2074 this, layer_tree_host_->property_trees()->transform_tree);
2070 } 2075 }
2071 2076
2072 gfx::Transform Layer::screen_space_transform() const { 2077 gfx::Transform Layer::screen_space_transform() const {
2073 DCHECK_NE(transform_tree_index_, -1); 2078 DCHECK_NE(transform_tree_index_, -1);
2074 return ScreenSpaceTransformFromPropertyTrees( 2079 return ScreenSpaceTransformFromPropertyTrees(
2075 this, layer_tree_host_->property_trees()->transform_tree); 2080 this, layer_tree_host_->property_trees()->transform_tree);
2076 } 2081 }
2077 2082
2078 } // namespace cc 2083 } // namespace cc
OLDNEW
« 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