OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <stack> | 8 #include <stack> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 } | 964 } |
965 | 965 |
966 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) { | 966 void LayerTreeHost::SetDeviceScaleFactor(float device_scale_factor) { |
967 if (device_scale_factor == device_scale_factor_) | 967 if (device_scale_factor == device_scale_factor_) |
968 return; | 968 return; |
969 device_scale_factor_ = device_scale_factor; | 969 device_scale_factor_ = device_scale_factor; |
970 | 970 |
971 SetNeedsCommit(); | 971 SetNeedsCommit(); |
972 } | 972 } |
973 | 973 |
974 void LayerTreeHost::UpdateTopControlsState(bool enable_hiding, | 974 void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, |
975 bool enable_showing, | 975 TopControlsState current, |
976 bool animate) { | 976 bool animate) { |
977 if (!settings_.calculate_top_controls_position) | 977 if (!settings_.calculate_top_controls_position) |
978 return; | 978 return; |
979 | 979 |
980 // Top controls are only used in threaded mode. | 980 // Top controls are only used in threaded mode. |
981 proxy_->ImplThread()->PostTask( | 981 proxy_->ImplThread()->PostTask( |
982 base::Bind(&TopControlsManager::UpdateTopControlsState, | 982 base::Bind(&TopControlsManager::UpdateTopControlsState, |
983 top_controls_manager_weak_ptr_, | 983 top_controls_manager_weak_ptr_, |
984 enable_hiding, | 984 constraints, |
985 enable_showing, | 985 current, |
986 animate)); | 986 animate)); |
987 } | 987 } |
988 | 988 |
989 bool LayerTreeHost::BlocksPendingCommit() const { | 989 bool LayerTreeHost::BlocksPendingCommit() const { |
990 if (!root_layer_) | 990 if (!root_layer_) |
991 return false; | 991 return false; |
992 return root_layer_->BlocksPendingCommitRecursive(); | 992 return root_layer_->BlocksPendingCommitRecursive(); |
993 } | 993 } |
994 | 994 |
995 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { | 995 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { |
(...skipping 21 matching lines...) Expand all Loading... |
1017 bool start_ready_animations = true; | 1017 bool start_ready_animations = true; |
1018 (*iter).second->UpdateState(start_ready_animations, NULL); | 1018 (*iter).second->UpdateState(start_ready_animations, NULL); |
1019 } | 1019 } |
1020 } | 1020 } |
1021 | 1021 |
1022 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1022 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
1023 return proxy_->CapturePicture(); | 1023 return proxy_->CapturePicture(); |
1024 } | 1024 } |
1025 | 1025 |
1026 } // namespace cc | 1026 } // namespace cc |
OLD | NEW |