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

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: updated layout test 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 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 return; 947 return;
948 user_scrollable_horizontal_ = horizontal; 948 user_scrollable_horizontal_ = horizontal;
949 user_scrollable_vertical_ = vertical; 949 user_scrollable_vertical_ = vertical;
950 SetNeedsCommit(); 950 SetNeedsCommit();
951 } 951 }
952 952
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 uint32_t new_reasons =
958 main_thread_scrolling_reasons_ | main_thread_scrolling_reasons;
959 if (main_thread_scrolling_reasons_ == new_reasons)
958 return; 960 return;
959 main_thread_scrolling_reasons_ |= main_thread_scrolling_reasons; 961 main_thread_scrolling_reasons_ = new_reasons;
960 SetNeedsCommit(); 962 SetNeedsCommit();
961 } 963 }
962 964
963 void Layer::ClearMainThreadScrollingReasons() { 965 void Layer::ClearMainThreadScrollingReasons(
966 uint32_t main_thread_scrolling_reasons_to_clear) {
964 DCHECK(IsPropertyChangeAllowed()); 967 DCHECK(IsPropertyChangeAllowed());
965 if (!main_thread_scrolling_reasons_) 968 DCHECK(main_thread_scrolling_reasons_to_clear);
969 uint32_t new_reasons =
970 ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
971 if (new_reasons == main_thread_scrolling_reasons_)
966 return; 972 return;
967 main_thread_scrolling_reasons_ = 973 main_thread_scrolling_reasons_ = new_reasons;
968 MainThreadScrollingReason::kNotScrollingOnMain;
969 SetNeedsCommit(); 974 SetNeedsCommit();
970 } 975 }
971 976
972 void Layer::SetNonFastScrollableRegion(const Region& region) { 977 void Layer::SetNonFastScrollableRegion(const Region& region) {
973 DCHECK(IsPropertyChangeAllowed()); 978 DCHECK(IsPropertyChangeAllowed());
974 if (non_fast_scrollable_region_ == region) 979 if (non_fast_scrollable_region_ == region)
975 return; 980 return;
976 non_fast_scrollable_region_ = region; 981 non_fast_scrollable_region_ = region;
977 SetNeedsCommit(); 982 SetNeedsCommit();
978 } 983 }
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 this, layer_tree_host_->property_trees()->transform_tree); 2016 this, layer_tree_host_->property_trees()->transform_tree);
2012 } 2017 }
2013 2018
2014 gfx::Transform Layer::screen_space_transform() const { 2019 gfx::Transform Layer::screen_space_transform() const {
2015 DCHECK_NE(transform_tree_index_, -1); 2020 DCHECK_NE(transform_tree_index_, -1);
2016 return ScreenSpaceTransformFromPropertyTrees( 2021 return ScreenSpaceTransformFromPropertyTrees(
2017 this, layer_tree_host_->property_trees()->transform_tree); 2022 this, layer_tree_host_->property_trees()->transform_tree);
2018 } 2023 }
2019 2024
2020 } // namespace cc 2025 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698