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/animation/animation_host.h" | 9 #include "cc/animation/animation_host.h" |
10 #include "cc/base/filter_operation.h" | 10 #include "cc/base/filter_operation.h" |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 gfx::PointF(), gfx::Size()); | 1986 gfx::PointF(), gfx::Size()); |
1987 LayerImpl* copy = | 1987 LayerImpl* copy = |
1988 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), | 1988 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), |
1989 gfx::Size(200, 400)); | 1989 gfx::Size(200, 400)); |
1990 this->AddCopyRequest(copy); | 1990 this->AddCopyRequest(copy); |
1991 LayerImpl* copy_child = this->CreateDrawingLayer( | 1991 LayerImpl* copy_child = this->CreateDrawingLayer( |
1992 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); | 1992 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); |
1993 | 1993 |
1994 // The |copy| layer is hidden but since it is being copied, it will be | 1994 // The |copy| layer is hidden but since it is being copied, it will be |
1995 // drawn. | 1995 // drawn. |
1996 hide->test_properties()->hide_layer_and_subtree = true; | 1996 hide->test_properties()->opacity = 0.f; |
1997 | 1997 |
1998 this->CalcDrawEtc(root); | 1998 this->CalcDrawEtc(root); |
1999 | 1999 |
2000 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 2000 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
2001 | 2001 |
2002 this->VisitLayer(copy_child, &occlusion); | 2002 this->VisitLayer(copy_child, &occlusion); |
2003 EXPECT_EQ(gfx::Rect().ToString(), | 2003 EXPECT_EQ(gfx::Rect().ToString(), |
2004 occlusion.occlusion_from_outside_target().ToString()); | 2004 occlusion.occlusion_from_outside_target().ToString()); |
2005 EXPECT_EQ(gfx::Rect(200, 400).ToString(), | 2005 EXPECT_EQ(gfx::Rect(200, 400).ToString(), |
2006 occlusion.occlusion_from_inside_target().ToString()); | 2006 occlusion.occlusion_from_inside_target().ToString()); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2434 EXPECT_EQ(gfx::Rect(), | 2434 EXPECT_EQ(gfx::Rect(), |
2435 occlusion.UnoccludedSurfaceContentRect( | 2435 occlusion.UnoccludedSurfaceContentRect( |
2436 surface, gfx::Rect(80, 70, 50, 50))); | 2436 surface, gfx::Rect(80, 70, 50, 50))); |
2437 } | 2437 } |
2438 }; | 2438 }; |
2439 | 2439 |
2440 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2440 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
2441 | 2441 |
2442 } // namespace | 2442 } // namespace |
2443 } // namespace cc | 2443 } // namespace cc |
OLD | NEW |