| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "cc/test/fake_compositor_frame_sink.h" | 9 #include "cc/test/fake_compositor_frame_sink.h" |
| 10 #include "cc/test/fake_raster_source.h" | 10 #include "cc/test/fake_raster_source.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 pending_layer->set_fixed_tile_size(tile_size); | 127 pending_layer->set_fixed_tile_size(tile_size); |
| 128 } | 128 } |
| 129 pending_root->test_properties()->force_render_surface = true; | 129 pending_root->test_properties()->force_render_surface = true; |
| 130 // The bounds() just mirror the raster source size. | 130 // The bounds() just mirror the raster source size. |
| 131 pending_layer->SetBounds(raster_source->GetSize()); | 131 pending_layer->SetBounds(raster_source->GetSize()); |
| 132 pending_layer->SetRasterSourceOnPending(raster_source, invalidation); | 132 pending_layer->SetRasterSourceOnPending(raster_source, invalidation); |
| 133 | 133 |
| 134 pending_root->test_properties()->AddChild(std::move(pending_layer)); | 134 pending_root->test_properties()->AddChild(std::move(pending_layer)); |
| 135 pending_tree->SetViewportLayersFromIds( | 135 pending_tree->SetViewportLayersFromIds( |
| 136 Layer::INVALID_ID, pending_tree->root_layer_for_testing()->id(), | 136 Layer::INVALID_ID, pending_tree->root_layer_for_testing()->id(), |
| 137 Layer::INVALID_ID, Layer::INVALID_ID); | 137 Layer::INVALID_ID, Layer::INVALID_ID, Layer::INVALID_ID, |
| 138 Layer::INVALID_ID); |
| 138 | 139 |
| 139 pending_layer_ = static_cast<FakePictureLayerImpl*>( | 140 pending_layer_ = static_cast<FakePictureLayerImpl*>( |
| 140 host_impl()->pending_tree()->LayerById(id_)); | 141 host_impl()->pending_tree()->LayerById(id_)); |
| 141 | 142 |
| 142 // Add tilings/tiles for the layer. | 143 // Add tilings/tiles for the layer. |
| 143 bool update_lcd_text = false; | 144 bool update_lcd_text = false; |
| 144 RebuildPropertyTreesOnPendingTree(); | 145 RebuildPropertyTreesOnPendingTree(); |
| 145 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); | 146 host_impl()->pending_tree()->UpdateDrawProperties(update_lcd_text); |
| 146 } | 147 } |
| 147 | 148 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; | 185 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; |
| 185 state.memory_limit_policy = ALLOW_ANYTHING; | 186 state.memory_limit_policy = ALLOW_ANYTHING; |
| 186 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; | 187 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; |
| 187 | 188 |
| 188 host_impl_->resource_pool()->SetResourceUsageLimits( | 189 host_impl_->resource_pool()->SetResourceUsageLimits( |
| 189 state.soft_memory_limit_in_bytes, state.num_resources_limit); | 190 state.soft_memory_limit_in_bytes, state.num_resources_limit); |
| 190 host_impl_->tile_manager()->SetGlobalStateForTesting(state); | 191 host_impl_->tile_manager()->SetGlobalStateForTesting(state); |
| 191 } | 192 } |
| 192 | 193 |
| 193 } // namespace cc | 194 } // namespace cc |
| OLD | NEW |