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/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 transform.Translate(50.0, 50.0); | 1061 transform.Translate(50.0, 50.0); |
1062 transform.ApplyPerspectiveDepth(100.0); | 1062 transform.ApplyPerspectiveDepth(100.0); |
1063 transform.Translate3d(0.0, 0.0, 110.0); | 1063 transform.Translate3d(0.0, 0.0, 110.0); |
1064 transform.Translate(-50.0, -50.0); | 1064 transform.Translate(-50.0, -50.0); |
1065 | 1065 |
1066 TestContentLayerImpl* parent = this->CreateRoot( | 1066 TestContentLayerImpl* parent = this->CreateRoot( |
1067 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 1067 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
1068 TestContentLayerImpl* layer = this->CreateDrawingLayer( | 1068 TestContentLayerImpl* layer = this->CreateDrawingLayer( |
1069 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); | 1069 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); |
1070 parent->test_properties()->should_flatten_transform = false; | 1070 parent->test_properties()->should_flatten_transform = false; |
1071 parent->Set3dSortingContextId(1); | 1071 parent->test_properties()->sorting_context_id = 1; |
1072 layer->test_properties()->should_flatten_transform = false; | 1072 layer->test_properties()->should_flatten_transform = false; |
1073 layer->Set3dSortingContextId(1); | 1073 layer->test_properties()->sorting_context_id = 1; |
1074 this->CalcDrawEtc(parent); | 1074 this->CalcDrawEtc(parent); |
1075 | 1075 |
1076 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 1076 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
1077 | 1077 |
1078 // The |layer| is entirely behind the camera and should not occlude. | 1078 // The |layer| is entirely behind the camera and should not occlude. |
1079 this->VisitLayer(layer, &occlusion); | 1079 this->VisitLayer(layer, &occlusion); |
1080 this->EnterLayer(parent, &occlusion); | 1080 this->EnterLayer(parent, &occlusion); |
1081 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); | 1081 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); |
1082 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); | 1082 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); |
1083 } | 1083 } |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2425 EXPECT_EQ(gfx::Rect(), | 2425 EXPECT_EQ(gfx::Rect(), |
2426 occlusion.UnoccludedSurfaceContentRect( | 2426 occlusion.UnoccludedSurfaceContentRect( |
2427 surface, gfx::Rect(80, 70, 50, 50))); | 2427 surface, gfx::Rect(80, 70, 50, 50))); |
2428 } | 2428 } |
2429 }; | 2429 }; |
2430 | 2430 |
2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
2432 | 2432 |
2433 } // namespace | 2433 } // namespace |
2434 } // namespace cc | 2434 } // namespace cc |
OLD | NEW |