| 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/layers/tiled_layer_impl.h" | 5 #include "cc/layers/tiled_layer_impl.h" |
| 6 | 6 |
| 7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
| 8 #include "cc/quads/tile_draw_quad.h" | 8 #include "cc/quads/tile_draw_quad.h" |
| 9 #include "cc/resources/layer_tiling_data.h" | 9 #include "cc/resources/layer_tiling_data.h" |
| 10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 358 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
| 359 EXPECT_EQ(impl.quad_list().size(), 0u); | 359 EXPECT_EQ(impl.quad_list().size(), 0u); |
| 360 } | 360 } |
| 361 | 361 |
| 362 { | 362 { |
| 363 SCOPED_TRACE("Partial occlusion"); | 363 SCOPED_TRACE("Partial occlusion"); |
| 364 gfx::Rect occluded(150, 0, 200, 1000); | 364 gfx::Rect occluded(150, 0, 200, 1000); |
| 365 impl.AppendQuadsWithOcclusion(tiled_layer, occluded); | 365 impl.AppendQuadsWithOcclusion(tiled_layer, occluded); |
| 366 | 366 |
| 367 size_t partially_occluded_count = 0; | 367 size_t partially_occluded_count = 0; |
| 368 LayerTestCommon::VerifyQuadsCoverRectWithOcclusion( | 368 LayerTestCommon::VerifyQuadsAreOccluded( |
| 369 impl.quad_list(), | 369 impl.quad_list(), occluded, &partially_occluded_count); |
| 370 gfx::Rect(layer_bounds), | |
| 371 occluded, | |
| 372 &partially_occluded_count); | |
| 373 // The layer outputs one quad, which is partially occluded. | 370 // The layer outputs one quad, which is partially occluded. |
| 374 EXPECT_EQ(100u - 10u, impl.quad_list().size()); | 371 EXPECT_EQ(100u - 10u, impl.quad_list().size()); |
| 375 EXPECT_EQ(10u + 10u, partially_occluded_count); | 372 EXPECT_EQ(10u + 10u, partially_occluded_count); |
| 376 } | 373 } |
| 377 } | 374 } |
| 378 | 375 |
| 379 } // namespace | 376 } // namespace |
| 380 } // namespace cc | 377 } // namespace cc |
| OLD | NEW |