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

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

Issue 1229223003: Revert of Reland: cc: Make tile manager object persist for the length of LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | cc/tiles/tile_manager.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 RasterTask::Vector completed_tasks_; 65 RasterTask::Vector completed_tasks_;
66 }; 66 };
67 base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner = 67 base::LazyInstance<FakeTileTaskRunnerImpl> g_fake_tile_task_runner =
68 LAZY_INSTANCE_INITIALIZER; 68 LAZY_INSTANCE_INITIALIZER;
69 69
70 } // namespace 70 } // namespace
71 71
72 FakeTileManager::FakeTileManager(TileManagerClient* client) 72 FakeTileManager::FakeTileManager(TileManagerClient* client)
73 : TileManager(client, 73 : TileManager(client,
74 base::ThreadTaskRunnerHandle::Get(), 74 base::ThreadTaskRunnerHandle::Get(),
75 nullptr,
76 g_fake_tile_task_runner.Pointer(),
75 std::numeric_limits<size_t>::max()) { 77 std::numeric_limits<size_t>::max()) {
76 SetResources(nullptr, g_fake_tile_task_runner.Pointer(),
77 std::numeric_limits<size_t>::max());
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 resource_pool,
85 g_fake_tile_task_runner.Pointer(),
84 std::numeric_limits<size_t>::max()) { 86 std::numeric_limits<size_t>::max()) {
85 SetResources(resource_pool, g_fake_tile_task_runner.Pointer(),
86 std::numeric_limits<size_t>::max());
87 } 87 }
88 88
89 FakeTileManager::~FakeTileManager() {} 89 FakeTileManager::~FakeTileManager() {}
90 90
91 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { 91 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) {
92 return std::find(tiles_for_raster.begin(), 92 return std::find(tiles_for_raster.begin(),
93 tiles_for_raster.end(), 93 tiles_for_raster.end(),
94 tile) != tiles_for_raster.end(); 94 tile) != tiles_for_raster.end();
95 } 95 }
96 96
97 void FakeTileManager::Release(Tile* tile) { 97 void FakeTileManager::Release(Tile* tile) {
98 TileManager::Release(tile); 98 TileManager::Release(tile);
99 99
100 FreeResourcesForReleasedTiles(); 100 FreeResourcesForReleasedTiles();
101 CleanUpReleasedTiles(); 101 CleanUpReleasedTiles();
102 } 102 }
103 103
104 } // namespace cc 104 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698