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

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

Issue 2156393002: Fix glDrawBuffers(0, ...) on main framebuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correct semantics Created 4 years, 5 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') | no next file » | 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 4038a668d996d693edede09a906cb497495253fb..dda301aeb5c2c342a0036ad715e7d80a4963a7a7 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
@@ -3026,6 +3026,40 @@ TEST_P(GLES2DecoderTest, DrawBuffersEXTImmediateBackbuffer) {
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
+TEST_P(GLES2DecoderTest, DrawBuffersEXTMainFramebuffer) {
+ DrawBuffersEXTImmediate& cmd = *GetImmediateAs<DrawBuffersEXTImmediate>();
+ {
+ const GLenum bufs[] = {GL_BACK};
+ const GLsizei count = arraysize(bufs);
+ cmd.Init(count, bufs);
+
+ EXPECT_CALL(*gl_, DrawBuffersARB(count, Pointee(GL_BACK)))
+ .Times(1)
+ .RetiresOnSaturation();
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(bufs)));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ }
+ {
+ const GLsizei count = 0;
+ cmd.Init(count, nullptr);
+
+ EXPECT_CALL(*gl_, DrawBuffersARB(_, _))
+ .Times(0)
+ .RetiresOnSaturation();
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, 0));
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+ }
+ {
+ const GLenum bufs[] = {GL_BACK, GL_NONE};
+ const GLsizei count = arraysize(bufs);
+ cmd.Init(count, bufs);
+
+ EXPECT_CALL(*gl_, DrawBuffersARB(_, _)).Times(0).RetiresOnSaturation();
+ EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(bufs)));
+ EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ }
+}
+
TEST_P(GLES2DecoderManualInitTest, InvalidateFramebufferBinding) {
InitState init;
init.gl_version = "opengl es 3.0";
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698