| 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 b2980f1c7d7607aa02eaa8431d5ab8ad11486847..512ca16c33d97cb419d8d0d55cc4e1694389ed2f 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_framebuffers.cc
|
| @@ -2694,6 +2694,130 @@ TEST_P(GLES3DecoderTest, CopyTexImage2DValidInternalFormat) {
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| }
|
|
|
| +TEST_P(GLES3DecoderManualInitTest, CopyTexImage2DValidInternalFormat_FloatEXT) {
|
| + InitState init;
|
| + init.extensions = "GL_EXT_color_buffer_float";
|
| + init.gl_version = "OpenGL ES 3.0";
|
| + init.bind_generates_resource = true;
|
| + init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| + InitDecoder(init);
|
| +
|
| + const GLuint kFBOClientTextureId = 4100;
|
| + const GLuint kFBOServiceTextureId = 4101;
|
| +
|
| + GLenum target = GL_TEXTURE_2D;
|
| + GLint level = 0;
|
| + GLenum internal_format = GL_RG16F;
|
| + GLenum format = GL_RGBA;
|
| + 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,
|
| + GL_RGBA16F,
|
| + 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(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl_, GetError())
|
| + .WillOnce(Return(GL_NO_ERROR))
|
| + .WillOnce(Return(GL_NO_ERROR))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
|
| + .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
|
| + .RetiresOnSaturation();
|
| + 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_NO_ERROR, GetGLError());
|
| +}
|
| +
|
| +TEST_P(GLES3DecoderManualInitTest,
|
| + CopyTexImage2DInvalidInternalFormat_FloatEXT) {
|
| + InitState init;
|
| + init.extensions = "GL_EXT_color_buffer_float";
|
| + init.gl_version = "OpenGL ES 3.0";
|
| + init.bind_generates_resource = true;
|
| + init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| + InitDecoder(init);
|
| +
|
| + const GLuint kFBOClientTextureId = 4100;
|
| + const GLuint kFBOServiceTextureId = 4101;
|
| +
|
| + GLenum target = GL_TEXTURE_2D;
|
| + GLint level = 0;
|
| + GLenum internal_format = GL_RG16F;
|
| + GLenum format = GL_RGBA;
|
| + 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_RGBA8,
|
| + 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);
|
| + EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER))
|
| + .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
|
| + .RetiresOnSaturation();
|
| + 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) {
|
| const GLuint kFBOClientTextureId = 4100;
|
| const GLuint kFBOServiceTextureId = 4101;
|
|
|