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

Unified Diff: cc/tiles/raster_tile_priority_queue_all.cc

Issue 2899403003: cc: Give non-drawing layers that are rasterized a lower priority. (Closed)
Patch Set: type Created 3 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 | « cc/tiles/picture_layer_tiling.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/raster_tile_priority_queue_all.cc
diff --git a/cc/tiles/raster_tile_priority_queue_all.cc b/cc/tiles/raster_tile_priority_queue_all.cc
index 0d54a592607ee0558de53349c83fdde3c0aaf86a..c09da4a75d7ad04be66c9ea831503afc4199187e 100644
--- a/cc/tiles/raster_tile_priority_queue_all.cc
+++ b/cc/tiles/raster_tile_priority_queue_all.cc
@@ -16,15 +16,22 @@ class RasterOrderComparator {
explicit RasterOrderComparator(TreePriority tree_priority)
: tree_priority_(tree_priority) {}
+ // Note that in this function, we have to return true if and only if
+ // a is strictly lower priority than b.
bool operator()(
const std::unique_ptr<TilingSetRasterQueueAll>& a_queue,
const std::unique_ptr<TilingSetRasterQueueAll>& b_queue) const {
- // Note that in this function, we have to return true if and only if
- // a is strictly lower priority than b.
const TilePriority& a_priority = a_queue->Top().priority();
const TilePriority& b_priority = b_queue->Top().priority();
bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY;
+ // If the priority bin is the same but one of the tiles is from a
+ // non-drawing layer, then the drawing layer has a higher priority.
+ if (b_priority.priority_bin == a_priority.priority_bin &&
+ b_queue->is_drawing_layer() != a_queue->is_drawing_layer()) {
+ return b_queue->is_drawing_layer();
+ }
+
// If the bin is the same but the resolution is not, then the order will be
// determined by whether we prioritize low res or not.
// TODO(vmpstr): Remove this when TilePriority is no longer a member of Tile
@@ -63,8 +70,9 @@ void CreateTilingSetRasterQueues(
PictureLayerTilingSet* tiling_set = layer->picture_layer_tiling_set();
bool prioritize_low_res = tree_priority == SMOOTHNESS_TAKES_PRIORITY;
std::unique_ptr<TilingSetRasterQueueAll> tiling_set_queue =
- base::MakeUnique<TilingSetRasterQueueAll>(tiling_set,
- prioritize_low_res);
+ base::MakeUnique<TilingSetRasterQueueAll>(
+ tiling_set, prioritize_low_res,
+ layer->contributes_to_drawn_render_surface());
// Queues will only contain non empty tiling sets.
if (!tiling_set_queue->IsEmpty())
queues->push_back(std::move(tiling_set_queue));
« no previous file with comments | « cc/tiles/picture_layer_tiling.h ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698