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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
600 if (layer_tree_host_) | 600 if (layer_tree_host_) |
601 layer_tree_host_->SetNextCommitForcesRedraw(); | 601 layer_tree_host_->SetNextCommitForcesRedraw(); |
602 } | 602 } |
603 | 603 |
604 void LayerTreeTest::DispatchComposite() { | 604 void LayerTreeTest::DispatchComposite() { |
605 scheduled_ = false; | 605 scheduled_ = false; |
606 | 606 |
607 if (!layer_tree_host_) | 607 if (!layer_tree_host_) |
608 return; | 608 return; |
609 | 609 |
610 // If the LTH is not visible, defer the composite until the LTH is made | 610 // If the LTH is not visible, defer the composite until the LTH is made |
danakj
2014/02/19 20:42:39
Can this go away?
enne (OOO)
2014/02/20 00:35:44
Excellent call. Done.
| |
611 // visible. | 611 // visible. |
612 if (!layer_tree_host_->visible()) { | 612 if (!layer_tree_host_->visible()) { |
613 schedule_when_set_visible_true_ = true; | 613 schedule_when_set_visible_true_ = true; |
614 return; | 614 return; |
615 } | 615 } |
616 | 616 |
617 schedule_when_set_visible_true_ = false; | 617 schedule_when_set_visible_true_ = false; |
618 base::TimeTicks now = gfx::FrameTime::Now(); | 618 layer_tree_host_->SetNeedsCommit(); |
619 layer_tree_host_->Composite(now); | |
620 } | 619 } |
621 | 620 |
622 void LayerTreeTest::RunTest(bool threaded, | 621 void LayerTreeTest::RunTest(bool threaded, |
623 bool delegating_renderer, | 622 bool delegating_renderer, |
624 bool impl_side_painting) { | 623 bool impl_side_painting) { |
625 if (threaded) { | 624 if (threaded) { |
626 impl_thread_.reset(new base::Thread("Compositor")); | 625 impl_thread_.reset(new base::Thread("Compositor")); |
627 ASSERT_TRUE(impl_thread_->Start()); | 626 ASSERT_TRUE(impl_thread_->Start()); |
628 } | 627 } |
629 | 628 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
708 return -1; | 707 return -1; |
709 } | 708 } |
710 | 709 |
711 void LayerTreeTest::DestroyLayerTreeHost() { | 710 void LayerTreeTest::DestroyLayerTreeHost() { |
712 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 711 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
713 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 712 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
714 layer_tree_host_.reset(); | 713 layer_tree_host_.reset(); |
715 } | 714 } |
716 | 715 |
717 } // namespace cc | 716 } // namespace cc |
OLD | NEW |