| 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 gfx::Transform transform; | 1181 gfx::Transform transform; |
| 1182 transform.Translate(50.0, 50.0); | 1182 transform.Translate(50.0, 50.0); |
| 1183 transform.ApplyPerspectiveDepth(100.0); | 1183 transform.ApplyPerspectiveDepth(100.0); |
| 1184 transform.Translate3d(0.0, 0.0, 110.0); | 1184 transform.Translate3d(0.0, 0.0, 110.0); |
| 1185 transform.Translate(-50.0, -50.0); | 1185 transform.Translate(-50.0, -50.0); |
| 1186 | 1186 |
| 1187 TestContentLayerImpl* parent = this->CreateRoot( | 1187 TestContentLayerImpl* parent = this->CreateRoot( |
| 1188 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); | 1188 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); |
| 1189 TestContentLayerImpl* layer = this->CreateDrawingLayer( | 1189 TestContentLayerImpl* layer = this->CreateDrawingLayer( |
| 1190 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); | 1190 parent, transform, gfx::PointF(), gfx::Size(100, 100), true); |
| 1191 parent->SetShouldFlattenTransform(false); | 1191 parent->test_properties()->should_flatten_transform = false; |
| 1192 parent->Set3dSortingContextId(1); | 1192 parent->Set3dSortingContextId(1); |
| 1193 layer->SetShouldFlattenTransform(false); | 1193 layer->test_properties()->should_flatten_transform = false; |
| 1194 layer->Set3dSortingContextId(1); | 1194 layer->Set3dSortingContextId(1); |
| 1195 this->CalcDrawEtc(parent); | 1195 this->CalcDrawEtc(parent); |
| 1196 | 1196 |
| 1197 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 1197 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
| 1198 | 1198 |
| 1199 // The |layer| is entirely behind the camera and should not occlude. | 1199 // The |layer| is entirely behind the camera and should not occlude. |
| 1200 this->VisitLayer(layer, &occlusion); | 1200 this->VisitLayer(layer, &occlusion); |
| 1201 this->EnterLayer(parent, &occlusion); | 1201 this->EnterLayer(parent, &occlusion); |
| 1202 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); | 1202 EXPECT_TRUE(occlusion.occlusion_from_inside_target().IsEmpty()); |
| 1203 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); | 1203 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 EXPECT_EQ(gfx::Rect(), | 2516 EXPECT_EQ(gfx::Rect(), |
| 2517 occlusion.UnoccludedSurfaceContentRect( | 2517 occlusion.UnoccludedSurfaceContentRect( |
| 2518 surface, gfx::Rect(80, 70, 50, 50))); | 2518 surface, gfx::Rect(80, 70, 50, 50))); |
| 2519 } | 2519 } |
| 2520 }; | 2520 }; |
| 2521 | 2521 |
| 2522 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2522 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2523 | 2523 |
| 2524 } // namespace | 2524 } // namespace |
| 2525 } // namespace cc | 2525 } // namespace cc |
| OLD | NEW |