Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: cc/layers/video_layer_impl_unittest.cc

Issue 2402583005: Split picture layer quads to allow removing more occluded area. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/ui_resource_layer_impl_unittest.cc ('k') | cc/test/layer_test_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer_impl_unittest.cc ('k') | cc/test/layer_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698