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