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

Unified Diff: cc/tile_manager.cc

Issue 12149004: [cc] Show GPU memory usage and overage below FPS counter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_manager.cc
diff --git a/cc/tile_manager.cc b/cc/tile_manager.cc
index 612e39dcb3c87cbc9782a9176d6552e3ad78678f..d76d83299206dcd40f26450daef1625b5c6c8fe0 100644
--- a/cc/tile_manager.cc
+++ b/cc/tile_manager.cc
@@ -463,8 +463,9 @@ void TileManager::AssignGpuMemoryToTiles() {
DidTileRasterStateChange(tile, IDLE_STATE);
}
- size_t bytes_left = global_state_.memory_limit_in_bytes - unreleasable_bytes;
+ size_t bytes_allocatable = global_state_.memory_limit_in_bytes - unreleasable_bytes;
size_t bytes_that_exceeded_memory_budget = 0;
+ size_t bytes_left = bytes_allocatable;
for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
Tile* tile = *it;
size_t tile_bytes = tile->bytes_consumed_if_allocated();
@@ -492,14 +493,17 @@ void TileManager::AssignGpuMemoryToTiles() {
}
}
- if (bytes_that_exceeded_memory_budget)
- ever_exceeded_memory_budget_ = true;
-
+ ever_exceeded_memory_budget_ |= bytes_that_exceeded_memory_budget > 0;
if (ever_exceeded_memory_budget_) {
TRACE_COUNTER_ID2("cc", "over_memory_budget", this,
"budget", global_state_.memory_limit_in_bytes,
"over", bytes_that_exceeded_memory_budget);
}
+ memory_stats_from_last_assign_.bytes_allocated =
+ bytes_allocatable - bytes_left;
+ memory_stats_from_last_assign_.bytes_unreleasable = unreleasable_bytes;
+ memory_stats_from_last_assign_.bytes_over =
+ bytes_that_exceeded_memory_budget;
// Reverse two tiles_that_need_* vectors such that pop_back gets
// the highest priority tile.
« no previous file with comments | « cc/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698