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 <deque> | 7 #include <deque> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 LAZY_INSTANCE_INITIALIZER; | 67 LAZY_INSTANCE_INITIALIZER; |
68 | 68 |
69 } // namespace | 69 } // namespace |
70 | 70 |
71 FakeTileManager::FakeTileManager(TileManagerClient* client) | 71 FakeTileManager::FakeTileManager(TileManagerClient* client) |
72 : TileManager(client, | 72 : TileManager(client, |
73 base::ThreadTaskRunnerHandle::Get(), | 73 base::ThreadTaskRunnerHandle::Get(), |
74 std::numeric_limits<size_t>::max(), | 74 std::numeric_limits<size_t>::max(), |
75 false /* use_partial_raster */) { | 75 false /* use_partial_raster */) { |
76 SetResources(nullptr, g_fake_tile_task_runner.Pointer(), | 76 SetResources(nullptr, g_fake_tile_task_runner.Pointer(), |
77 std::numeric_limits<size_t>::max()); | 77 std::numeric_limits<size_t>::max(), false); |
78 } | 78 } |
79 | 79 |
80 FakeTileManager::FakeTileManager(TileManagerClient* client, | 80 FakeTileManager::FakeTileManager(TileManagerClient* client, |
81 ResourcePool* resource_pool) | 81 ResourcePool* resource_pool) |
82 : TileManager(client, | 82 : TileManager(client, |
83 base::ThreadTaskRunnerHandle::Get(), | 83 base::ThreadTaskRunnerHandle::Get(), |
84 std::numeric_limits<size_t>::max(), | 84 std::numeric_limits<size_t>::max(), |
85 false /* use_partial_raster */) { | 85 false /* use_partial_raster */) { |
86 SetResources(resource_pool, g_fake_tile_task_runner.Pointer(), | 86 SetResources(resource_pool, g_fake_tile_task_runner.Pointer(), |
87 std::numeric_limits<size_t>::max()); | 87 std::numeric_limits<size_t>::max(), false); |
88 } | 88 } |
89 | 89 |
90 FakeTileManager::~FakeTileManager() {} | 90 FakeTileManager::~FakeTileManager() {} |
91 | 91 |
92 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { | 92 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { |
93 return std::find(tiles_for_raster.begin(), | 93 return std::find(tiles_for_raster.begin(), |
94 tiles_for_raster.end(), | 94 tiles_for_raster.end(), |
95 tile) != tiles_for_raster.end(); | 95 tile) != tiles_for_raster.end(); |
96 } | 96 } |
97 | 97 |
98 void FakeTileManager::Release(Tile* tile) { | 98 void FakeTileManager::Release(Tile* tile) { |
99 TileManager::Release(tile); | 99 TileManager::Release(tile); |
100 | 100 |
101 FreeResourcesForReleasedTiles(); | 101 FreeResourcesForReleasedTiles(); |
102 CleanUpReleasedTiles(); | 102 CleanUpReleasedTiles(); |
103 } | 103 } |
104 | 104 |
105 } // namespace cc | 105 } // namespace cc |
OLD | NEW |