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

Unified Diff: cc/tile_manager.cc

Issue 12208123: [cc] Only NOW-binned tiles should contribute to over-memory accounting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 | 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 527e0933fe4819f61b9d45930533db1e69bd40c5..2ad1d45f9f3df4dd016d722b3d43d33d94b8e679 100644
--- a/cc/tile_manager.cc
+++ b/cc/tile_manager.cc
@@ -495,7 +495,7 @@ void TileManager::AssignGpuMemoryToTiles() {
}
size_t bytes_allocatable = global_state_.memory_limit_in_bytes - unreleasable_bytes;
- size_t bytes_that_exceeded_memory_budget = 0;
+ size_t bytes_that_exceeded_memory_budget_in_now_bin = 0;
size_t bytes_left = bytes_allocatable;
for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
Tile* tile = *it;
@@ -511,7 +511,9 @@ void TileManager::AssignGpuMemoryToTiles() {
}
if (tile_bytes > bytes_left) {
managed_tile_state.can_use_gpu_memory = false;
- bytes_that_exceeded_memory_budget += tile_bytes;
+ if (managed_tile_state.bin[HIGH_PRIORITY_BIN] == NOW_BIN ||
+ managed_tile_state.bin[LOW_PRIORITY_BIN] == NOW_BIN)
+ bytes_that_exceeded_memory_budget_in_now_bin += tile_bytes;
FreeResourcesForTile(tile);
continue;
}
@@ -524,11 +526,12 @@ void TileManager::AssignGpuMemoryToTiles() {
}
}
- ever_exceeded_memory_budget_ |= bytes_that_exceeded_memory_budget > 0;
+ ever_exceeded_memory_budget_ |=
+ bytes_that_exceeded_memory_budget_in_now_bin > 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);
+ "over", bytes_that_exceeded_memory_budget_in_now_bin);
}
memory_stats_from_last_assign_.total_budget_in_bytes =
global_state_.memory_limit_in_bytes;
@@ -536,7 +539,7 @@ void TileManager::AssignGpuMemoryToTiles() {
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;
+ bytes_that_exceeded_memory_budget_in_now_bin;
// Reverse two tiles_that_need_* vectors such that pop_back gets
// the highest priority tile.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698