Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 133263004: Unifies LayerTreeHost::SetNeedsUpdateLayers and SetNeedsAnimate -- V2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mojo build Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
526 void LayerTreeHost::SetNeedsUpdateLayers() { 521 void LayerTreeHost::SetNeedsUpdateLayers() {
527 proxy_->SetNeedsUpdateLayers(); 522 proxy_->SetNeedsUpdateLayers();
528 NotifySwapPromiseMonitorsOfSetNeedsCommit(); 523 NotifySwapPromiseMonitorsOfSetNeedsCommit();
529 } 524 }
530 525
531 void LayerTreeHost::SetNeedsCommit() { 526 void LayerTreeHost::SetNeedsCommit() {
532 if (!prepaint_callback_.IsCancelled()) { 527 if (!prepaint_callback_.IsCancelled()) {
533 TRACE_EVENT_INSTANT0("cc", 528 TRACE_EVENT_INSTANT0("cc",
534 "LayerTreeHost::SetNeedsCommit::cancel prepaint", 529 "LayerTreeHost::SetNeedsCommit::cancel prepaint",
535 TRACE_EVENT_SCOPE_THREAD); 530 TRACE_EVENT_SCOPE_THREAD);
(...skipping 22 matching lines...) Expand all
558 553
559 bool LayerTreeHost::BeginMainFrameRequested() const { 554 bool LayerTreeHost::BeginMainFrameRequested() const {
560 return proxy_->BeginMainFrameRequested(); 555 return proxy_->BeginMainFrameRequested();
561 } 556 }
562 557
563 558
564 void LayerTreeHost::SetNextCommitWaitsForActivation() { 559 void LayerTreeHost::SetNextCommitWaitsForActivation() {
565 proxy_->SetNextCommitWaitsForActivation(); 560 proxy_->SetNextCommitWaitsForActivation();
566 } 561 }
567 562
568 void LayerTreeHost::SetNextCommitForcesRedraw() {
569 next_commit_forces_redraw_ = true;
570 }
571
572 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, 563 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
573 base::Time wall_clock_time) { 564 base::Time wall_clock_time) {
574 DCHECK(proxy_->IsMainThread()); 565 DCHECK(proxy_->IsMainThread());
575 for (size_t event_index = 0; event_index < events->size(); ++event_index) { 566 for (size_t event_index = 0; event_index < events->size(); ++event_index) {
576 int event_layer_id = (*events)[event_index].layer_id; 567 int event_layer_id = (*events)[event_index].layer_id;
577 568
578 // Use the map of all controllers, not just active ones, since non-active 569 // Use the map of all controllers, not just active ones, since non-active
579 // controllers may still receive events for impl-only animations. 570 // controllers may still receive events for impl-only animations.
580 const AnimationRegistrar::AnimationControllerMap& animation_controllers = 571 const AnimationRegistrar::AnimationControllerMap& animation_controllers =
581 animation_registrar_->all_animation_controllers(); 572 animation_registrar_->all_animation_controllers();
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 swap_promise_list_.push_back(swap_promise.Pass()); 1263 swap_promise_list_.push_back(swap_promise.Pass());
1273 } 1264 }
1274 1265
1275 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 1266 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
1276 for (size_t i = 0; i < swap_promise_list_.size(); i++) 1267 for (size_t i = 0; i < swap_promise_list_.size(); i++)
1277 swap_promise_list_[i]->DidNotSwap(reason); 1268 swap_promise_list_[i]->DidNotSwap(reason);
1278 swap_promise_list_.clear(); 1269 swap_promise_list_.clear();
1279 } 1270 }
1280 1271
1281 } // namespace cc 1272 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698