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

Unified Diff: cc/trees/occlusion_tracker_unittest.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/occlusion_tracker.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/occlusion_tracker_unittest.cc
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index 0e8b5d4c50f3d2260735df92b8635f94d39b55d2..90f7fb4fd70db2790b77d6084b242fcf40eab4d4 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -4006,5 +4006,37 @@ class OcclusionTrackerTestEmptyEventLayerDoesNotOcclude
ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestEmptyEventLayerDoesNotOcclude)
+template <class Types>
+class OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude
+ : public OcclusionTrackerTest<Types> {
+ protected:
+ explicit OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude(bool opaque)
+ : OcclusionTrackerTest<Types>(opaque) {}
+ void RunMyTest() {
+ typename Types::ContentLayerType* root = this->CreateRoot(
+ this->identity_matrix, gfx::Point(), gfx::Size(400, 400));
+ typename Types::ContentLayerType* zero_opacity_layer =
+ this->CreateDrawingLayer(root, this->identity_matrix, gfx::Point(),
+ gfx::Size(200, 200), true);
+ this->SetDrawsContent(zero_opacity_layer, false);
+ zero_opacity_layer->SetTouchEventHandlerRegion(gfx::Rect(10, 10, 10, 10));
+
+ this->CalcDrawEtc(root);
+
+ TestOcclusionTrackerWithClip<typename Types::LayerType,
+ typename Types::RenderSurfaceType> occlusion(
+ gfx::Rect(0, 0, 1000, 1000), false);
+
+ this->VisitLayer(zero_opacity_layer, &occlusion);
+
+ EXPECT_EQ(gfx::Rect().ToString(),
+ occlusion.occlusion_from_outside_target().ToString());
+ EXPECT_EQ(gfx::Rect().ToString(),
+ occlusion.occlusion_from_inside_target().ToString());
+ }
+};
+
+ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude);
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/occlusion_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698