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

Unified Diff: cc/resources/picture_layer_tiling.cc

Issue 1021663002: cc: Fix skewport math (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index b52ba9cdf13fbe5b37f85047ebf71b138d48357e..8c5d88c7df25e2d9f603384f3fc16a44482fdc8b 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -564,11 +564,17 @@ gfx::Rect PictureLayerTiling::ComputeSkewport(
extrapolation_multiplier * (old_right - new_right),
extrapolation_multiplier * (old_bottom - new_bottom));
- // Clip the skewport to |max_skewport|.
+ // Ensure that visible rect is contained in the skewport.
+ skewport.Union(visible_rect_in_content_space);
+
+ // Clip the skewport to |max_skewport|. This needs to happen after the
+ // union in case intersecting would have left the empty rect.
skewport.Intersect(max_skewport);
- // Finally, ensure that visible rect is contained in the skewport.
- skewport.Union(visible_rect_in_content_space);
+ // The max_skewport should always contain the visible_rect_in_content_space
+ // so this should still be true.
+ DCHECK(skewport.Contains(visible_rect_in_content_space));
+
return skewport;
}
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling_unittest.cc » ('j') | cc/resources/picture_layer_tiling_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698