| Index: cc/surfaces/display_unittest.cc
|
| diff --git a/cc/surfaces/display_unittest.cc b/cc/surfaces/display_unittest.cc
|
| index a7526b0088d7fc8d076e5f7b4fb16c03e056bf91..2966adddb06ef3c3393f02049baac3623d523d9c 100644
|
| --- a/cc/surfaces/display_unittest.cc
|
| +++ b/cc/surfaces/display_unittest.cc
|
| @@ -207,7 +207,6 @@ TEST_F(DisplayTest, DisplayDamaged) {
|
| 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());
|
| -
|
| {
|
| // Only damaged portion should be swapped.
|
| pass = RenderPass::Create();
|
| @@ -261,6 +260,9 @@ TEST_F(DisplayTest, DisplayDamaged) {
|
| pass->damage_rect = gfx::Rect(10, 10, 10, 10);
|
| pass->id = 1;
|
|
|
| + local_surface_id = id_allocator_.GenerateId();
|
| + display_->SetLocalSurfaceId(local_surface_id, 1.f);
|
| +
|
| pass_list.push_back(std::move(pass));
|
| scheduler_->ResetDamageForTest();
|
| SubmitCompositorFrame(&pass_list, local_surface_id);
|
| @@ -281,6 +283,9 @@ TEST_F(DisplayTest, DisplayDamaged) {
|
| pass->damage_rect = gfx::Rect(10, 10, 0, 0);
|
| pass->id = 1;
|
|
|
| + local_surface_id = id_allocator_.GenerateId();
|
| + display_->SetLocalSurfaceId(local_surface_id, 1.f);
|
| +
|
| pass_list.push_back(std::move(pass));
|
| scheduler_->ResetDamageForTest();
|
| SubmitCompositorFrame(&pass_list, local_surface_id);
|
| @@ -348,6 +353,8 @@ TEST_F(DisplayTest, DisplayDamaged) {
|
|
|
| // Resize should cause a swap if no frame was swapped at the previous size.
|
| {
|
| + local_surface_id = id_allocator_.GenerateId();
|
| + display_->SetLocalSurfaceId(local_surface_id, 1.f);
|
| scheduler_->swapped = false;
|
| display_->Resize(gfx::Size(200, 200));
|
| EXPECT_FALSE(scheduler_->swapped);
|
| @@ -379,6 +386,8 @@ TEST_F(DisplayTest, DisplayDamaged) {
|
| }
|
|
|
| {
|
| + local_surface_id = id_allocator_.GenerateId();
|
| + display_->SetLocalSurfaceId(local_surface_id, 1.0f);
|
| // Surface that's damaged completely should be resized and swapped.
|
| pass = RenderPass::Create();
|
| pass->output_rect = gfx::Rect(0, 0, 99, 99);
|
| @@ -410,7 +419,8 @@ class MockedContext : public TestWebGraphicsContext3D {
|
| };
|
|
|
| TEST_F(DisplayTest, Finish) {
|
| - LocalSurfaceId local_surface_id(id_allocator_.GenerateId());
|
| + LocalSurfaceId local_surface_id1(id_allocator_.GenerateId());
|
| + LocalSurfaceId local_surface_id2(id_allocator_.GenerateId());
|
|
|
| RendererSettings settings;
|
| settings.partial_swap_enabled = true;
|
| @@ -425,7 +435,7 @@ TEST_F(DisplayTest, Finish) {
|
| StubDisplayClient client;
|
| display_->Initialize(&client, &manager_);
|
|
|
| - display_->SetLocalSurfaceId(local_surface_id, 1.f);
|
| + display_->SetLocalSurfaceId(local_surface_id1, 1.f);
|
|
|
| display_->Resize(gfx::Size(100, 100));
|
|
|
| @@ -437,7 +447,7 @@ TEST_F(DisplayTest, Finish) {
|
| pass->id = 1;
|
| pass_list.push_back(std::move(pass));
|
|
|
| - SubmitCompositorFrame(&pass_list, local_surface_id);
|
| + SubmitCompositorFrame(&pass_list, local_surface_id1);
|
| }
|
|
|
| display_->DrawAndSwap();
|
| @@ -451,6 +461,7 @@ TEST_F(DisplayTest, Finish) {
|
|
|
| // Another resize without a swap doesn't need to finish.
|
| EXPECT_CALL(*context_ptr, shallowFinishCHROMIUM()).Times(0);
|
| + display_->SetLocalSurfaceId(local_surface_id2, 1.f);
|
| display_->Resize(gfx::Size(200, 200));
|
| testing::Mock::VerifyAndClearExpectations(context_ptr);
|
|
|
| @@ -463,7 +474,7 @@ TEST_F(DisplayTest, Finish) {
|
| pass->id = 1;
|
| pass_list.push_back(std::move(pass));
|
|
|
| - SubmitCompositorFrame(&pass_list, local_surface_id);
|
| + SubmitCompositorFrame(&pass_list, local_surface_id2);
|
| }
|
|
|
| display_->DrawAndSwap();
|
|
|