| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/fake_tile_manager.h" | 5 #include "cc/test/fake_tile_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 FakeTileManager::FakeTileManager(TileManagerClient* client, | 37 FakeTileManager::FakeTileManager(TileManagerClient* client, |
| 38 ResourcePool* resource_pool) | 38 ResourcePool* resource_pool) |
| 39 : TileManager(client, | 39 : TileManager(client, |
| 40 base::ThreadTaskRunnerHandle::Get().get(), | 40 base::ThreadTaskRunnerHandle::Get().get(), |
| 41 nullptr, | 41 nullptr, |
| 42 std::numeric_limits<size_t>::max(), | 42 std::numeric_limits<size_t>::max(), |
| 43 TileManagerSettings()), | 43 TileManagerSettings()), |
| 44 image_decode_cache_( | 44 image_decode_cache_( |
| 45 ResourceFormat::RGBA_8888, | 45 ResourceFormat::RGBA_8888, |
| 46 LayerTreeSettings().software_decoded_image_budget_bytes) { | 46 LayerTreeSettings().decoded_image_working_set_budget_bytes) { |
| 47 SetDecodedImageTracker(&decoded_image_tracker_); | 47 SetDecodedImageTracker(&decoded_image_tracker_); |
| 48 SetResources(resource_pool, &image_decode_cache_, GetGlobalTaskGraphRunner(), | 48 SetResources(resource_pool, &image_decode_cache_, GetGlobalTaskGraphRunner(), |
| 49 GetGlobalRasterBufferProvider(), | 49 GetGlobalRasterBufferProvider(), |
| 50 std::numeric_limits<size_t>::max(), | 50 std::numeric_limits<size_t>::max(), |
| 51 false /* use_gpu_rasterization */); | 51 false /* use_gpu_rasterization */); |
| 52 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>()); | 52 SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 FakeTileManager::~FakeTileManager() {} | 55 FakeTileManager::~FakeTileManager() {} |
| 56 | 56 |
| 57 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { | 57 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { |
| 58 return std::find(tiles_for_raster.begin(), | 58 return std::find(tiles_for_raster.begin(), |
| 59 tiles_for_raster.end(), | 59 tiles_for_raster.end(), |
| 60 tile) != tiles_for_raster.end(); | 60 tile) != tiles_for_raster.end(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace cc | 63 } // namespace cc |
| OLD | NEW |