OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/occlusion_tracker.h" | 5 #include "cc/trees/occlusion_tracker.h" |
6 | 6 |
7 #include "cc/animation/layer_animation_controller.h" | 7 #include "cc/animation/layer_animation_controller.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/debug/overdraw_metrics.h" | 9 #include "cc/debug/overdraw_metrics.h" |
10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
(...skipping 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 | 3999 |
4000 EXPECT_EQ(gfx::Rect().ToString(), | 4000 EXPECT_EQ(gfx::Rect().ToString(), |
4001 occlusion.occlusion_from_outside_target().ToString()); | 4001 occlusion.occlusion_from_outside_target().ToString()); |
4002 EXPECT_EQ(gfx::Rect().ToString(), | 4002 EXPECT_EQ(gfx::Rect().ToString(), |
4003 occlusion.occlusion_from_inside_target().ToString()); | 4003 occlusion.occlusion_from_inside_target().ToString()); |
4004 } | 4004 } |
4005 }; | 4005 }; |
4006 | 4006 |
4007 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestEmptyEventLayerDoesNotOcclude) | 4007 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestEmptyEventLayerDoesNotOcclude) |
4008 | 4008 |
| 4009 template <class Types> |
| 4010 class OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude |
| 4011 : public OcclusionTrackerTest<Types> { |
| 4012 protected: |
| 4013 explicit OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude(bool opaque) |
| 4014 : OcclusionTrackerTest<Types>(opaque) {} |
| 4015 void RunMyTest() { |
| 4016 typename Types::ContentLayerType* root = this->CreateRoot( |
| 4017 this->identity_matrix, gfx::Point(), gfx::Size(400, 400)); |
| 4018 typename Types::ContentLayerType* zero_opacity_layer = |
| 4019 this->CreateDrawingLayer(root, this->identity_matrix, gfx::Point(), |
| 4020 gfx::Size(200, 200), true); |
| 4021 this->SetDrawsContent(zero_opacity_layer, false); |
| 4022 zero_opacity_layer->SetTouchEventHandlerRegion(gfx::Rect(10, 10, 10, 10)); |
| 4023 |
| 4024 this->CalcDrawEtc(root); |
| 4025 |
| 4026 TestOcclusionTrackerWithClip<typename Types::LayerType, |
| 4027 typename Types::RenderSurfaceType> occlusion( |
| 4028 gfx::Rect(0, 0, 1000, 1000), false); |
| 4029 |
| 4030 this->VisitLayer(zero_opacity_layer, &occlusion); |
| 4031 |
| 4032 EXPECT_EQ(gfx::Rect().ToString(), |
| 4033 occlusion.occlusion_from_outside_target().ToString()); |
| 4034 EXPECT_EQ(gfx::Rect().ToString(), |
| 4035 occlusion.occlusion_from_inside_target().ToString()); |
| 4036 } |
| 4037 }; |
| 4038 |
| 4039 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestZeroOpacityLayerDoesNotOcclude); |
| 4040 |
4009 } // namespace | 4041 } // namespace |
4010 } // namespace cc | 4042 } // namespace cc |
OLD | NEW |