OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |