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

Unified Diff: cc/tiles/picture_layer_tiling.cc

Issue 1131383007: cc: Ensure that skewport.Contains(visible_rect) is always true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/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 8db23522e6bfe11783d8dabc98dad573cbca83ca..3ae1ad97e53abdab385a36508dba801b724049da 100644
--- a/cc/tiles/picture_layer_tiling.cc
+++ b/cc/tiles/picture_layer_tiling.cc
@@ -552,6 +552,13 @@ gfx::Rect PictureLayerTiling::ComputeSkewport(
// union in case intersecting would have left the empty rect.
skewport.Intersect(max_skewport);
+ // Due to limits in int's representation, it is possible that the two
+ // operations above (union and intersect) result in an empty skewport. To
+ // avoid any unpleasant situations like that, union the visible rect again to
+ // ensure that skewport.Contains(visible_rect_in_content_space) is always
+ // true.
+ skewport.Union(visible_rect_in_content_space);
+
return skewport;
}
« 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