Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: cc/test/fake_tile_manager.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/fake_proxy.h ('k') | cc/test/layer_tree_pixel_resource_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 RasterTask::Vector completed_tasks_; 58 RasterTask::Vector completed_tasks_;
59 }; 59 };
60 base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner = 60 base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner =
61 LAZY_INSTANCE_INITIALIZER; 61 LAZY_INSTANCE_INITIALIZER;
62 62
63 } // namespace 63 } // namespace
64 64
65 FakeTileManager::FakeTileManager(TileManagerClient* client) 65 FakeTileManager::FakeTileManager(TileManagerClient* client)
66 : TileManager(client, 66 : TileManager(client,
67 base::MessageLoopProxy::current(), 67 base::MessageLoopProxy::current(),
68 NULL, 68 nullptr,
69 g_fake_tile_task_runner.Pointer(), 69 g_fake_tile_task_runner.Pointer(),
70 nullptr,
70 std::numeric_limits<size_t>::max()) { 71 std::numeric_limits<size_t>::max()) {
71 } 72 }
72 73
73 FakeTileManager::FakeTileManager(TileManagerClient* client, 74 FakeTileManager::FakeTileManager(TileManagerClient* client,
74 ResourcePool* resource_pool) 75 ResourcePool* resource_pool)
75 : TileManager(client, 76 : TileManager(client,
76 base::MessageLoopProxy::current(), 77 base::MessageLoopProxy::current(),
77 resource_pool, 78 resource_pool,
78 g_fake_tile_task_runner.Pointer(), 79 g_fake_tile_task_runner.Pointer(),
80 nullptr,
79 std::numeric_limits<size_t>::max()) { 81 std::numeric_limits<size_t>::max()) {
80 } 82 }
81 83
82 FakeTileManager::~FakeTileManager() {} 84 FakeTileManager::~FakeTileManager() {}
83 85
84 void FakeTileManager::AssignMemoryToTiles(
85 const GlobalStateThatImpactsTilePriority& state) {
86 tiles_for_raster.clear();
87
88 SetGlobalStateForTesting(state);
89 AssignGpuMemoryToTiles(&tiles_for_raster);
90 }
91
92 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { 86 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
93 return std::find(tiles_for_raster.begin(), 87 return std::find(tiles_for_raster.begin(),
94 tiles_for_raster.end(), 88 tiles_for_raster.end(),
95 tile) != tiles_for_raster.end(); 89 tile) != tiles_for_raster.end();
96 } 90 }
97 91
98 void FakeTileManager::Release(Tile* tile) { 92 void FakeTileManager::Release(Tile* tile) {
99 TileManager::Release(tile); 93 TileManager::Release(tile);
100 94
101 FreeResourcesForReleasedTiles(); 95 FreeResourcesForReleasedTiles();
102 CleanUpReleasedTiles(); 96 CleanUpReleasedTiles();
103 } 97 }
104 98
105 } // namespace cc 99 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_proxy.h ('k') | cc/test/layer_tree_pixel_resource_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698