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

Side by Side Diff: cc/layers/nine_patch_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 | « no previous file | cc/layers/painted_scrollbar_layer_impl_unittest.cc » ('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 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/nine_patch_layer_impl.h" 8 #include "cc/layers/nine_patch_layer_impl.h"
9 #include "cc/quads/texture_draw_quad.h" 9 #include "cc/quads/texture_draw_quad.h"
10 #include "cc/resources/ui_resource_bitmap.h" 10 #include "cc/resources/ui_resource_bitmap.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); 380 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect());
381 EXPECT_EQ(impl.quad_list().size(), 0u); 381 EXPECT_EQ(impl.quad_list().size(), 0u);
382 } 382 }
383 383
384 { 384 {
385 SCOPED_TRACE("Partial occlusion"); 385 SCOPED_TRACE("Partial occlusion");
386 gfx::Rect occluded(0, 0, 500, 1000); 386 gfx::Rect occluded(0, 0, 500, 1000);
387 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded); 387 impl.AppendQuadsWithOcclusion(nine_patch_layer_impl, occluded);
388 388
389 size_t partially_occluded_count = 0; 389 size_t partially_occluded_count = 0;
390 LayerTestCommon::VerifyQuadsAreOccluded( 390 LayerTestCommon::VerifyQuadsAreOccluded(impl.quad_list(), occluded, false,
391 impl.quad_list(), occluded, &partially_occluded_count); 391 &partially_occluded_count);
392 // The layer outputs nine quads, three of which are partially occluded, and 392 // The layer outputs nine quads, three of which are partially occluded, and
393 // three fully occluded. 393 // three fully occluded.
394 EXPECT_EQ(6u, impl.quad_list().size()); 394 EXPECT_EQ(6u, impl.quad_list().size());
395 EXPECT_EQ(3u, partially_occluded_count); 395 EXPECT_EQ(3u, partially_occluded_count);
396 } 396 }
397 } 397 }
398 398
399 TEST(NinePatchLayerImplTest, OpaqueRect) { 399 TEST(NinePatchLayerImplTest, OpaqueRect) {
400 gfx::Size layer_size(1000, 1000); 400 gfx::Size layer_size(1000, 1000);
401 gfx::Size viewport_size(1000, 1000); 401 gfx::Size viewport_size(1000, 1000);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 456
457 const QuadList &quad_list = impl.quad_list(); 457 const QuadList &quad_list = impl.quad_list();
458 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); 458 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin();
459 it != quad_list.BackToFrontEnd(); ++it) 459 it != quad_list.BackToFrontEnd(); ++it)
460 EXPECT_TRUE(it->ShouldDrawWithBlending()); 460 EXPECT_TRUE(it->ShouldDrawWithBlending());
461 } 461 }
462 } 462 }
463 463
464 } // namespace 464 } // namespace
465 } // namespace cc 465 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/painted_scrollbar_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698