OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/time/time.h" | 5 #include "base/time/time.h" |
6 #include "cc/resources/tile.h" | 6 #include "cc/resources/tile.h" |
7 #include "cc/resources/tile_priority.h" | 7 #include "cc/resources/tile_priority.h" |
8 #include "cc/test/fake_output_surface.h" | 8 #include "cc/test/fake_output_surface.h" |
9 #include "cc/test/fake_output_surface_client.h" | 9 #include "cc/test/fake_output_surface_client.h" |
10 #include "cc/test/fake_picture_pile_impl.h" | 10 #include "cc/test/fake_picture_pile_impl.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 output_surface_ = FakeOutputSurface::Create3d(); | 39 output_surface_ = FakeOutputSurface::Create3d(); |
40 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 40 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
41 | 41 |
42 resource_provider_ = | 42 resource_provider_ = |
43 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); | 43 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); |
44 size_t raster_task_limit_bytes = 32 * 1024 * 1024; // 16-64MB in practice. | 44 size_t raster_task_limit_bytes = 32 * 1024 * 1024; // 16-64MB in practice. |
45 tile_manager_ = | 45 tile_manager_ = |
46 make_scoped_ptr(new FakeTileManager(&tile_manager_client_, | 46 make_scoped_ptr(new FakeTileManager(&tile_manager_client_, |
47 resource_provider_.get(), | 47 resource_provider_.get(), |
48 raster_task_limit_bytes)); | 48 raster_task_limit_bytes)); |
49 picture_pile_ = FakePicturePileImpl::CreatePile(); | 49 picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile(); |
50 } | 50 } |
51 | 51 |
52 GlobalStateThatImpactsTilePriority GlobalStateForTest() { | 52 GlobalStateThatImpactsTilePriority GlobalStateForTest() { |
53 GlobalStateThatImpactsTilePriority state; | 53 GlobalStateThatImpactsTilePriority state; |
54 gfx::Size tile_size = settings_.default_tile_size; | 54 gfx::Size tile_size = settings_.default_tile_size; |
55 state.soft_memory_limit_in_bytes = | 55 state.soft_memory_limit_in_bytes = |
56 10000u * 4u * | 56 10000u * 4u * |
57 static_cast<size_t>(tile_size.width() * tile_size.height()); | 57 static_cast<size_t>(tile_size.width() * tile_size.height()); |
58 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes; | 58 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes; |
59 state.num_resources_limit = 10000; | 59 state.num_resources_limit = 10000; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 RunManageTilesTest("1000_10", 1000, 10); | 182 RunManageTilesTest("1000_10", 1000, 10); |
183 RunManageTilesTest("10000_10", 10000, 10); | 183 RunManageTilesTest("10000_10", 10000, 10); |
184 RunManageTilesTest("100_100", 100, 100); | 184 RunManageTilesTest("100_100", 100, 100); |
185 RunManageTilesTest("1000_100", 1000, 100); | 185 RunManageTilesTest("1000_100", 1000, 100); |
186 RunManageTilesTest("10000_100", 10000, 100); | 186 RunManageTilesTest("10000_100", 10000, 100); |
187 } | 187 } |
188 | 188 |
189 } // namespace | 189 } // namespace |
190 | 190 |
191 } // namespace cc | 191 } // namespace cc |
OLD | NEW |