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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 16160005: cc: Ignore offscreen tiles for activation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test Created 7 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 | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 3b3fa96d0e78786131cf57f47bf113a6e6400933..b2bb397921766b8e7b3ca3be1fa8128a7f0a4c59 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -684,11 +684,15 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const {
++iter) {
if (!*iter || !iter->tile_version().IsReadyToDraw())
continue;
+
+ // This iteration is over the visible content rect which is potentially
+ // less conservative than projecting the viewport into the layer.
+ // Ignore tiles that are know to be outside the viewport.
+ if (iter->priority(PENDING_TREE).distance_to_visible_in_pixels != 0)
+ continue;
+
missing_region.Subtract(iter.geometry_rect());
iter->mark_required_for_activation();
-
- DCHECK_EQ(iter->priority(PENDING_TREE).distance_to_visible_in_pixels, 0);
- DCHECK_EQ(iter->priority(PENDING_TREE).time_to_visible_in_seconds, 0);
}
}
@@ -699,15 +703,21 @@ void PictureLayerImpl::MarkVisibleResourcesAsRequired() const {
iter;
++iter) {
// A null tile (i.e. missing recording) can just be skipped.
+ if (!*iter)
+ continue;
+
+ // This iteration is over the visible content rect which is potentially
+ // less conservative than projecting the viewport into the layer.
+ // Ignore tiles that are know to be outside the viewport.
+ if (iter->priority(PENDING_TREE).distance_to_visible_in_pixels != 0)
+ continue;
+
// If the missing region doesn't cover it, this tile is fully
// covered by acceptable tiles at other scales.
- if (!*iter || !missing_region.Intersects(iter.geometry_rect()))
+ if (!missing_region.Intersects(iter.geometry_rect()))
continue;
- iter->mark_required_for_activation();
- // These must be true for this tile to end up in the NOW_BIN in TileManager.
- DCHECK_EQ(iter->priority(PENDING_TREE).distance_to_visible_in_pixels, 0);
- DCHECK_EQ(iter->priority(PENDING_TREE).time_to_visible_in_seconds, 0);
+ iter->mark_required_for_activation();
}
}
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698