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

Side by Side Diff: cc/test/layer_tree_test.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/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('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/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 void LayerTreeTest::ScheduleComposite() { 509 void LayerTreeTest::ScheduleComposite() {
510 if (!started_ || scheduled_) 510 if (!started_ || scheduled_)
511 return; 511 return;
512 scheduled_ = true; 512 scheduled_ = true;
513 main_task_runner_->PostTask( 513 main_task_runner_->PostTask(
514 FROM_HERE, 514 FROM_HERE,
515 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_)); 515 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_));
516 } 516 }
517 517
518 void LayerTreeTest::ScheduleAnimation() {
519 ScheduleComposite();
520 }
521
518 void LayerTreeTest::RealEndTest() { 522 void LayerTreeTest::RealEndTest() {
519 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { 523 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) {
520 main_task_runner_->PostTask( 524 main_task_runner_->PostTask(
521 FROM_HERE, 525 FROM_HERE,
522 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); 526 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_));
523 return; 527 return;
524 } 528 }
525 529
526 base::MessageLoop::current()->Quit(); 530 base::MessageLoop::current()->Quit();
527 } 531 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // If the LTH is being made visible and a previous ScheduleComposite() was 598 // If the LTH is being made visible and a previous ScheduleComposite() was
595 // deferred because the LTH was not visible, re-schedule the composite now. 599 // deferred because the LTH was not visible, re-schedule the composite now.
596 if (layer_tree_host_->visible() && schedule_when_set_visible_true_) 600 if (layer_tree_host_->visible() && schedule_when_set_visible_true_)
597 ScheduleComposite(); 601 ScheduleComposite();
598 } 602 }
599 603
600 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { 604 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() {
601 DCHECK(!proxy() || proxy()->IsMainThread()); 605 DCHECK(!proxy() || proxy()->IsMainThread());
602 606
603 if (layer_tree_host_) 607 if (layer_tree_host_)
604 layer_tree_host_->SetNextCommitForcesRedraw(); 608 layer_tree_host_->set_next_commit_forces_redraw();
605 } 609 }
606 610
607 void LayerTreeTest::DispatchComposite() { 611 void LayerTreeTest::DispatchComposite() {
608 scheduled_ = false; 612 scheduled_ = false;
609 613
610 if (!layer_tree_host_) 614 if (!layer_tree_host_)
611 return; 615 return;
612 616
613 // If the LTH is not visible, defer the composite until the LTH is made 617 // If the LTH is not visible, defer the composite until the LTH is made
614 // visible. 618 // visible.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 691 }
688 692
689 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() { 693 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() {
690 if (!compositor_contexts_.get() || 694 if (!compositor_contexts_.get() ||
691 compositor_contexts_->DestroyedOnMainThread()) 695 compositor_contexts_->DestroyedOnMainThread())
692 compositor_contexts_ = TestContextProvider::Create(); 696 compositor_contexts_ = TestContextProvider::Create();
693 return compositor_contexts_; 697 return compositor_contexts_;
694 } 698 }
695 699
696 } // namespace cc 700 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698