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

Unified Diff: components/viz/service/display/surface_aggregator_unittest.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix test to init has_damage_from_contributing_content_. Created 3 years, 5 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
Index: components/viz/service/display/surface_aggregator_unittest.cc
diff --git a/components/viz/service/display/surface_aggregator_unittest.cc b/components/viz/service/display/surface_aggregator_unittest.cc
index 9c1446127f158074cb91401952af1a2a3b08554a..3576ec302bcc07abb314394f162c604cda297849 100644
--- a/components/viz/service/display/surface_aggregator_unittest.cc
+++ b/components/viz/service/display/surface_aggregator_unittest.cc
@@ -1605,6 +1605,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
->shared_quad_state_list.front()
->quad_to_target_transform.Translate(0, 10);
root_frame.render_pass_list[0]->damage_rect = gfx::Rect(5, 5, 10, 10);
+ root_frame.render_pass_list[0]->cache_render_surface = true;
root_frame.render_pass_list[1]->damage_rect = gfx::Rect(5, 5, 100, 100);
support_->SubmitCompositorFrame(root_local_surface_id_,
@@ -1617,6 +1618,8 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
ASSERT_EQ(2u, aggregated_pass_list.size());
+ // First aggregation shold be true.
+ EXPECT_TRUE(aggregated_pass_list[0]->has_damage_from_contributing_content);
// Damage rect for first aggregation should contain entire root surface.
EXPECT_TRUE(
aggregated_pass_list[1]->damage_rect.Contains(gfx::Rect(SurfaceSize())));
@@ -1643,6 +1646,8 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
ASSERT_EQ(2u, aggregated_pass_list.size());
+ // True for new frame.
+ EXPECT_TRUE(aggregated_pass_list[0]->has_damage_from_contributing_content);
// Outer surface didn't change, so transformed inner damage rect should be
// used.
EXPECT_EQ(gfx::Rect(10, 20, 10, 10).ToString(),
@@ -1672,6 +1677,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
->shared_quad_state_list.front()
->quad_to_target_transform.Translate(0, 10);
root_frame.render_pass_list[0]->damage_rect = gfx::Rect(1, 1, 1, 1);
+ root_frame.render_pass_list[0]->cache_render_surface = true;
support_->SubmitCompositorFrame(root_local_surface_id_,
std::move(root_frame));
@@ -1685,6 +1691,8 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
ASSERT_EQ(2u, aggregated_pass_list.size());
+ // False when the child frame has no change.
+ EXPECT_FALSE(aggregated_pass_list[0]->has_damage_from_contributing_content);
// The root surface was enqueued without being aggregated once, so it should
// be treated as completely damaged.
EXPECT_TRUE(aggregated_pass_list[1]->damage_rect.Contains(
@@ -1702,6 +1710,8 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateDamageRect) {
ASSERT_EQ(2u, aggregated_pass_list.size());
+ // False when the child frame has no change.
+ EXPECT_FALSE(aggregated_pass_list[0]->has_damage_from_contributing_content);
EXPECT_TRUE(aggregated_pass_list[1]->damage_rect.IsEmpty());
}

Powered by Google App Engine
This is Rietveld 408576698