| 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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 | 1041 |
| 1042 // Top controls are only used in threaded mode. | 1042 // Top controls are only used in threaded mode. |
| 1043 proxy_->ImplThread()->PostTask( | 1043 proxy_->ImplThread()->PostTask( |
| 1044 base::Bind(&TopControlsManager::UpdateTopControlsState, | 1044 base::Bind(&TopControlsManager::UpdateTopControlsState, |
| 1045 top_controls_manager_weak_ptr_, | 1045 top_controls_manager_weak_ptr_, |
| 1046 constraints, | 1046 constraints, |
| 1047 current, | 1047 current, |
| 1048 animate)); | 1048 animate)); |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 void LayerTreeHost::UpdateTopControlsStatePreservingConstraints( |
| 1052 bool show) { |
| 1053 if (!settings_.calculate_top_controls_position) |
| 1054 return; |
| 1055 proxy_->ImplThread()->PostTask( |
| 1056 base::Bind( |
| 1057 &TopControlsManager::UpdateTopControlsStatePreservingConstraints, |
| 1058 top_controls_manager_weak_ptr_, |
| 1059 show ? cc::SHOWN : cc::HIDDEN, |
| 1060 true)); |
| 1061 } |
| 1062 |
| 1051 bool LayerTreeHost::BlocksPendingCommit() const { | 1063 bool LayerTreeHost::BlocksPendingCommit() const { |
| 1052 if (!root_layer_.get()) | 1064 if (!root_layer_.get()) |
| 1053 return false; | 1065 return false; |
| 1054 return root_layer_->BlocksPendingCommitRecursive(); | 1066 return root_layer_->BlocksPendingCommitRecursive(); |
| 1055 } | 1067 } |
| 1056 | 1068 |
| 1057 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { | 1069 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { |
| 1058 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1070 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1059 state->Set("proxy", proxy_->AsValue().release()); | 1071 state->Set("proxy", proxy_->AsValue().release()); |
| 1060 return state.PassAs<base::Value>(); | 1072 return state.PassAs<base::Value>(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1079 bool start_ready_animations = true; | 1091 bool start_ready_animations = true; |
| 1080 (*iter).second->UpdateState(start_ready_animations, NULL); | 1092 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1081 } | 1093 } |
| 1082 } | 1094 } |
| 1083 | 1095 |
| 1084 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1096 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1085 return proxy_->CapturePicture(); | 1097 return proxy_->CapturePicture(); |
| 1086 } | 1098 } |
| 1087 | 1099 |
| 1088 } // namespace cc | 1100 } // namespace cc |
| OLD | NEW |