| 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 e1acdebe073f3b930cfd4dcbbd59637b192466be..f50e03020936ed1e65120ccdfb45d8d285738cdc 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| @@ -1982,6 +1982,153 @@ TEST_P(GLES3DecoderTest, CopyTexImage2DInvalidInternalFormat) {
|
| EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
|
| }
|
|
|
| +TEST_P(GLES3DecoderTest, CopyTexImage2DInvalidInternalFormat_Float) {
|
| + const GLuint kFBOClientTextureId = 4100;
|
| + const GLuint kFBOServiceTextureId = 4101;
|
| +
|
| + GLenum target = GL_TEXTURE_2D;
|
| + GLint level = 0;
|
| + GLenum internal_format = GL_RG16F;
|
| + GLenum format = GL_RG;
|
| + GLenum type = GL_HALF_FLOAT;
|
| + GLsizei width = 16;
|
| + GLsizei height = 8;
|
| + GLint border = 0;
|
| +
|
| + EXPECT_CALL(*gl_, GenTextures(_, _))
|
| + .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
|
| + .RetiresOnSaturation();
|
| + GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
|
| +
|
| + DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
|
| + DoTexImage2D(GL_TEXTURE_2D,
|
| + level,
|
| + internal_format,
|
| + width,
|
| + height,
|
| + 0,
|
| + format,
|
| + type,
|
| + kSharedMemoryId,
|
| + kSharedMemoryOffset);
|
| + DoBindFramebuffer(
|
| + GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
|
| + DoFramebufferTexture2D(GL_READ_FRAMEBUFFER,
|
| + GL_COLOR_ATTACHMENT0,
|
| + GL_TEXTURE_2D,
|
| + kFBOClientTextureId,
|
| + kFBOServiceTextureId,
|
| + 0,
|
| + GL_NO_ERROR);
|
| + EXPECT_CALL(*gl_,
|
| + CopyTexImage2D(
|
| + target, level, internal_format, 0, 0, width, height, border))
|
| + .Times(0);
|
| + DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| + CopyTexImage2D cmd;
|
| + cmd.Init(target, level, internal_format, 0, 0, width, height);
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
|
| +}
|
| +
|
| +TEST_P(GLES3DecoderTest, CopyTexImage2DInvalidInternalFormat_Integer) {
|
| + const GLuint kFBOClientTextureId = 4100;
|
| + const GLuint kFBOServiceTextureId = 4101;
|
| +
|
| + GLenum target = GL_TEXTURE_2D;
|
| + GLint level = 0;
|
| + GLenum internal_format = GL_RG8I;
|
| + GLenum format = GL_RG_INTEGER;
|
| + GLenum type = GL_UNSIGNED_BYTE;
|
| + GLsizei width = 16;
|
| + GLsizei height = 8;
|
| + GLint border = 0;
|
| +
|
| + EXPECT_CALL(*gl_, GenTextures(_, _))
|
| + .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
|
| + .RetiresOnSaturation();
|
| + GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
|
| +
|
| + DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
|
| + DoTexImage2D(GL_TEXTURE_2D,
|
| + level,
|
| + GL_RG8UI,
|
| + width,
|
| + height,
|
| + 0,
|
| + format,
|
| + type,
|
| + kSharedMemoryId,
|
| + kSharedMemoryOffset);
|
| + DoBindFramebuffer(
|
| + GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
|
| + DoFramebufferTexture2D(GL_READ_FRAMEBUFFER,
|
| + GL_COLOR_ATTACHMENT0,
|
| + GL_TEXTURE_2D,
|
| + kFBOClientTextureId,
|
| + kFBOServiceTextureId,
|
| + 0,
|
| + GL_NO_ERROR);
|
| + EXPECT_CALL(*gl_,
|
| + CopyTexImage2D(
|
| + target, level, internal_format, 0, 0, width, height, border))
|
| + .Times(0);
|
| + DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| + CopyTexImage2D cmd;
|
| + cmd.Init(target, level, internal_format, 0, 0, width, height);
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
|
| +}
|
| +
|
| +TEST_P(GLES3DecoderTest, CopyTexImage2DInvalidInternalFormat_sRGB) {
|
| + const GLuint kFBOClientTextureId = 4100;
|
| + const GLuint kFBOServiceTextureId = 4101;
|
| +
|
| + GLenum target = GL_TEXTURE_2D;
|
| + GLint level = 0;
|
| + GLenum internal_format = GL_SRGB8;
|
| + GLenum format = GL_RGB;
|
| + GLenum type = GL_UNSIGNED_BYTE;
|
| + GLsizei width = 16;
|
| + GLsizei height = 8;
|
| + GLint border = 0;
|
| +
|
| + EXPECT_CALL(*gl_, GenTextures(_, _))
|
| + .WillOnce(SetArgPointee<1>(kFBOServiceTextureId))
|
| + .RetiresOnSaturation();
|
| + GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
|
| +
|
| + DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
|
| + DoTexImage2D(GL_TEXTURE_2D,
|
| + level,
|
| + GL_RGB,
|
| + width,
|
| + height,
|
| + 0,
|
| + format,
|
| + type,
|
| + kSharedMemoryId,
|
| + kSharedMemoryOffset);
|
| + DoBindFramebuffer(
|
| + GL_READ_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
|
| + DoFramebufferTexture2D(GL_READ_FRAMEBUFFER,
|
| + GL_COLOR_ATTACHMENT0,
|
| + GL_TEXTURE_2D,
|
| + kFBOClientTextureId,
|
| + kFBOServiceTextureId,
|
| + 0,
|
| + GL_NO_ERROR);
|
| + EXPECT_CALL(*gl_,
|
| + CopyTexImage2D(
|
| + target, level, internal_format, 0, 0, width, height, border))
|
| + .Times(0);
|
| + DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| + CopyTexImage2D cmd;
|
| + cmd.Init(target, level, internal_format, 0, 0, width, height);
|
| + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| + EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
|
| +}
|
| +
|
| TEST_P(GLES2DecoderManualInitTest,
|
| UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) {
|
| InitState init;
|
|
|