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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2015653002: cc: Visible Rect Calculation use RectF between transformations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separateclipvis
Patch Set: rebase Created 4 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 | « cc/trees/draw_property_utils.cc ('k') | no next file » | 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 d89c86b83c9c3ad04b554ab6a6d5b0aefaf1cfda..f86e33fbf1b64d5afa05aaed6abbf4ea274ce0dd 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -3203,10 +3203,8 @@ TEST_F(LayerTreeHostCommonTest, VisibleContentRectWithClippingAndScaling) {
grand_child->SetDrawsContent(true);
ExecuteCalculateDrawProperties(root);
- // The visible rect is expanded to integer coordinates in target space before
- // being projected back to layer space, where it is once again expanded to
- // integer coordinates.
- EXPECT_EQ(gfx::Rect(49, 49), grand_child->visible_layer_rect());
+ // The visible rect is expanded to integer coordinates.
+ EXPECT_EQ(gfx::Rect(41, 41), grand_child->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest,
@@ -4130,9 +4128,7 @@ TEST_F(LayerTreeHostCommonTest,
// On the clipped surface, only a quarter of the child1 is visible, but when
// rotating it back to child1's content space, the actual enclosing rect ends
// up covering the full left half of child1.
- //
- // Given the floating point math, this number is a little bit fuzzy.
- EXPECT_EQ(gfx::Rect(0, 0, 26, 50), child1->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(0, 0, 25, 50), child1->visible_layer_rect());
// The child's DrawableContentRect is unclipped.
EXPECT_EQ(unclipped_surface_content, child1->drawable_content_rect());
@@ -9117,7 +9113,7 @@ TEST_F(LayerTreeHostCommonTest, RenderSurfaceClipsSubtree) {
ClipTree& clip_tree = root->layer_tree_impl()->property_trees()->clip_tree;
ClipNode* clip_node = clip_tree.Node(render_surface->clip_tree_index());
EXPECT_FALSE(clip_node->data.applies_local_clip);
- EXPECT_EQ(gfx::Rect(22, 21), test_layer->visible_layer_rect());
+ EXPECT_EQ(gfx::Rect(20, 20), test_layer->visible_layer_rect());
}
TEST_F(LayerTreeHostCommonTest, TransformOfParentClipNodeAncestorOfTarget) {
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698