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

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

Issue 68893031: Unifies LayerTreeHost::SetNeedsUpdateLayers and SetNeedsAnimate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix forced redraw breakage Created 7 years 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
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