| 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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
| 6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
| 7 #include "cc/layers/nine_patch_layer_impl.h" | 7 #include "cc/layers/nine_patch_layer_impl.h" |
| 8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
| 9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
| 10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 258 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
| 259 EXPECT_EQ(impl.quad_list().size(), 0u); | 259 EXPECT_EQ(impl.quad_list().size(), 0u); |
| 260 } | 260 } |
| 261 | 261 |
| 262 { | 262 { |
| 263 SCOPED_TRACE("Partial occlusion"); | 263 SCOPED_TRACE("Partial occlusion"); |
| 264 gfx::Rect occluded(0, 0, 500, 1000); | 264 gfx::Rect occluded(0, 0, 500, 1000); |
| 265 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded); | 265 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded); |
| 266 | 266 |
| 267 size_t partially_occluded_count = 0; | 267 size_t partially_occluded_count = 0; |
| 268 LayerTestCommon::VerifyQuadsCoverRectWithOcclusion( | 268 LayerTestCommon::VerifyQuadsAreOccluded( |
| 269 impl.quad_list(), | 269 impl.quad_list(), occluded, &partially_occluded_count); |
| 270 gfx::Rect(layer_size), | |
| 271 occluded, | |
| 272 &partially_occluded_count); | |
| 273 // The layer outputs nine quads, three of which are partially occluded, and | 270 // The layer outputs nine quads, three of which are partially occluded, and |
| 274 // three fully occluded. | 271 // three fully occluded. |
| 275 EXPECT_EQ(6u, impl.quad_list().size()); | 272 EXPECT_EQ(6u, impl.quad_list().size()); |
| 276 EXPECT_EQ(3u, partially_occluded_count); | 273 EXPECT_EQ(3u, partially_occluded_count); |
| 277 } | 274 } |
| 278 } | 275 } |
| 279 | 276 |
| 280 } // namespace | 277 } // namespace |
| 281 } // namespace cc | 278 } // namespace cc |
| OLD | NEW |