| Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| index 3383e26971b8c93f7eb902e3de05cf15a60e05de..ffa08b0916e55eed5c5ce7528568a9c0b1b801e2 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| @@ -35,6 +35,7 @@
|
|
|
| using ::gfx::MockGLInterface;
|
| using ::testing::_;
|
| +using ::testing::AnyNumber;
|
| using ::testing::DoAll;
|
| using ::testing::InSequence;
|
| using ::testing::Invoke;
|
| @@ -2767,6 +2768,41 @@ TEST_P(GLES2DecoderManualInitTest, InvalidateFramebufferBinding) {
|
| gfx::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT"));
|
| }
|
|
|
| +TEST_P(GLES2DecoderTest, ClearBackbufferBitsOnFlipSwap) {
|
| + surface_->set_buffers_flipped(true);
|
| +
|
| + EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest());
|
| +
|
| + SwapBuffers& cmd = *GetImmediateAs<SwapBuffers>();
|
| + cmd.Init();
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| + EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT),
|
| + GetAndClearBackbufferClearBitsForTest());
|
| +
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| + EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest());
|
| +
|
| + EXPECT_CALL(*gl_, Finish()).Times(AnyNumber());
|
| + ResizeCHROMIUM& resize_cmd = *GetImmediateAs<ResizeCHROMIUM>();
|
| + resize_cmd.Init(1, 1, 1.0f, GL_TRUE);
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(resize_cmd));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| + EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT),
|
| + GetAndClearBackbufferClearBitsForTest());
|
| +
|
| + cmd.Init();
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| + EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT),
|
| + GetAndClearBackbufferClearBitsForTest());
|
| +
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| + EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest());
|
| +}
|
| +
|
| TEST_P(GLES2DecoderManualInitTest, DiscardFramebufferEXT) {
|
| InitState init;
|
| init.extensions = "GL_EXT_discard_framebuffer";
|
|
|