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