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

Unified Diff: cc/surfaces/display_unittest.cc

Issue 1426453006: Resize output_rect of aggregated CompositorFrame to enable it to be drawn when resizing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« cc/surfaces/display.cc ('K') | « cc/surfaces/display.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display_unittest.cc
diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc
index 7b82d961312394cf82eff0cde63c3fb2654afa7a..6b0ab1287f42ffff1ffd3bf503362a77cc194bc4 100644
--- a/cc/surfaces/display_unittest.cc
+++ b/cc/surfaces/display_unittest.cc
@@ -395,6 +395,30 @@ TEST_F(DisplayTest, DisplayDamaged) {
EXPECT_EQ(6u, output_surface_ptr_->num_sent_frames());
}
+ {
+ // Surface that's damaged completely should be resized and swapped.
+ pass = RenderPass::Create();
+ pass->output_rect = gfx::Rect(0, 0, 99, 99);
+ pass->damage_rect = gfx::Rect(0, 0, 99, 99);
+ pass->id = RenderPassId(1, 1);
+
+ pass_list.push_back(pass.Pass());
+ scheduler.ResetDamageForTest();
+ SubmitCompositorFrame(&pass_list, surface_id);
+ EXPECT_TRUE(scheduler.damaged);
+ EXPECT_FALSE(scheduler.display_resized_);
+ EXPECT_FALSE(scheduler.has_new_root_surface);
+
+ scheduler.swapped = false;
+ display.DrawAndSwap();
+ EXPECT_TRUE(scheduler.swapped);
+ EXPECT_EQ(7u, output_surface_ptr_->num_sent_frames());
+ EXPECT_EQ(gfx::Size(100, 100),
+ software_output_device_->viewport_pixel_size());
+ EXPECT_EQ(gfx::Rect(0, 0, 100, 100),
+ software_output_device_->damage_rect());
+ }
+
factory_.Destroy(surface_id);
}
« cc/surfaces/display.cc ('K') | « cc/surfaces/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698