| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1980 | 1980 |
| 1981 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 1981 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
| 1982 | 1982 |
| 1983 this->VisitLayer(top_layer, &occlusion); | 1983 this->VisitLayer(top_layer, &occlusion); |
| 1984 // |top_layer| occludes. | 1984 // |top_layer| occludes. |
| 1985 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), | 1985 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), |
| 1986 occlusion.occlusion_from_inside_target().ToString()); | 1986 occlusion.occlusion_from_inside_target().ToString()); |
| 1987 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); | 1987 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); |
| 1988 | 1988 |
| 1989 this->VisitLayer(blend_mode_layer, &occlusion); | 1989 this->VisitLayer(blend_mode_layer, &occlusion); |
| 1990 // |top_layer| occludes but not |blend_mode_layer|. | 1990 // |top_layer| and |blend_mode_layer| both occlude, since the blend mode |
| 1991 // gets applied by blend_mode_layer's render surface, not when drawing the |
| 1992 // layer itself. |
| 1993 EXPECT_EQ(gfx::Rect(100, 100).ToString(), |
| 1994 occlusion.occlusion_from_inside_target().ToString()); |
| 1991 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), | 1995 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), |
| 1992 occlusion.occlusion_from_outside_target().ToString()); | 1996 occlusion.occlusion_from_outside_target().ToString()); |
| 1993 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); | |
| 1994 | 1997 |
| 1995 this->VisitContributingSurface(blend_mode_layer, &occlusion); | 1998 this->VisitContributingSurface(blend_mode_layer, &occlusion); |
| 1996 // |top_layer| occludes but not |blend_mode_layer|. | 1999 // |top_layer| occludes but not |blend_mode_layer|. |
| 1997 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), | 2000 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), |
| 1998 occlusion.occlusion_from_inside_target().ToString()); | 2001 occlusion.occlusion_from_inside_target().ToString()); |
| 1999 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); | 2002 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); |
| 2000 } | 2003 } |
| 2001 }; | 2004 }; |
| 2002 | 2005 |
| 2003 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestBlendModeDoesNotOcclude); | 2006 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestBlendModeDoesNotOcclude); |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 EXPECT_EQ(gfx::Rect(), | 2627 EXPECT_EQ(gfx::Rect(), |
| 2625 occlusion.UnoccludedSurfaceContentRect( | 2628 occlusion.UnoccludedSurfaceContentRect( |
| 2626 surface, gfx::Rect(80, 70, 50, 50))); | 2629 surface, gfx::Rect(80, 70, 50, 50))); |
| 2627 } | 2630 } |
| 2628 }; | 2631 }; |
| 2629 | 2632 |
| 2630 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2633 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2631 | 2634 |
| 2632 } // namespace | 2635 } // namespace |
| 2633 } // namespace cc | 2636 } // namespace cc |
| OLD | NEW |