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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2271273003: cc : Remove DCHECK in TransformTree::ComputeTranslation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: setDouble again Created 4 years, 4 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/trees/property_tree.cc » ('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 ff73a5ab808e4ec0df1026e714fa30fd21f04945..e3f8c64cde1f1336cf4851708da44e78a3ba6b10 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -9350,6 +9350,47 @@ TEST_F(LayerTreeHostCommonTest,
EXPECT_EQ(gfx::Rect(15, 15), test_layer->visible_layer_rect());
}
+TEST_F(LayerTreeHostCommonTest, NoisyTransform) {
Alexander Potapenko 2016/08/25 09:43:28 Did you intend to submit this test as well?
jaydasika 2016/08/26 17:39:31 Yes. To ensure that no one adds back the DCHECK th
+ LayerImpl* root = root_layer_for_testing();
+ LayerImpl* render_surface = AddChild<LayerImpl>(root);
+ LayerImpl* scroll_child = AddChild<LayerImpl>(render_surface);
+ LayerImpl* scroll_clip = AddChild<LayerImpl>(render_surface);
+ LayerImpl* scroll_parent = AddChild<LayerImpl>(scroll_clip);
+
+ scroll_child->test_properties()->scroll_parent = scroll_parent;
+ scroll_parent->test_properties()->scroll_children =
+ base::MakeUnique<std::set<LayerImpl*>>();
+ scroll_parent->test_properties()->scroll_children->insert(scroll_child);
+ scroll_parent->SetScrollClipLayer(scroll_clip->id());
+
+ scroll_parent->SetDrawsContent(true);
+ scroll_child->SetDrawsContent(true);
+ render_surface->test_properties()->force_render_surface = true;
+
+ // A noisy transform that's invertible.
+ gfx::Transform transform;
+ transform.matrix().setDouble(0, 0, 6.12323e-17);
+ transform.matrix().setDouble(0, 2, 1);
+ transform.matrix().setDouble(2, 2, 6.12323e-17);
+ transform.matrix().setDouble(2, 0, -1);
+
+ scroll_child->test_properties()->transform = transform;
+ render_surface->test_properties()->transform = transform;
+
+ root->SetBounds(gfx::Size(30, 30));
+ scroll_child->SetBounds(gfx::Size(30, 30));
+ scroll_parent->SetBounds(gfx::Size(30, 30));
+ ExecuteCalculateDrawProperties(root);
+
+ gfx::Transform expected;
+ expected.matrix().setDouble(0, 0, 3.749395e-33);
+ expected.matrix().setDouble(0, 2, 6.12323e-17);
+ expected.matrix().setDouble(2, 0, -1);
+ expected.matrix().setDouble(2, 2, 6.12323e-17);
+ EXPECT_TRANSFORMATION_MATRIX_EQ(expected,
+ scroll_child->ScreenSpaceTransform());
+}
+
TEST_F(LayerTreeHostCommonTest, LargeTransformTest) {
LayerImpl* root = root_layer_for_testing();
LayerImpl* render_surface1 = AddChild<LayerImpl>(root);
« no previous file with comments | « no previous file | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698