| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::CreatePile(); |
| 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.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.num_resources_limit = 10000; | 59 state.num_resources_limit = 10000; |
| 59 state.memory_limit_policy = ALLOW_ANYTHING; | 60 state.memory_limit_policy = ALLOW_ANYTHING; |
| 60 state.tree_priority = SMOOTHNESS_TAKES_PRIORITY; | 61 state.tree_priority = SMOOTHNESS_TAKES_PRIORITY; |
| 61 return state; | 62 return state; |
| 62 } | 63 } |
| 63 | 64 |
| 64 virtual void TearDown() OVERRIDE { | 65 virtual void TearDown() OVERRIDE { |
| 65 tile_manager_.reset(NULL); | 66 tile_manager_.reset(NULL); |
| 66 picture_pile_ = NULL; | 67 picture_pile_ = NULL; |
| 67 } | 68 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 RunManageTilesTest("1000_10", 1000, 10); | 182 RunManageTilesTest("1000_10", 1000, 10); |
| 182 RunManageTilesTest("10000_10", 10000, 10); | 183 RunManageTilesTest("10000_10", 10000, 10); |
| 183 RunManageTilesTest("100_100", 100, 100); | 184 RunManageTilesTest("100_100", 100, 100); |
| 184 RunManageTilesTest("1000_100", 1000, 100); | 185 RunManageTilesTest("1000_100", 1000, 100); |
| 185 RunManageTilesTest("10000_100", 10000, 100); | 186 RunManageTilesTest("10000_100", 10000, 100); |
| 186 } | 187 } |
| 187 | 188 |
| 188 } // namespace | 189 } // namespace |
| 189 | 190 |
| 190 } // namespace cc | 191 } // namespace cc |
| OLD | NEW |