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

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: finish animations on main 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(
964 uint32_t main_thread_scrolling_reasons_to_clear) {
965 DCHECK(IsPropertyChangeAllowed());
966 DCHECK(main_thread_scrolling_reasons_to_clear);
967 main_thread_scrolling_reasons_ =
968 ~main_thread_scrolling_reasons_to_clear & main_thread_scrolling_reasons_;
969 SetNeedsCommit();
970 }
971
963 void Layer::ClearMainThreadScrollingReasons() { 972 void Layer::ClearMainThreadScrollingReasons() {
964 DCHECK(IsPropertyChangeAllowed()); 973 DCHECK(IsPropertyChangeAllowed());
965 if (!main_thread_scrolling_reasons_) 974 if (!main_thread_scrolling_reasons_)
966 return; 975 return;
967 main_thread_scrolling_reasons_ = 976 main_thread_scrolling_reasons_ =
968 MainThreadScrollingReason::kNotScrollingOnMain; 977 MainThreadScrollingReason::kNotScrollingOnMain;
969 SetNeedsCommit(); 978 SetNeedsCommit();
970 } 979 }
971 980
972 void Layer::SetNonFastScrollableRegion(const Region& region) { 981 void Layer::SetNonFastScrollableRegion(const Region& region) {
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 this, layer_tree_host_->property_trees()->transform_tree); 2020 this, layer_tree_host_->property_trees()->transform_tree);
2012 } 2021 }
2013 2022
2014 gfx::Transform Layer::screen_space_transform() const { 2023 gfx::Transform Layer::screen_space_transform() const {
2015 DCHECK_NE(transform_tree_index_, -1); 2024 DCHECK_NE(transform_tree_index_, -1);
2016 return ScreenSpaceTransformFromPropertyTrees( 2025 return ScreenSpaceTransformFromPropertyTrees(
2017 this, layer_tree_host_->property_trees()->transform_tree); 2026 this, layer_tree_host_->property_trees()->transform_tree);
2018 } 2027 }
2019 2028
2020 } // namespace cc 2029 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698