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/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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 507 |
508 void LayerTreeTest::ScheduleComposite() { | 508 void LayerTreeTest::ScheduleComposite() { |
509 if (!started_ || scheduled_) | 509 if (!started_ || scheduled_) |
510 return; | 510 return; |
511 scheduled_ = true; | 511 scheduled_ = true; |
512 main_task_runner_->PostTask( | 512 main_task_runner_->PostTask( |
513 FROM_HERE, | 513 FROM_HERE, |
514 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_)); | 514 base::Bind(&LayerTreeTest::DispatchComposite, main_thread_weak_ptr_)); |
515 } | 515 } |
516 | 516 |
517 void LayerTreeTest::ScheduleAnimation() { | |
518 ScheduleComposite(); | |
519 } | |
520 | |
521 void LayerTreeTest::RealEndTest() { | 517 void LayerTreeTest::RealEndTest() { |
522 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { | 518 if (layer_tree_host_ && proxy()->CommitPendingForTesting()) { |
523 main_task_runner_->PostTask( | 519 main_task_runner_->PostTask( |
524 FROM_HERE, | 520 FROM_HERE, |
525 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); | 521 base::Bind(&LayerTreeTest::RealEndTest, main_thread_weak_ptr_)); |
526 return; | 522 return; |
527 } | 523 } |
528 | 524 |
529 base::MessageLoop::current()->Quit(); | 525 base::MessageLoop::current()->Quit(); |
530 } | 526 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 // If the LTH is being made visible and a previous ScheduleComposite() was | 590 // 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. | 591 // deferred because the LTH was not visible, re-schedule the composite now. |
596 if (layer_tree_host_->visible() && schedule_when_set_visible_true_) | 592 if (layer_tree_host_->visible() && schedule_when_set_visible_true_) |
597 ScheduleComposite(); | 593 ScheduleComposite(); |
598 } | 594 } |
599 | 595 |
600 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { | 596 void LayerTreeTest::DispatchSetNextCommitForcesRedraw() { |
601 DCHECK(!proxy() || proxy()->IsMainThread()); | 597 DCHECK(!proxy() || proxy()->IsMainThread()); |
602 | 598 |
603 if (layer_tree_host_) | 599 if (layer_tree_host_) |
604 layer_tree_host_->set_next_commit_forces_redraw(); | 600 layer_tree_host_->SetNextCommitForcesRedraw(); |
605 } | 601 } |
606 | 602 |
607 void LayerTreeTest::DispatchComposite() { | 603 void LayerTreeTest::DispatchComposite() { |
608 scheduled_ = false; | 604 scheduled_ = false; |
609 | 605 |
610 if (!layer_tree_host_) | 606 if (!layer_tree_host_) |
611 return; | 607 return; |
612 | 608 |
613 // If the LTH is not visible, defer the composite until the LTH is made | 609 // If the LTH is not visible, defer the composite until the LTH is made |
614 // visible. | 610 // visible. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 compositor_contexts_ = TestContextProvider::Create(); | 694 compositor_contexts_ = TestContextProvider::Create(); |
699 return compositor_contexts_; | 695 return compositor_contexts_; |
700 } | 696 } |
701 | 697 |
702 TestWebGraphicsContext3D* LayerTreeTest::TestContext() { | 698 TestWebGraphicsContext3D* LayerTreeTest::TestContext() { |
703 return static_cast<TestContextProvider*>( | 699 return static_cast<TestContextProvider*>( |
704 output_surface_->context_provider().get())->TestContext3d(); | 700 output_surface_->context_provider().get())->TestContext3d(); |
705 } | 701 } |
706 | 702 |
707 } // namespace cc | 703 } // namespace cc |
OLD | NEW |