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

Unified Diff: trunk/src/cc/layers/picture_layer_impl.cc

Issue 347493002: Revert 277964 "cc: In SyncFromActiveLayer, drop all tiles not in..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | « trunk/src/cc/layers/picture_layer.cc ('k') | trunk/src/cc/resources/picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/layers/picture_layer_impl.cc
===================================================================
--- trunk/src/cc/layers/picture_layer_impl.cc (revision 277979)
+++ trunk/src/cc/layers/picture_layer_impl.cc (working copy)
@@ -626,7 +626,6 @@
}
void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
- TRACE_EVENT0("cc", "SyncFromActiveLayer");
DCHECK(!other->needs_post_commit_initialization_);
DCHECK(other->tilings_);
@@ -641,6 +640,23 @@
raster_contents_scale_ = other->raster_contents_scale_;
low_res_raster_contents_scale_ = other->low_res_raster_contents_scale_;
+ // Add synthetic invalidations for any recordings that were dropped. As
+ // tiles are updated to point to this new pile, this will force the dropping
+ // of tiles that can no longer be rastered. This is not ideal, but is a
+ // trade-off for memory (use the same pile as much as possible, by switching
+ // during DidBecomeActive) and for time (don't bother checking every tile
+ // during activation to see if the new pile can still raster it).
+ for (int x = 0; x < pile_->num_tiles_x(); ++x) {
+ for (int y = 0; y < pile_->num_tiles_y(); ++y) {
+ bool previously_had = other->pile_->HasRecordingAt(x, y);
+ bool now_has = pile_->HasRecordingAt(x, y);
+ if (now_has || !previously_had)
+ continue;
+ gfx::Rect layer_rect = pile_->tile_bounds(x, y);
+ invalidation_.Union(layer_rect);
+ }
+ }
+
// Union in the other newly exposed regions as invalid.
Region difference_region = Region(gfx::Rect(bounds()));
difference_region.Subtract(gfx::Rect(other->bounds()));
« no previous file with comments | « trunk/src/cc/layers/picture_layer.cc ('k') | trunk/src/cc/resources/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698