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

Unified Diff: cc/tiles/picture_layer_tiling.cc

Issue 2651413004: cc: Fix tile priority inversion in picture layer tiling. (Closed)
Patch Set: Created 3 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/tiles/picture_layer_tiling.cc
diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc
index 623ab3edcc4c4ad359ce0303a438783d9e6e46c5..e86b43017717e36dd1204037704998b16e9c026f 100644
--- a/cc/tiles/picture_layer_tiling.cc
+++ b/cc/tiles/picture_layer_tiling.cc
@@ -722,8 +722,10 @@ bool PictureLayerTiling::IsTileOccluded(const Tile* tile) const {
bool PictureLayerTiling::IsTileOccludedOnCurrentTree(const Tile* tile) const {
if (!current_occlusion_in_layer_space_.HasOcclusion())
return false;
+ gfx::Rect tile_bounds =
+ tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index());
gfx::Rect tile_query_rect =
- gfx::IntersectRects(tile->content_rect(), current_visible_rect_);
+ gfx::IntersectRects(tile_bounds, current_visible_rect_);
// Explicitly check if the tile is outside the viewport. If so, we need to
// return false, since occlusion for this tile is unknown.
if (tile_query_rect.IsEmpty())
@@ -747,8 +749,9 @@ bool PictureLayerTiling::IsTileRequiredForActivation(const Tile* tile) const {
if (IsTileOccluded(tile))
return false;
- bool tile_is_visible =
- tile->content_rect().Intersects(current_visible_rect_);
+ gfx::Rect tile_bounds =
+ tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index());
+ bool tile_is_visible = tile_bounds.Intersects(current_visible_rect_);
if (!tile_is_visible)
return false;
@@ -793,7 +796,9 @@ bool PictureLayerTiling::IsTileRequiredForDraw(const Tile* tile) const {
if (resolution_ != HIGH_RESOLUTION)
return false;
- bool tile_is_visible = current_visible_rect_.Intersects(tile->content_rect());
+ gfx::Rect tile_bounds =
+ tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index());
+ bool tile_is_visible = current_visible_rect_.Intersects(tile_bounds);
if (!tile_is_visible)
return false;
@@ -802,12 +807,6 @@ bool PictureLayerTiling::IsTileRequiredForDraw(const Tile* tile) const {
return true;
}
-void PictureLayerTiling::UpdateRequiredStatesOnTile(Tile* tile) const {
- DCHECK(tile);
- tile->set_required_for_activation(IsTileRequiredForActivation(tile));
- tile->set_required_for_draw(IsTileRequiredForDraw(tile));
-}
-
PrioritizedTile PictureLayerTiling::MakePrioritizedTile(
Tile* tile,
PriorityRectType priority_rect_type) const {
@@ -816,6 +815,11 @@ PrioritizedTile PictureLayerTiling::MakePrioritizedTile(
<< "Tile layer rect: " << tile->enclosing_layer_rect().ToString();
const auto& tile_priority = ComputePriorityForTile(tile, priority_rect_type);
+ bool is_now_bin = tile_priority.priority_bin == TilePriority::NOW;
+ tile->set_required_for_activation(is_now_bin &&
danakj 2017/01/30 16:55:18 I don't see a test checking this code, which appea
vmpstr 2017/01/30 19:38:20 This was just a safeguard that we never have requi
+ IsTileRequiredForActivation(tile));
+ tile->set_required_for_draw(is_now_bin && IsTileRequiredForDraw(tile));
+
// Note that TileManager will consider this flag but may rasterize the tile
// anyway (if tile is required for activation for example). We should process
// the tile for images only if it's further than half of the skewport extent.
@@ -833,7 +837,6 @@ PictureLayerTiling::UpdateAndGetAllPrioritizedTilesForTesting() const {
std::map<const Tile*, PrioritizedTile> result;
for (const auto& key_tile_pair : tiles_) {
Tile* tile = key_tile_pair.second.get();
- UpdateRequiredStatesOnTile(tile);
PrioritizedTile prioritized_tile =
MakePrioritizedTile(tile, ComputePriorityRectTypeForTile(tile));
result.insert(std::make_pair(prioritized_tile.tile(), prioritized_tile));

Powered by Google App Engine
This is Rietveld 408576698