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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 335633003: Do not skip subtrees with wheel or touch handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« cc/layers/draw_properties.h ('K') | « cc/trees/layer_tree_host_common.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 1c850810bb8f2612cd4b224020d8648fa5cadede..77976c8fb0aa2a30f90a75578a3911c02e9f5cfd 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -156,6 +156,52 @@ TEST_F(LayerTreeHostCommonTest, TransformsForNoOpLayer) {
grand_child->screen_space_transform());
}
+TEST_F(LayerTreeHostCommonTest, DoNotSkipLayersWithHandlers) {
+ scoped_refptr<Layer> parent = Layer::Create();
+ scoped_refptr<Layer> child = Layer::Create();
+ scoped_refptr<Layer> grand_child = Layer::Create();
+ parent->AddChild(child);
+ child->AddChild(grand_child);
+
+ scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
+ host->SetRootLayer(parent);
+
+ gfx::Transform identity_matrix;
+ SetLayerPropertiesForTesting(parent.get(),
+ identity_matrix,
+ gfx::Point3F(),
+ gfx::PointF(),
+ gfx::Size(100, 100),
+ true,
+ false);
+ SetLayerPropertiesForTesting(child.get(),
+ identity_matrix,
+ gfx::Point3F(),
+ gfx::PointF(10, 10),
+ gfx::Size(100, 100),
+ true,
+ false);
+ // This would have previously caused us to skip our subtree, but this would be
+ // wrong; we need up-to-date draw properties to do hit testing on the layers
+ // with handlers.
+ child->SetOpacity(0.f);
+ SetLayerPropertiesForTesting(grand_child.get(),
+ identity_matrix,
+ gfx::Point3F(),
+ gfx::PointF(10, 10),
+ gfx::Size(100, 100),
+ true,
+ false);
+ grand_child->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 100, 100));
+
+ ExecuteCalculateDrawProperties(parent.get());
+
+ // Check that we've computed draw properties for the subtree rooted at
+ // |child|.
+ EXPECT_FALSE(child->draw_transform().IsIdentity());
+ EXPECT_FALSE(grand_child->draw_transform().IsIdentity());
+}
+
TEST_F(LayerTreeHostCommonTest, TransformsForSingleLayer) {
gfx::Transform identity_matrix;
scoped_refptr<Layer> layer = Layer::Create();
« cc/layers/draw_properties.h ('K') | « cc/trees/layer_tree_host_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698