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

Unified Diff: cc/tiles/tile_manager.h

Issue 2006973004: Revert of cc: Cleanup tile manager a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager.h
diff --git a/cc/tiles/tile_manager.h b/cc/tiles/tile_manager.h
index 2263e757f322fa4cbaa8ec7185184ec3e1745b58..b98c4ec49ad83ca0a26e2837f05f8ed0f978add4 100644
--- a/cc/tiles/tile_manager.h
+++ b/cc/tiles/tile_manager.h
@@ -95,10 +95,11 @@
// created, and unregister from the manager when they are deleted.
class CC_EXPORT TileManager {
public:
- TileManager(TileManagerClient* client,
- scoped_refptr<base::SequencedTaskRunner> task_runner,
- size_t scheduled_raster_task_limit,
- bool use_partial_raster);
+ static std::unique_ptr<TileManager> Create(
+ TileManagerClient* client,
+ base::SequencedTaskRunner* task_runner,
+ size_t scheduled_raster_task_limit,
+ bool use_partial_raster);
virtual ~TileManager();
// Assigns tile memory and schedules work to prepare tiles for drawing.
@@ -173,8 +174,10 @@
std::vector<Tile*> AllTilesForTesting() const {
std::vector<Tile*> tiles;
- for (auto& tile_pair : tiles_)
- tiles.push_back(tile_pair.second);
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end();
+ ++it) {
+ tiles.push_back(it->second);
+ }
return tiles;
}
@@ -195,6 +198,11 @@
}
protected:
+ TileManager(TileManagerClient* client,
+ scoped_refptr<base::SequencedTaskRunner> task_runner,
+ size_t scheduled_raster_task_limit,
+ bool use_partial_raster);
+
void FreeResourcesForReleasedTiles();
void CleanUpReleasedTiles();
@@ -203,9 +211,17 @@
virtual void Release(Tile* tile);
Tile::Id GetUniqueTileId() { return ++next_tile_id_; }
+ typedef std::vector<PrioritizedTile> PrioritizedTileVector;
+ typedef std::set<Tile*> TileSet;
+
// Virtual for test
virtual void ScheduleTasks(
- const std::vector<PrioritizedTile>& tiles_that_need_to_be_rasterized);
+ const PrioritizedTileVector& tiles_that_need_to_be_rasterized);
+
+ void AssignGpuMemoryToTiles(
+ RasterTilePriorityQueue* raster_priority_queue,
+ size_t scheduled_raser_task_limit,
+ PrioritizedTileVector* tiles_that_need_to_be_rasterized);
private:
class MemoryUsage {
@@ -265,7 +281,6 @@
scoped_refptr<TileTask> CreateTaskSetFinishedTask(
void (TileManager::*callback)());
- std::vector<PrioritizedTile> AssignGpuMemoryToTiles();
std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
ScheduledTasksStateAsValue() const;
@@ -279,7 +294,8 @@
const bool use_partial_raster_;
bool use_gpu_rasterization_;
- std::unordered_map<Tile::Id, Tile*> tiles_;
+ using TileMap = std::unordered_map<Tile::Id, Tile*>;
+ TileMap tiles_;
bool all_tiles_that_need_to_be_rasterized_are_scheduled_;
MemoryHistory::Entry memory_stats_from_last_assign_;
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698