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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2744423002: Handle large rects better. (Closed)
Patch Set: Add comment and change constant reference. Created 3 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
« no previous file with comments | « base/numerics/saturated_arithmetic_arm.h ('k') | ui/gfx/geometry/rect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index a36b6d37d4952e6afe2cc66564ad8c38c3038b3c..0f4d886ecaedc73a3c9ebdbd1051134393d08828 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -1124,9 +1124,14 @@ TEST_F(LayerTreeHostCommonTest, LayerFullyContainedWithinClipInTargetSpace) {
page_scale_layer, inner_viewport_scroll_layer,
outer_viewport_scroll_layer);
- // Mapping grand_child's bounds to screen space produces an empty rect so
- // grand_child should be hidden.
- EXPECT_EQ(gfx::Rect(), grand_child->visible_layer_rect());
+ // Mapping grand_child's bounds to screen space produces an empty rect, but
+ // only because it is turned sideways. The entire rect is contained inside
+ // the clip, and is only empty so long as the numerical precision of the
+ // transform is effectively perfect. Currently we do the calculation the
+ // other way around, and the Projection of the screen space clip into layer
+ // space includes the entire bounds.
+ EXPECT_EQ(gfx::Rect(grand_child->bounds()),
+ grand_child->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest, TransformsForDegenerateIntermediateLayer) {
« no previous file with comments | « base/numerics/saturated_arithmetic_arm.h ('k') | ui/gfx/geometry/rect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698