summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorvmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 09:57:16 +0000
committervmpstr@chromium.org <vmpstr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-04 09:57:16 +0000
commitfa2f8a3c004f7a929d24451e7d5b9ba1e9f7098a (patch)
tree6a84ad1e21468681121e2316611286e3cdd93cf6 /cc
parent7f5ab08a19ad33f2ec3e5fa608f8436d71a07d59 (diff)
downloadchromium_src-fa2f8a3c004f7a929d24451e7d5b9ba1e9f7098a.zip
chromium_src-fa2f8a3c004f7a929d24451e7d5b9ba1e9f7098a.tar.gz
chromium_src-fa2f8a3c004f7a929d24451e7d5b9ba1e9f7098a.tar.bz2
cc: Moved some TileManager code into a separate function
Moved the assigning-tiles-to-bins code into a separate function. I think this makes ManageTiles more clear. BUG=225804 Review URL: https://chromiumcodereview.appspot.com/13583003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r--cc/resources/tile_manager.cc39
-rw-r--r--cc/resources/tile_manager.h1
2 files changed, 22 insertions, 18 deletions
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index 4627b46..24155c5 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -238,23 +238,8 @@ class BinComparator {
}
};
-void TileManager::SortTiles() {
- TRACE_EVENT0("cc", "TileManager::SortTiles");
- TRACE_COUNTER_ID1(
- "cc", "LiveTileCount", this, live_or_allocated_tiles_.size());
-
- // Sort by bin, resolution and time until needed.
- std::sort(live_or_allocated_tiles_.begin(),
- live_or_allocated_tiles_.end(), BinComparator());
-}
-
-void TileManager::ManageTiles() {
- TRACE_EVENT0("cc", "TileManager::ManageTiles");
- manage_tiles_pending_ = false;
- ++manage_tiles_call_count_;
-
+void TileManager::AssignBinsToTiles() {
const TreePriority tree_priority = global_state_.tree_priority;
- TRACE_COUNTER_ID1("cc", "TileCount", this, all_tiles_.size());
// Memory limit policy works by mapping some bin states to the NEVER bin.
TileManagerBin bin_map[NUM_BINS];
@@ -338,12 +323,30 @@ void TileManager::ManageTiles() {
live_or_allocated_tiles_.push_back(tile);
}
+
TRACE_COUNTER_ID1("cc", "LiveOrAllocatedTileCount", this,
live_or_allocated_tiles_.size());
+}
- SortTiles();
+void TileManager::SortTiles() {
+ TRACE_EVENT0("cc", "TileManager::SortTiles");
+ TRACE_COUNTER_ID1(
+ "cc", "LiveTileCount", this, live_or_allocated_tiles_.size());
+
+ // Sort by bin, resolution and time until needed.
+ std::sort(live_or_allocated_tiles_.begin(),
+ live_or_allocated_tiles_.end(), BinComparator());
+}
+
+void TileManager::ManageTiles() {
+ TRACE_EVENT0("cc", "TileManager::ManageTiles");
+ TRACE_COUNTER_ID1("cc", "TileCount", this, all_tiles_.size());
- // Assign gpu memory and determine what tiles need to be rasterized.
+ manage_tiles_pending_ = false;
+ ++manage_tiles_call_count_;
+
+ AssignBinsToTiles();
+ SortTiles();
AssignGpuMemoryToTiles();
TRACE_EVENT_INSTANT1("cc", "DidManage", TRACE_EVENT_SCOPE_THREAD,
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index a8f62d1..4c08c54 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -119,6 +119,7 @@ class CC_EXPORT TileManager : public WorkerPoolClient {
RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
+ void AssignBinsToTiles();
void SortTiles();
void AssignGpuMemoryToTiles();
void FreeResourcesForTile(Tile* tile);