| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. | 108 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. |
| 109 class LayerTreeHostImplForTesting : public LayerTreeHostImpl { | 109 class LayerTreeHostImplForTesting : public LayerTreeHostImpl { |
| 110 public: | 110 public: |
| 111 static scoped_ptr<LayerTreeHostImplForTesting> Create( | 111 static scoped_ptr<LayerTreeHostImplForTesting> Create( |
| 112 TestHooks* test_hooks, | 112 TestHooks* test_hooks, |
| 113 const LayerTreeSettings& settings, | 113 const LayerTreeSettings& settings, |
| 114 LayerTreeHostImplClient* host_impl_client, | 114 LayerTreeHostImplClient* host_impl_client, |
| 115 Proxy* proxy, | 115 Proxy* proxy, |
| 116 SharedBitmapManager* shared_bitmap_manager, | 116 SharedBitmapManager* shared_bitmap_manager, |
| 117 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 117 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 118 RenderingStatsInstrumentation* stats_instrumentation) { | 118 RenderingStatsInstrumentation* stats_instrumentation) { |
| 119 return make_scoped_ptr( | 119 return make_scoped_ptr( |
| 120 new LayerTreeHostImplForTesting(test_hooks, | 120 new LayerTreeHostImplForTesting(test_hooks, |
| 121 settings, | 121 settings, |
| 122 host_impl_client, | 122 host_impl_client, |
| 123 proxy, | 123 proxy, |
| 124 shared_bitmap_manager, | 124 shared_bitmap_manager, |
| 125 gpu_memory_buffer_manager, | 125 gpu_memory_buffer_manager, |
| 126 stats_instrumentation)); | 126 stats_instrumentation)); |
| 127 } | 127 } |
| 128 | 128 |
| 129 protected: | 129 protected: |
| 130 LayerTreeHostImplForTesting( | 130 LayerTreeHostImplForTesting( |
| 131 TestHooks* test_hooks, | 131 TestHooks* test_hooks, |
| 132 const LayerTreeSettings& settings, | 132 const LayerTreeSettings& settings, |
| 133 LayerTreeHostImplClient* host_impl_client, | 133 LayerTreeHostImplClient* host_impl_client, |
| 134 Proxy* proxy, | 134 Proxy* proxy, |
| 135 SharedBitmapManager* shared_bitmap_manager, | 135 SharedBitmapManager* shared_bitmap_manager, |
| 136 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 136 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 137 RenderingStatsInstrumentation* stats_instrumentation) | 137 RenderingStatsInstrumentation* stats_instrumentation) |
| 138 : LayerTreeHostImpl(settings, | 138 : LayerTreeHostImpl(settings, |
| 139 host_impl_client, | 139 host_impl_client, |
| 140 proxy, | 140 proxy, |
| 141 stats_instrumentation, | 141 stats_instrumentation, |
| 142 shared_bitmap_manager, | 142 shared_bitmap_manager, |
| 143 gpu_memory_buffer_manager, | 143 gpu_memory_buffer_manager, |
| 144 0), | 144 0), |
| 145 test_hooks_(test_hooks), | 145 test_hooks_(test_hooks), |
| 146 block_notify_ready_to_activate_for_testing_(false), | 146 block_notify_ready_to_activate_for_testing_(false), |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 return -1; | 715 return -1; |
| 716 } | 716 } |
| 717 | 717 |
| 718 void LayerTreeTest::DestroyLayerTreeHost() { | 718 void LayerTreeTest::DestroyLayerTreeHost() { |
| 719 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 719 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
| 720 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 720 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
| 721 layer_tree_host_ = nullptr; | 721 layer_tree_host_ = nullptr; |
| 722 } | 722 } |
| 723 | 723 |
| 724 } // namespace cc | 724 } // namespace cc |
| OLD | NEW |