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

Unified Diff: cc/test/layer_test_common.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/occlusion.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_test_common.cc
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index d023a8a9f356c8aaea5aaec7894a728404f41106..6a63f696eb40f5b35c213b0da866418bec11929c 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -86,6 +86,7 @@ void LayerTestCommon::VerifyQuadsExactlyCoverRect(const QuadList& quads,
// static
void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
const gfx::Rect& occluded,
+ bool split_quads,
size_t* partially_occluded_count) {
// No quad should exist if it's fully occluded.
for (auto* quad : quads) {
@@ -115,9 +116,9 @@ void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
target_rect.right() <= occluded.right();
bool fully_occluded_vertical = target_rect.y() >= occluded.y() &&
target_rect.bottom() <= occluded.bottom();
- bool should_be_occluded =
- target_rect.Intersects(occluded) &&
- (fully_occluded_vertical || fully_occluded_horizontal);
+ bool should_be_occluded = target_rect.Intersects(occluded);
+ if (!split_quads && !(fully_occluded_vertical || fully_occluded_horizontal))
+ should_be_occluded = false;
if (!should_be_occluded) {
EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString());
} else {
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/occlusion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698