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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 26112002: cc: Fix hit-testing in zero-opacity layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 7 years, 2 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/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 4027e14443f030fdb4aa05cac54592874a64ab50..63180f3af735540d02d1e9bf73b5867f784e1390 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -4921,6 +4921,65 @@ class LayerTreeHostTestNoQuadsForEmptyLayer : public LayerTreeHostTest {
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoQuadsForEmptyLayer);
+class LayerTreeHostTestNoQuadsForZeroOpacity : public LayerTreeHostTest {
+ protected:
+ virtual void SetupTree() OVERRIDE {
+ LayerTreeHostTest::SetupTree();
+ root_layer_ = FakeContentLayer::Create(&client_);
+ root_layer_->SetBounds(gfx::Size(100, 100));
+
+ surface_layer1_ = FakeContentLayer::Create(&client_);
+ surface_layer1_->SetBounds(gfx::Size(100, 100));
+ surface_layer1_->SetForceRenderSurface(true);
+ surface_layer1_->SetOpacity(0.f);
+
+ surface_layer2_ = FakeContentLayer::Create(&client_);
+ surface_layer2_->SetBounds(gfx::Size(50, 50));
+ surface_layer2_->SetForceRenderSurface(true);
+
+ touch_handler_ = FakeContentLayer::Create(&client_);
+ touch_handler_->SetBounds(gfx::Size(50, 50));
+ touch_handler_->SetPosition(gfx::Point(50, 0));
+ touch_handler_->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50));
+
+ surface_layer2_->AddChild(touch_handler_);
+ surface_layer1_->AddChild(surface_layer2_);
+ root_layer_->AddChild(surface_layer1_);
+
+ layer_tree_host()->SetRootLayer(root_layer_);
+ LayerTreeHostTest::SetupTree();
+ }
+
+ virtual void BeginTest() OVERRIDE {
+ PostSetNeedsCommitToMainThread();
+ }
+
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ FakeContentLayerImpl* layer_impl =
+ static_cast<FakeContentLayerImpl*>(impl->RootLayer());
+
+ FakeContentLayerImpl* surface_1_impl =
+ static_cast<FakeContentLayerImpl*>(layer_impl->children()[0]);
+ FakeContentLayerImpl* surface_2_impl =
+ static_cast<FakeContentLayerImpl*>(surface_1_impl->children()[0]);
+ EXPECT_EQ(0u, surface_1_impl->append_quads_count());
+ EXPECT_EQ(0u, surface_2_impl->append_quads_count());
+
+ EndTest();
+ }
+
+ virtual void AfterTest() OVERRIDE {}
+
+ private:
+ FakeContentLayerClient client_;
+ scoped_refptr<FakeContentLayer> root_layer_;
+ scoped_refptr<FakeContentLayer> surface_layer1_;
+ scoped_refptr<FakeContentLayer> surface_layer2_;
+ scoped_refptr<FakeContentLayer> touch_handler_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoQuadsForZeroOpacity);
+
} // namespace
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698