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

Unified Diff: cc/tiles/picture_layer_tiling.cc

Issue 1894943002: Have pending and active tree use the same space for invalidations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | cc/tiles/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/picture_layer_tiling.cc
diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc
index 9e79f4a40fa08517ff05fdd1002c4a511d773b6f..01beed6937045970d700af0c0b34e1f2203844bd 100644
--- a/cc/tiles/picture_layer_tiling.cc
+++ b/cc/tiles/picture_layer_tiling.cc
@@ -386,10 +386,15 @@ bool PictureLayerTiling::ShouldCreateTileAt(
const Region* layer_invalidation = client_->GetPendingInvalidation();
// If this tile is invalidated, then the pending tree should create one.
- if (layer_invalidation &&
- layer_invalidation->Intersects(info.enclosing_layer_rect))
- return true;
-
+ // Do the intersection test in content space to match the corresponding check
+ // on the active tree and avoid floating point inconsistencies.
+ for (Region::Iterator iter(*layer_invalidation); iter.has_rect();
+ iter.next()) {
+ gfx::Rect invalid_content_rect =
+ gfx::ScaleToEnclosingRect(iter.rect(), contents_scale_);
+ if (invalid_content_rect.Intersects(info.content_rect))
+ return true;
+ }
// If the active tree doesn't have a tile here, but it's in the pending tree's
// visible rect, then the pending tree should create a tile. This can happen
// if the pending visible rect is outside of the active tree's live tiles
« no previous file with comments | « no previous file | cc/tiles/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698