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

Unified Diff: cc/tiles/picture_layer_tiling.cc

Issue 2726343004: cc: Optimize decode scheduling for checker-images. (Closed)
Patch Set: fixed tile iteration Created 3 years, 8 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/tiles/picture_layer_tiling.cc
diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc
index b429260472a1a0d523c50d1565cbc9309a2cabe3..21b1633b46c411c2a8d9fc9d44167d21dc1d20a0 100644
--- a/cc/tiles/picture_layer_tiling.cc
+++ b/cc/tiles/picture_layer_tiling.cc
@@ -815,6 +815,35 @@ bool PictureLayerTiling::IsTileRequiredForDraw(const Tile* tile) const {
return true;
}
+bool PictureLayerTiling::ShouldProcessTileForCheckerImages(
Khushal 2017/04/11 22:45:22 This one was to skip tiles on the active tree if t
+ const Tile* tile) const {
+ // If this is the pending tree and the tile is not occluded, it needs to be
+ // processed for checker-images.
+ if (tree_ == PENDING_TREE)
+ return !IsTileOccludedOnCurrentTree(tile);
+
+ DCHECK_EQ(tree_, ACTIVE_TREE);
+ const PictureLayerTiling* pending_twin =
+ client_->GetPendingOrActiveTwinTiling(this);
+
+ // If we don't have a pending twin, the tiling may be evicted upon activation,
+ // or we may not have a pending tree. So use the occlusion on the current
+ // tree.
+ if (!pending_twin)
+ return !IsTileOccludedOnCurrentTree(tile);
+
+ // If the tile will be replaced upon activation, then we don't need to process
+ // it for checkered images. Since it is the active tree's content that we will
+ // invalidate and replace once the decode finishes.
+ if (!TilingMatchesTileIndices(pending_twin) ||
+ pending_twin->TileAt(tile->tiling_i_index(), tile->tiling_j_index())) {
+ return false;
+ }
+
+ // Ask the pending twin if this tile will become occluded upon activation.
+ return !pending_twin->IsTileOccludedOnCurrentTree(tile);
+}
+
void PictureLayerTiling::UpdateRequiredStatesOnTile(Tile* tile) const {
tile->set_required_for_activation(IsTileRequiredForActivation(tile));
tile->set_required_for_draw(IsTileRequiredForDraw(tile));
@@ -842,7 +871,8 @@ PrioritizedTile PictureLayerTiling::MakePrioritizedTile(
tile_priority.distance_to_visible >
0.5f * max_skewport_extent_in_screen_space_);
return PrioritizedTile(tile, this, tile_priority, IsTileOccluded(tile),
- process_for_images_only);
+ process_for_images_only,
+ ShouldProcessTileForCheckerImages(tile));
}
std::map<const Tile*, PrioritizedTile>
« no previous file with comments | « cc/tiles/picture_layer_tiling.h ('k') | cc/tiles/prioritized_tile.h » ('j') | cc/tiles/tile.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698