| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/video_layer_impl.h" | 5 #include "cc/layers/video_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/video_frame_provider_client_impl.h" | 9 #include "cc/layers/video_frame_provider_client_impl.h" |
| 10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 71 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
| 72 EXPECT_EQ(impl.quad_list().size(), 0u); | 72 EXPECT_EQ(impl.quad_list().size(), 0u); |
| 73 } | 73 } |
| 74 | 74 |
| 75 { | 75 { |
| 76 SCOPED_TRACE("Partial occlusion"); | 76 SCOPED_TRACE("Partial occlusion"); |
| 77 gfx::Rect occluded(200, 0, 800, 1000); | 77 gfx::Rect occluded(200, 0, 800, 1000); |
| 78 impl.AppendQuadsWithOcclusion(video_layer_impl, occluded); | 78 impl.AppendQuadsWithOcclusion(video_layer_impl, occluded); |
| 79 | 79 |
| 80 size_t partially_occluded_count = 0; | 80 size_t partially_occluded_count = 0; |
| 81 LayerTestCommon::VerifyQuadsAreOccluded( | 81 LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, false, |
| 82 impl.quad_list(), occluded, &partially_occluded_count); | 82 &partially_occluded_count); |
| 83 // The layer outputs one quad, which is partially occluded. | 83 // The layer outputs one quad, which is partially occluded. |
| 84 EXPECT_EQ(1u, impl.quad_list().size()); | 84 EXPECT_EQ(1u, impl.quad_list().size()); |
| 85 EXPECT_EQ(1u, partially_occluded_count); | 85 EXPECT_EQ(1u, partially_occluded_count); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST(VideoLayerImplTest, OccludesOtherLayers) { | 89 TEST(VideoLayerImplTest, OccludesOtherLayers) { |
| 90 gfx::Size layer_size(1000, 1000); | 90 gfx::Size layer_size(1000, 1000); |
| 91 gfx::Rect visible(layer_size); | 91 gfx::Rect visible(layer_size); |
| 92 | 92 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 const DrawQuad* draw_quad = impl.quad_list().ElementAt(0); | 450 const DrawQuad* draw_quad = impl.quad_list().ElementAt(0); |
| 451 ASSERT_EQ(DrawQuad::TEXTURE_CONTENT, draw_quad->material); | 451 ASSERT_EQ(DrawQuad::TEXTURE_CONTENT, draw_quad->material); |
| 452 | 452 |
| 453 const TextureDrawQuad* texture_draw_quad = | 453 const TextureDrawQuad* texture_draw_quad = |
| 454 TextureDrawQuad::MaterialCast(draw_quad); | 454 TextureDrawQuad::MaterialCast(draw_quad); |
| 455 EXPECT_EQ(texture_draw_quad->resource_size_in_pixels(), resource_size); | 455 EXPECT_EQ(texture_draw_quad->resource_size_in_pixels(), resource_size); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace | 458 } // namespace |
| 459 } // namespace cc | 459 } // namespace cc |
| OLD | NEW |