| 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_compositor_frame_sink.h" | 7 #include "cc/test/fake_compositor_frame_sink.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 LayerImpl* pending_root = pending_tree->root_layer_for_testing(); | 111 LayerImpl* pending_root = pending_tree->root_layer_for_testing(); |
| 112 std::unique_ptr<FakePictureLayerImpl> pending_layer; | 112 std::unique_ptr<FakePictureLayerImpl> pending_layer; |
| 113 DCHECK(!pending_root || pending_root->id() == root_id_); | 113 DCHECK(!pending_root || pending_root->id() == root_id_); |
| 114 if (!pending_root) { | 114 if (!pending_root) { |
| 115 std::unique_ptr<LayerImpl> new_pending_root = | 115 std::unique_ptr<LayerImpl> new_pending_root = |
| 116 LayerImpl::Create(pending_tree, root_id_); | 116 LayerImpl::Create(pending_tree, root_id_); |
| 117 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); | 117 pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); |
| 118 if (!tile_size.IsEmpty()) | 118 if (!tile_size.IsEmpty()) |
| 119 pending_layer->set_fixed_tile_size(tile_size); | 119 pending_layer->set_fixed_tile_size(tile_size); |
| 120 pending_layer->SetDrawsContent(true); | 120 pending_layer->SetDrawsContent(true); |
| 121 pending_layer->SetScrollClipLayer(new_pending_root->id()); | 121 pending_layer->SetScrollClipAndCanOverscroll(new_pending_root->id(), false); |
| 122 pending_root = new_pending_root.get(); | 122 pending_root = new_pending_root.get(); |
| 123 pending_tree->SetRootLayerForTesting(std::move(new_pending_root)); | 123 pending_tree->SetRootLayerForTesting(std::move(new_pending_root)); |
| 124 } else { | 124 } else { |
| 125 pending_layer.reset(static_cast<FakePictureLayerImpl*>( | 125 pending_layer.reset(static_cast<FakePictureLayerImpl*>( |
| 126 pending_root->test_properties() | 126 pending_root->test_properties() |
| 127 ->RemoveChild(pending_root->test_properties()->children[0]) | 127 ->RemoveChild(pending_root->test_properties()->children[0]) |
| 128 .release())); | 128 .release())); |
| 129 if (!tile_size.IsEmpty()) | 129 if (!tile_size.IsEmpty()) |
| 130 pending_layer->set_fixed_tile_size(tile_size); | 130 pending_layer->set_fixed_tile_size(tile_size); |
| 131 } | 131 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; | 175 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes * 2; |
| 176 state.memory_limit_policy = ALLOW_ANYTHING; | 176 state.memory_limit_policy = ALLOW_ANYTHING; |
| 177 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; | 177 state.tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; |
| 178 | 178 |
| 179 host_impl_->resource_pool()->SetResourceUsageLimits( | 179 host_impl_->resource_pool()->SetResourceUsageLimits( |
| 180 state.soft_memory_limit_in_bytes, state.num_resources_limit); | 180 state.soft_memory_limit_in_bytes, state.num_resources_limit); |
| 181 host_impl_->tile_manager()->SetGlobalStateForTesting(state); | 181 host_impl_->tile_manager()->SetGlobalStateForTesting(state); |
| 182 } | 182 } |
| 183 | 183 |
| 184 } // namespace cc | 184 } // namespace cc |
| OLD | NEW |