| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 void LayerTreeHost::SetNeedsRedrawRect(gfx::Rect damage_rect) { | 511 void LayerTreeHost::SetNeedsRedrawRect(gfx::Rect damage_rect) { |
| 512 proxy_->SetNeedsRedraw(damage_rect); | 512 proxy_->SetNeedsRedraw(damage_rect); |
| 513 if (!proxy_->HasImplThread()) | 513 if (!proxy_->HasImplThread()) |
| 514 client_->ScheduleComposite(); | 514 client_->ScheduleComposite(); |
| 515 } | 515 } |
| 516 | 516 |
| 517 bool LayerTreeHost::CommitRequested() const { | 517 bool LayerTreeHost::CommitRequested() const { |
| 518 return proxy_->CommitRequested(); | 518 return proxy_->CommitRequested(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void LayerTreeHost::SetNextCommitWaitsForActivation() { |
| 522 proxy_->SetNextCommitWaitsForActivation(); |
| 523 } |
| 524 |
| 521 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, | 525 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, |
| 522 base::Time wall_clock_time) { | 526 base::Time wall_clock_time) { |
| 523 DCHECK(proxy_->IsMainThread()); | 527 DCHECK(proxy_->IsMainThread()); |
| 524 for (size_t event_index = 0; event_index < events->size(); ++event_index) { | 528 for (size_t event_index = 0; event_index < events->size(); ++event_index) { |
| 525 int event_layer_id = (*events)[event_index].layer_id; | 529 int event_layer_id = (*events)[event_index].layer_id; |
| 526 | 530 |
| 527 // Use the map of all controllers, not just active ones, since non-active | 531 // Use the map of all controllers, not just active ones, since non-active |
| 528 // controllers may still receive events for impl-only animations. | 532 // controllers may still receive events for impl-only animations. |
| 529 const AnimationRegistrar::AnimationControllerMap& animation_controllers = | 533 const AnimationRegistrar::AnimationControllerMap& animation_controllers = |
| 530 animation_registrar_->all_animation_controllers(); | 534 animation_registrar_->all_animation_controllers(); |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 // Top controls are only used in threaded mode. | 1086 // Top controls are only used in threaded mode. |
| 1083 proxy_->ImplThreadTaskRunner()->PostTask( | 1087 proxy_->ImplThreadTaskRunner()->PostTask( |
| 1084 FROM_HERE, | 1088 FROM_HERE, |
| 1085 base::Bind(&TopControlsManager::UpdateTopControlsState, | 1089 base::Bind(&TopControlsManager::UpdateTopControlsState, |
| 1086 top_controls_manager_weak_ptr_, | 1090 top_controls_manager_weak_ptr_, |
| 1087 constraints, | 1091 constraints, |
| 1088 current, | 1092 current, |
| 1089 animate)); | 1093 animate)); |
| 1090 } | 1094 } |
| 1091 | 1095 |
| 1092 bool LayerTreeHost::BlocksPendingCommit() const { | |
| 1093 if (!root_layer_.get()) | |
| 1094 return false; | |
| 1095 return root_layer_->BlocksPendingCommitRecursive(); | |
| 1096 } | |
| 1097 | |
| 1098 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { | 1096 scoped_ptr<base::Value> LayerTreeHost::AsValue() const { |
| 1099 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1097 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 1100 state->Set("proxy", proxy_->AsValue().release()); | 1098 state->Set("proxy", proxy_->AsValue().release()); |
| 1101 return state.PassAs<base::Value>(); | 1099 return state.PassAs<base::Value>(); |
| 1102 } | 1100 } |
| 1103 | 1101 |
| 1104 void LayerTreeHost::AnimateLayers(base::TimeTicks time) { | 1102 void LayerTreeHost::AnimateLayers(base::TimeTicks time) { |
| 1105 rendering_stats_instrumentation_->IncrementAnimationFrameCount(); | 1103 rendering_stats_instrumentation_->IncrementAnimationFrameCount(); |
| 1106 if (!settings_.accelerated_animation_enabled || | 1104 if (!settings_.accelerated_animation_enabled || |
| 1107 animation_registrar_->active_animation_controllers().empty()) | 1105 animation_registrar_->active_animation_controllers().empty()) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 void LayerTreeHost::DidLoseUIResources() { | 1167 void LayerTreeHost::DidLoseUIResources() { |
| 1170 // When output surface is lost, we need to recreate the resource. | 1168 // When output surface is lost, we need to recreate the resource. |
| 1171 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin(); | 1169 for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin(); |
| 1172 iter != ui_resource_client_map_.end(); | 1170 iter != ui_resource_client_map_.end(); |
| 1173 ++iter) { | 1171 ++iter) { |
| 1174 UIResourceLost(iter->first); | 1172 UIResourceLost(iter->first); |
| 1175 } | 1173 } |
| 1176 } | 1174 } |
| 1177 | 1175 |
| 1178 } // namespace cc | 1176 } // namespace cc |
| OLD | NEW |