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

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: fixed cc animation unittest 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
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 159 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

Powered by Google App Engine
This is Rietveld 408576698