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

Unified Diff: cc/resources/tile_manager.cc

Issue 140513006: cc: Simplify picture layer tiling update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: cc/resources/tile_manager.cc
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index 4f9f0aed6545b1792c93111f34313194c1268288..e769d5f465f8d9f806afbc9516254e4ac8100ee3 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -115,38 +115,16 @@ const ManagedTileBin kBinIsActiveMap[2][NUM_BINS] = {
// Determine bin based on three categories of tiles: things we need now,
// things we need soon, and eventually.
inline ManagedTileBin BinFromTilePriority(const TilePriority& prio) {
- // The amount of time/pixels for which we want to have prepainting coverage.
- // Note: All very arbitrary constants: metric-based tuning is welcome!
- const float kPrepaintingWindowTimeSeconds = 1.0f;
enne (OOO) 2014/01/31 23:07:46 Should the soon bin skewport window be 1 second in
vmpstr 2014/02/03 20:27:24 Done.
- const float kBackflingGuardDistancePixels = 314.0f;
vmpstr 2014/01/31 20:53:38 Note that this patch eliminates backfling thing. W
- // Note: The max distances here assume that SOON_BIN will never help overcome
- // raster being too slow (only caching in advance will do that), so we just
- // need enough padding to handle some latency and per-tile variability.
- const float kMaxPrepaintingDistancePixelsHighRes = 2000.0f;
- const float kMaxPrepaintingDistancePixelsLowRes = 4000.0f;
-
- if (prio.distance_to_visible_in_pixels ==
- std::numeric_limits<float>::infinity())
- return NEVER_BIN;
-
- if (prio.time_to_visible_in_seconds == 0)
+ if (prio.priority_bin == TilePriority::NOW)
return NOW_BIN;
- if (prio.resolution == NON_IDEAL_RESOLUTION)
- return EVENTUALLY_BIN;
-
- float max_prepainting_distance_pixels =
- (prio.resolution == HIGH_RESOLUTION)
- ? kMaxPrepaintingDistancePixelsHighRes
- : kMaxPrepaintingDistancePixelsLowRes;
-
- // Soon bin if we are within backfling-guard, or under both the time window
- // and the max distance window.
- if (prio.distance_to_visible_in_pixels < kBackflingGuardDistancePixels ||
- (prio.time_to_visible_in_seconds < kPrepaintingWindowTimeSeconds &&
- prio.distance_to_visible_in_pixels <= max_prepainting_distance_pixels))
+ if (prio.priority_bin == TilePriority::SOON)
return SOON_BIN;
+ if (prio.distance_to_visible ==
enne (OOO) 2014/01/31 23:07:46 When does this happen?
vmpstr 2014/02/03 20:27:24 This is magic :P. distance_to_visible == inf means
+ std::numeric_limits<float>::infinity())
+ return NEVER_BIN;
+
return EVENTUALLY_BIN;
}
@@ -448,9 +426,9 @@ void TileManager::GetTilesWithAssignedBins(PrioritizedTileSet* tiles) {
mts.bin = tile_is_active ? AT_LAST_AND_ACTIVE_BIN : AT_LAST_BIN;
mts.resolution = tile_priority.resolution;
- mts.time_to_needed_in_seconds = tile_priority.time_to_visible_in_seconds;
- mts.distance_to_visible_in_pixels =
- tile_priority.distance_to_visible_in_pixels;
+ mts.priority_bin = tile_priority.priority_bin;
+ mts.distance_to_visible =
+ tile_priority.distance_to_visible;
mts.required_for_activation = tile_priority.required_for_activation;
mts.visible_and_ready_to_draw =
@@ -952,7 +930,7 @@ void TileManager::OnRasterTaskCompleted(
}
FreeUnusedResourcesForTile(tile);
- if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0)
+ if (tile->priority(ACTIVE_TREE).distance_to_visible == 0)
enne (OOO) 2014/01/31 23:07:46 style nit: 0.f
vmpstr 2014/02/03 20:27:24 Done.
did_initialize_visible_tile_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698