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

Unified Diff: cc/trees/layer_tree_host_unittest_picture.cc

Issue 26112002: cc: Fix hit-testing in zero-opacity layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_picture.cc
diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc
index 731f69214afcfc462f2c4a65c3cae4d110962c58..f290989915eaec78f821a15c7243bd95619b2f59 100644
--- a/cc/trees/layer_tree_host_unittest_picture.cc
+++ b/cc/trees/layer_tree_host_unittest_picture.cc
@@ -4,7 +4,10 @@
#include "cc/trees/layer_tree_host.h"
+#include "cc/layers/solid_color_layer.h"
+#include "cc/test/fake_content_layer.h"
#include "cc/test/fake_content_layer_client.h"
+#include "cc/test/fake_content_layer_impl.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/layer_tree_test.h"
@@ -115,5 +118,76 @@ class LayerTreeHostPictureTestTwinLayer
MULTI_THREAD_TEST_F(LayerTreeHostPictureTestTwinLayer);
+class LayerTreeHostPictureNoUpdateTileProprityForZeroOpacityLayer
+ : public LayerTreeHostPictureTest {
+ protected:
+ virtual void SetupTree() OVERRIDE {
+ parent_layer_ = FakeContentLayer::Create(&parent_client_);
+ parent_layer_->SetBounds(gfx::Size(40, 40));
+ parent_layer_->SetOpacity(0.f);
+ parent_layer_->SetIsDrawable(true);
+
+ scoped_refptr<Layer> root = SolidColorLayer::Create();
+ root->SetBounds(gfx::Size(60, 60));
+ root->SetOpacity(1.f);
+ root->SetIsDrawable(true);
+ root->AddChild(parent_layer_);
+ layer_tree_host()->SetRootLayer(root);
+
+ wheel_handler_ = FakeContentLayer::Create(NULL);
+ wheel_handler_->SetBounds(gfx::Size(10, 10));
+ wheel_handler_->SetHaveWheelEventHandlers(true);
+ wheel_handler_->SetIsDrawable(true);
+ parent_layer_->AddChild(wheel_handler_);
+
+ picture_ = FakePictureLayer::Create(&picture_client_);
+ picture_->SetBounds(gfx::Size(30, 30));
+ picture_->SetPosition(gfx::Point(10, 0));
+ picture_->SetIsDrawable(true);
+ parent_layer_->AddChild(picture_);
+
+ LayerTreeHostPictureTest::SetupTree();
+ }
+
+ virtual void BeginTest() OVERRIDE {
+ PostSetNeedsCommitToMainThread();
+ }
+
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ LayerTreeHostPictureTest::DrawLayersOnThread(impl);
+ FakeContentLayerImpl* parent =
+ static_cast<FakeContentLayerImpl*>(impl->RootLayer()->children()[0]);
+ EXPECT_TRUE(parent->DrawsContent());
+ EXPECT_FALSE(parent->opacity());
+ EXPECT_EQ(0u, parent->append_quads_count());
+ ASSERT_EQ(2u, parent->children().size());
+
+ FakeContentLayerImpl* child =
+ static_cast<FakeContentLayerImpl*>(parent->children()[0]);
+ EXPECT_TRUE(child->opacity());
+ EXPECT_EQ(0u, child->append_quads_count());
+
+ FakePictureLayerImpl* picimpl =
+ static_cast<FakePictureLayerImpl*>(parent->children()[1]);
+ EXPECT_TRUE(picimpl->opacity());
+ EXPECT_EQ(0u, picimpl->append_quads_count());
+ EXPECT_EQ(0u, picimpl->update_tile_priorities_count());
+
+ EndTest();
+ }
+
+ virtual void AfterTest() OVERRIDE {}
+
+ private:
+ FakeContentLayerClient parent_client_;
+ FakeContentLayerClient picture_client_;
+ scoped_refptr<FakeContentLayer> parent_layer_;
+ scoped_refptr<FakeContentLayer> wheel_handler_;
+ scoped_refptr<FakePictureLayer> picture_;
+};
+
+MULTI_THREAD_TEST_F(
+ LayerTreeHostPictureNoUpdateTileProprityForZeroOpacityLayer);
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698