| Index: ui/ozone/platform/drm/gpu/drm_surface_unittest.cc
|
| diff --git a/ui/ozone/platform/drm/gpu/drm_surface_unittest.cc b/ui/ozone/platform/drm/gpu/drm_surface_unittest.cc
|
| index 4498f1fc28afe80865f7be1892310efff307cb23..13774b2659c2d437c2b8582d7435b9d7c2a665e3 100644
|
| --- a/ui/ozone/platform/drm/gpu/drm_surface_unittest.cc
|
| +++ b/ui/ozone/platform/drm/gpu/drm_surface_unittest.cc
|
| @@ -73,6 +73,10 @@ void DrmSurfaceTest::SetUp() {
|
| new ui::DrmSurface(screen_manager_->GetWindow(kDefaultWidgetHandle)));
|
| surface_->ResizeCanvas(
|
| gfx::Size(kDefaultMode.hdisplay, kDefaultMode.vdisplay));
|
| +
|
| + // The window has been remapped to a controller. The first swap will cause the
|
| + // SWAP_NAK_RECREATE_BUFFERS without actually using the buffers.
|
| + surface_->PresentCanvas(gfx::Rect());
|
| }
|
|
|
| void DrmSurfaceTest::TearDown() {
|
| @@ -88,10 +92,10 @@ TEST_F(DrmSurfaceTest, CheckFBIDOnSwap) {
|
| surface_->PresentCanvas(gfx::Rect());
|
| drm_->RunCallbacks();
|
| // Framebuffer ID 1 is allocated in SetUp for the buffer used to modeset.
|
| - EXPECT_EQ(3u, drm_->current_framebuffer());
|
| + EXPECT_EQ(2u, drm_->current_framebuffer());
|
| surface_->PresentCanvas(gfx::Rect());
|
| drm_->RunCallbacks();
|
| - EXPECT_EQ(2u, drm_->current_framebuffer());
|
| + EXPECT_EQ(3u, drm_->current_framebuffer());
|
| }
|
|
|
| TEST_F(DrmSurfaceTest, CheckSurfaceContents) {
|
| @@ -115,12 +119,12 @@ TEST_F(DrmSurfaceTest, CheckSurfaceContents) {
|
| framebuffers.push_back(buffer);
|
| }
|
|
|
| - // Buffer 0 is the modesetting buffer, buffer 1 is the frontbuffer and buffer
|
| - // 2 is the backbuffer.
|
| + // Buffer 0 is the modesetting buffer, buffer 2 is the frontbuffer and buffer
|
| + // 1 is the backbuffer.
|
| EXPECT_EQ(3u, framebuffers.size());
|
|
|
| - image.setInfo(framebuffers[2]->getCanvas()->imageInfo());
|
| - EXPECT_TRUE(framebuffers[2]->getCanvas()->readPixels(&image, 0, 0));
|
| + image.setInfo(framebuffers[1]->getCanvas()->imageInfo());
|
| + EXPECT_TRUE(framebuffers[1]->getCanvas()->readPixels(&image, 0, 0));
|
|
|
| EXPECT_EQ(kDefaultMode.hdisplay, image.width());
|
| EXPECT_EQ(kDefaultMode.vdisplay, image.height());
|
| @@ -167,12 +171,12 @@ TEST_F(DrmSurfaceTest, CheckSurfaceContentsAfter2QueuedPresents) {
|
| framebuffers.push_back(buffer);
|
| }
|
|
|
| - // Buffer 0 is the modesetting buffer, buffer 1 is the backbuffer and buffer
|
| - // 2 is the frontbuffer.
|
| + // Buffer 0 is the modesetting buffer, buffer 2 is the backbuffer and buffer
|
| + // 1 is the frontbuffer.
|
| EXPECT_EQ(3u, framebuffers.size());
|
|
|
| - image.setInfo(framebuffers[1]->getCanvas()->imageInfo());
|
| - EXPECT_TRUE(framebuffers[1]->getCanvas()->readPixels(&image, 0, 0));
|
| + image.setInfo(framebuffers[2]->getCanvas()->imageInfo());
|
| + EXPECT_TRUE(framebuffers[2]->getCanvas()->readPixels(&image, 0, 0));
|
|
|
| EXPECT_EQ(kDefaultMode.hdisplay, image.width());
|
| EXPECT_EQ(kDefaultMode.vdisplay, image.height());
|
|
|