| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test_layer_tree_host_base.h" | 5 #include "cc/test/test_layer_tree_host_base.h" |
| 6 | 6 |
| 7 #include "cc/test/fake_output_surface.h" | 7 #include "cc/test/fake_output_surface.h" |
| 8 #include "cc/test/fake_raster_source.h" | 8 #include "cc/test/fake_raster_source.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 output_surface_ = CreateOutputSurface(); | 24 output_surface_ = CreateOutputSurface(); |
| 25 task_graph_runner_ = CreateTaskGraphRunner(); | 25 task_graph_runner_ = CreateTaskGraphRunner(); |
| 26 host_impl_ = CreateHostImpl(CreateSettings(), &task_runner_provider_, | 26 host_impl_ = CreateHostImpl(CreateSettings(), &task_runner_provider_, |
| 27 &shared_bitmap_manager_, task_graph_runner_.get(), | 27 &shared_bitmap_manager_, task_graph_runner_.get(), |
| 28 &gpu_memory_buffer_manager_); | 28 &gpu_memory_buffer_manager_); |
| 29 InitializeRenderer(); | 29 InitializeRenderer(); |
| 30 SetInitialTreePriority(); | 30 SetInitialTreePriority(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 LayerTreeSettings TestLayerTreeHostBase::CreateSettings() { | 33 LayerTreeSettings TestLayerTreeHostBase::CreateSettings() { |
| 34 return LayerTreeSettings(); | 34 LayerTreeSettings settings; |
| 35 settings.verify_transform_tree_calculations = true; |
| 36 return settings; |
| 35 } | 37 } |
| 36 | 38 |
| 37 std::unique_ptr<OutputSurface> TestLayerTreeHostBase::CreateOutputSurface() { | 39 std::unique_ptr<OutputSurface> TestLayerTreeHostBase::CreateOutputSurface() { |
| 38 return FakeOutputSurface::Create3d(); | 40 return FakeOutputSurface::Create3d(); |
| 39 } | 41 } |
| 40 | 42 |
| 41 std::unique_ptr<FakeLayerTreeHostImpl> TestLayerTreeHostBase::CreateHostImpl( | 43 std::unique_ptr<FakeLayerTreeHostImpl> TestLayerTreeHostBase::CreateHostImpl( |
| 42 const LayerTreeSettings& settings, | 44 const LayerTreeSettings& settings, |
| 43 TaskRunnerProvider* task_runner_provider, | 45 TaskRunnerProvider* task_runner_provider, |
| 44 SharedBitmapManager* shared_bitmap_manager, | 46 SharedBitmapManager* shared_bitmap_manager, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; | 174 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; |
| 173 state.memory_limit_policy = ALLOW_ANYTHING; | 175 state.memory_limit_policy = ALLOW_ANYTHING; |
| 174 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; | 176 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; |
| 175 | 177 |
| 176 host_impl_->resource_pool()->SetResourceUsageLimits( | 178 host_impl_->resource_pool()->SetResourceUsageLimits( |
| 177 state.soft_memory_limit_in_bytes, state.num_resources_limit); | 179 state.soft_memory_limit_in_bytes, state.num_resources_limit); |
| 178 host_impl_->tile_manager()->SetGlobalStateForTesting(state); | 180 host_impl_->tile_manager()->SetGlobalStateForTesting(state); |
| 179 } | 181 } |
| 180 | 182 |
| 181 } // namespace cc | 183 } // namespace cc |
| OLD | NEW |