| 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 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 gfx::PointF(), gfx::Size()); | 2066 gfx::PointF(), gfx::Size()); |
| 2067 LayerImpl* copy = | 2067 LayerImpl* copy = |
| 2068 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), | 2068 this->CreateLayer(hide, this->identity_matrix, gfx::PointF(100.f, 0.f), |
| 2069 gfx::Size(200, 400)); | 2069 gfx::Size(200, 400)); |
| 2070 this->AddCopyRequest(copy); | 2070 this->AddCopyRequest(copy); |
| 2071 LayerImpl* copy_child = this->CreateDrawingLayer( | 2071 LayerImpl* copy_child = this->CreateDrawingLayer( |
| 2072 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); | 2072 copy, this->identity_matrix, gfx::PointF(), gfx::Size(200, 400), true); |
| 2073 | 2073 |
| 2074 // The |copy| layer is hidden but since it is being copied, it will be | 2074 // The |copy| layer is hidden but since it is being copied, it will be |
| 2075 // drawn. | 2075 // drawn. |
| 2076 hide->SetHideLayerAndSubtree(true); | 2076 hide->test_properties()->hide_layer_and_subtree = true; |
| 2077 | 2077 |
| 2078 this->CalcDrawEtc(root); | 2078 this->CalcDrawEtc(root); |
| 2079 | 2079 |
| 2080 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 2080 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
| 2081 | 2081 |
| 2082 this->VisitLayer(copy_child, &occlusion); | 2082 this->VisitLayer(copy_child, &occlusion); |
| 2083 EXPECT_EQ(gfx::Rect().ToString(), | 2083 EXPECT_EQ(gfx::Rect().ToString(), |
| 2084 occlusion.occlusion_from_outside_target().ToString()); | 2084 occlusion.occlusion_from_outside_target().ToString()); |
| 2085 EXPECT_EQ(gfx::Rect(200, 400).ToString(), | 2085 EXPECT_EQ(gfx::Rect(200, 400).ToString(), |
| 2086 occlusion.occlusion_from_inside_target().ToString()); | 2086 occlusion.occlusion_from_inside_target().ToString()); |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2514 EXPECT_EQ(gfx::Rect(), | 2514 EXPECT_EQ(gfx::Rect(), |
| 2515 occlusion.UnoccludedSurfaceContentRect( | 2515 occlusion.UnoccludedSurfaceContentRect( |
| 2516 surface, gfx::Rect(80, 70, 50, 50))); | 2516 surface, gfx::Rect(80, 70, 50, 50))); |
| 2517 } | 2517 } |
| 2518 }; | 2518 }; |
| 2519 | 2519 |
| 2520 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2520 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2521 | 2521 |
| 2522 } // namespace | 2522 } // namespace |
| 2523 } // namespace cc | 2523 } // namespace cc |
| OLD | NEW |