| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 void LayerTreeHost::CollectRenderingStats(RenderingStats* stats) const { | 512 void LayerTreeHost::CollectRenderingStats(RenderingStats* stats) const { |
| 513 CHECK(debug_state_.RecordRenderingStats()); | 513 CHECK(debug_state_.RecordRenderingStats()); |
| 514 *stats = rendering_stats_instrumentation_->GetRenderingStats(); | 514 *stats = rendering_stats_instrumentation_->GetRenderingStats(); |
| 515 } | 515 } |
| 516 | 516 |
| 517 const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const { | 517 const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const { |
| 518 return proxy_->GetRendererCapabilities(); | 518 return proxy_->GetRendererCapabilities(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void LayerTreeHost::SetNeedsAnimate() { |
| 522 proxy_->SetNeedsAnimate(); |
| 523 NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
| 524 } |
| 525 |
| 521 void LayerTreeHost::SetNeedsUpdateLayers() { | 526 void LayerTreeHost::SetNeedsUpdateLayers() { |
| 522 proxy_->SetNeedsUpdateLayers(); | 527 proxy_->SetNeedsUpdateLayers(); |
| 523 NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 528 NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
| 524 } | 529 } |
| 525 | 530 |
| 526 void LayerTreeHost::SetNeedsCommit() { | 531 void LayerTreeHost::SetNeedsCommit() { |
| 527 if (!prepaint_callback_.IsCancelled()) { | 532 if (!prepaint_callback_.IsCancelled()) { |
| 528 TRACE_EVENT_INSTANT0("cc", | 533 TRACE_EVENT_INSTANT0("cc", |
| 529 "LayerTreeHost::SetNeedsCommit::cancel prepaint", | 534 "LayerTreeHost::SetNeedsCommit::cancel prepaint", |
| 530 TRACE_EVENT_SCOPE_THREAD); | 535 TRACE_EVENT_SCOPE_THREAD); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 553 | 558 |
| 554 bool LayerTreeHost::BeginMainFrameRequested() const { | 559 bool LayerTreeHost::BeginMainFrameRequested() const { |
| 555 return proxy_->BeginMainFrameRequested(); | 560 return proxy_->BeginMainFrameRequested(); |
| 556 } | 561 } |
| 557 | 562 |
| 558 | 563 |
| 559 void LayerTreeHost::SetNextCommitWaitsForActivation() { | 564 void LayerTreeHost::SetNextCommitWaitsForActivation() { |
| 560 proxy_->SetNextCommitWaitsForActivation(); | 565 proxy_->SetNextCommitWaitsForActivation(); |
| 561 } | 566 } |
| 562 | 567 |
| 568 void LayerTreeHost::SetNextCommitForcesRedraw() { |
| 569 next_commit_forces_redraw_ = true; |
| 570 } |
| 571 |
| 563 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, | 572 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, |
| 564 base::Time wall_clock_time) { | 573 base::Time wall_clock_time) { |
| 565 DCHECK(proxy_->IsMainThread()); | 574 DCHECK(proxy_->IsMainThread()); |
| 566 for (size_t event_index = 0; event_index < events->size(); ++event_index) { | 575 for (size_t event_index = 0; event_index < events->size(); ++event_index) { |
| 567 int event_layer_id = (*events)[event_index].layer_id; | 576 int event_layer_id = (*events)[event_index].layer_id; |
| 568 | 577 |
| 569 // Use the map of all controllers, not just active ones, since non-active | 578 // Use the map of all controllers, not just active ones, since non-active |
| 570 // controllers may still receive events for impl-only animations. | 579 // controllers may still receive events for impl-only animations. |
| 571 const AnimationRegistrar::AnimationControllerMap& animation_controllers = | 580 const AnimationRegistrar::AnimationControllerMap& animation_controllers = |
| 572 animation_registrar_->all_animation_controllers(); | 581 animation_registrar_->all_animation_controllers(); |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 swap_promise_list_.push_back(swap_promise.Pass()); | 1272 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1264 } | 1273 } |
| 1265 | 1274 |
| 1266 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1275 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1267 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1276 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1268 swap_promise_list_[i]->DidNotSwap(reason); | 1277 swap_promise_list_[i]->DidNotSwap(reason); |
| 1269 swap_promise_list_.clear(); | 1278 swap_promise_list_.clear(); |
| 1270 } | 1279 } |
| 1271 | 1280 |
| 1272 } // namespace cc | 1281 } // namespace cc |
| OLD | NEW |