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

Unified Diff: cc/test/layer_test_common.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/test/layer_tree_pixel_resource_test.cc » ('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 7e835b892a59a1fe372672fad0dddd2dec52e13d..83f756d2bbeb3d40976354584a485210fff34df8 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -75,9 +75,17 @@ void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
// Quads that are fully occluded on one axis only should be shrunken.
for (const auto& quad : quads) {
- DCHECK(quad->quadTransform().IsIdentityOrIntegerTranslation());
gfx::Rect target_rect =
MathUtil::MapEnclosingClippedRect(quad->quadTransform(), quad->rect);
+ if (!quad->quadTransform().IsIdentityOrIntegerTranslation()) {
+ DCHECK(quad->quadTransform().IsPositiveScaleOrTranslation())
+ << quad->quadTransform().ToString();
+ gfx::RectF target_rectf =
+ MathUtil::MapClippedRect(quad->quadTransform(), quad->rect);
+ // Scale transforms allowed, as long as the final transformed rect
+ // ends up on integer boundaries for ease of testing.
+ DCHECK_EQ(target_rectf.ToString(), gfx::RectF(target_rect).ToString());
+ }
gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect(
quad->quadTransform(), quad->visible_rect);
@@ -129,9 +137,10 @@ void LayerTestCommon::LayerImplTest::AppendQuadsWithOcclusion(
Occlusion occlusion(layer_impl->draw_transform(),
SimpleEnclosedRegion(occluded),
SimpleEnclosedRegion());
+ layer_impl->draw_properties().occlusion_in_content_space = occlusion;
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(render_pass_.get(), occlusion, &data);
+ layer_impl->AppendQuads(render_pass_.get(), &data);
layer_impl->DidDraw(resource_provider());
}
@@ -147,9 +156,10 @@ void LayerTestCommon::LayerImplTest::AppendQuadsForPassWithOcclusion(
Occlusion occlusion(layer_impl->draw_transform(),
SimpleEnclosedRegion(occluded),
SimpleEnclosedRegion());
+ layer_impl->draw_properties().occlusion_in_content_space = occlusion;
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(given_render_pass, occlusion, &data);
+ layer_impl->AppendQuads(given_render_pass, &data);
layer_impl->DidDraw(resource_provider());
}
@@ -160,12 +170,12 @@ void LayerTestCommon::LayerImplTest::AppendSurfaceQuadsWithOcclusion(
render_pass_->quad_list.clear();
render_pass_->shared_quad_state_list.clear();
- occlusion_tracker_.set_occluded_target_rect_for_contributing_surface(
- occluded);
- bool for_replica = false;
- RenderPassId id(1, 1);
+
surface_impl->AppendQuads(
- render_pass_.get(), occlusion_tracker_, &data, for_replica, id);
+ render_pass_.get(), gfx::Transform(),
+ Occlusion(gfx::Transform(), SimpleEnclosedRegion(occluded),
+ SimpleEnclosedRegion()),
+ SK_ColorBLACK, 1.f, nullptr, &data, RenderPassId(1, 1));
}
} // namespace cc
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/test/layer_tree_pixel_resource_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698