| 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_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
| 9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
| 10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual void SetUp() OVERRIDE { | 44 virtual void SetUp() OVERRIDE { |
| 45 output_surface_ = FakeOutputSurface::Create3d(); | 45 output_surface_ = FakeOutputSurface::Create3d(); |
| 46 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 46 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
| 47 | 47 |
| 48 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); | 48 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); |
| 49 resource_provider_ = ResourceProvider::Create( | 49 resource_provider_ = ResourceProvider::Create( |
| 50 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1, | 50 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1, |
| 51 false); | 51 false); |
| 52 resource_pool_ = ResourcePool::Create( | 52 resource_pool_ = ResourcePool::Create( |
| 53 resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888); | 53 resource_provider_.get(), GL_TEXTURE_2D, RGBA_8888); |
| 54 size_t raster_task_limit_bytes = 32 * 1024 * 1024; // 16-64MB in practice. | 54 tile_manager_ = make_scoped_ptr( |
| 55 tile_manager_ = make_scoped_ptr(new FakeTileManager( | 55 new FakeTileManager(&tile_manager_client_, resource_pool_.get())); |
| 56 &tile_manager_client_, resource_pool_.get(), raster_task_limit_bytes)); | |
| 57 picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile(); | 56 picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 GlobalStateThatImpactsTilePriority GlobalStateForTest() { | 59 GlobalStateThatImpactsTilePriority GlobalStateForTest() { |
| 61 GlobalStateThatImpactsTilePriority state; | 60 GlobalStateThatImpactsTilePriority state; |
| 62 gfx::Size tile_size = settings_.default_tile_size; | 61 gfx::Size tile_size = settings_.default_tile_size; |
| 63 state.soft_memory_limit_in_bytes = | 62 state.soft_memory_limit_in_bytes = |
| 64 10000u * 4u * | 63 10000u * 4u * |
| 65 static_cast<size_t>(tile_size.width() * tile_size.height()); | 64 static_cast<size_t>(tile_size.width() * tile_size.height()); |
| 66 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes; | 65 state.hard_memory_limit_in_bytes = state.soft_memory_limit_in_bytes; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 348 |
| 350 RunTest("2_16", 16); | 349 RunTest("2_16", 16); |
| 351 RunTest("2_32", 32); | 350 RunTest("2_32", 32); |
| 352 RunTest("2_64", 64); | 351 RunTest("2_64", 64); |
| 353 RunTest("2_128", 128); | 352 RunTest("2_128", 128); |
| 354 } | 353 } |
| 355 | 354 |
| 356 } // namespace | 355 } // namespace |
| 357 | 356 |
| 358 } // namespace cc | 357 } // namespace cc |
| OLD | NEW |