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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc

Issue 1583283004: Ensure alpha channel in backbuffer is correct with DirectComposition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698