| 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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 | 677 |
| 678 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( | 678 scoped_ptr<FakeOutputSurface> LayerTreeTest::CreateFakeOutputSurface( |
| 679 bool fallback) { | 679 bool fallback) { |
| 680 if (delegating_renderer_) | 680 if (delegating_renderer_) |
| 681 return FakeOutputSurface::CreateDelegating3d(); | 681 return FakeOutputSurface::CreateDelegating3d(); |
| 682 else | 682 else |
| 683 return FakeOutputSurface::Create3d(); | 683 return FakeOutputSurface::Create3d(); |
| 684 } | 684 } |
| 685 | 685 |
| 686 TestWebGraphicsContext3D* LayerTreeTest::TestContext() { | 686 TestWebGraphicsContext3D* LayerTreeTest::TestContext() { |
| 687 return static_cast<TestContextProvider*>( | 687 return static_cast<TestContextProvider*>(output_surface_->context_provider()) |
| 688 output_surface_->context_provider().get())->TestContext3d(); | 688 ->TestContext3d(); |
| 689 } | 689 } |
| 690 | 690 |
| 691 int LayerTreeTest::LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) | 691 int LayerTreeTest::LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) |
| 692 const { | 692 const { |
| 693 if (impl->pending_tree()) | 693 if (impl->pending_tree()) |
| 694 return impl->pending_tree()->source_frame_number(); | 694 return impl->pending_tree()->source_frame_number(); |
| 695 if (impl->active_tree()) | 695 if (impl->active_tree()) |
| 696 return impl->active_tree()->source_frame_number(); | 696 return impl->active_tree()->source_frame_number(); |
| 697 // Source frames start at 0, so this is invalid. | 697 // Source frames start at 0, so this is invalid. |
| 698 return -1; | 698 return -1; |
| 699 } | 699 } |
| 700 | 700 |
| 701 void LayerTreeTest::DestroyLayerTreeHost() { | 701 void LayerTreeTest::DestroyLayerTreeHost() { |
| 702 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 702 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 703 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 703 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 704 layer_tree_host_.reset(); | 704 layer_tree_host_.reset(); |
| 705 } | 705 } |
| 706 | 706 |
| 707 } // namespace cc | 707 } // namespace cc |
| OLD | NEW |