Index: cc/tiles/picture_layer_tiling.cc |
diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc |
index 344cb32b6c04cc92ce00887c8862c30add532d73..8b7d5757fb88c7e7868cf4b962febefc526d574e 100644 |
--- a/cc/tiles/picture_layer_tiling.cc |
+++ b/cc/tiles/picture_layer_tiling.cc |
@@ -808,6 +808,38 @@ bool PictureLayerTiling::IsTileRequiredForDraw(const Tile* tile) const { |
return true; |
} |
+bool PictureLayerTiling::ShouldDecodeCheckeredImagesForTile( |
vmpstr
2017/04/18 00:20:00
None of the checks here really care if the tile is
Khushal
2017/04/19 06:16:41
Answered above.
|
+ const Tile* tile) const { |
+ // If this is the pending tree and the tile is not occluded, it needs to be |
+ // decoded for checker-images. |
vmpstr
2017/04/18 00:20:00
Tile isn't "decoded", can you rephrase the comment
Khushal
2017/04/19 06:16:41
Done.
|
+ 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 |
vmpstr
2017/04/18 00:20:00
Can you elaborate on this?
Khushal
2017/04/19 06:16:41
The check is for making sure that we don't process
|
+ // tree. |
+ // TODO(khushalsagar): If we have a pending tree but no twin tiling, this tile |
+ // will get nuked on activation. |
+ 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 once the pending tree is activated, it is |
+ // the new 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); |
+} |
vmpstr
2017/04/18 00:20:00
This function sounds very similar to RequiredForAc
Khushal
2017/04/19 06:16:41
Its similar to RequiredForActivation for the part
|
+ |
void PictureLayerTiling::UpdateRequiredStatesOnTile(Tile* tile) const { |
tile->set_required_for_activation(IsTileRequiredForActivation(tile)); |
tile->set_required_for_draw(IsTileRequiredForDraw(tile)); |
@@ -836,7 +868,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, |
+ ShouldDecodeCheckeredImagesForTile(tile)); |
} |
std::map<const Tile*, PrioritizedTile> |