| Index: gpu/command_buffer/service/test_helper.cc
|
| diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
|
| index cea7b8afd455a62c3d3b078f764450d561f5394a..7d9fb6f1aaac83397eaac34181ec2dcf91031177 100644
|
| --- a/gpu/command_buffer/service/test_helper.cc
|
| +++ b/gpu/command_buffer/service/test_helper.cc
|
| @@ -344,21 +344,22 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
|
|
| if (strstr(extensions, "GL_ARB_texture_float") ||
|
| (is_es3 && strstr(extensions, "GL_EXT_color_buffer_float"))) {
|
| - static const GLuint gl_ids[] = {101, 102};
|
| + static const GLuint tx_ids[] = {101, 102};
|
| + static const GLuint fb_ids[] = {103, 104};
|
| const GLsizei width = 16;
|
| EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _))
|
| - .WillOnce(SetArgumentPointee<1>(gl_ids[0]))
|
| + .WillOnce(SetArgumentPointee<1>(fb_ids[0]))
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, GetIntegerv(GL_TEXTURE_BINDING_2D, _))
|
| - .WillOnce(SetArgumentPointee<1>(gl_ids[0]))
|
| + .WillOnce(SetArgumentPointee<1>(tx_ids[0]))
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, GenTextures(1, _))
|
| - .WillOnce(SetArrayArgument<1>(gl_ids + 1, gl_ids + 2))
|
| + .WillOnce(SetArrayArgument<1>(tx_ids + 1, tx_ids + 2))
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, GenFramebuffersEXT(1, _))
|
| - .WillOnce(SetArrayArgument<1>(gl_ids + 1, gl_ids + 2))
|
| + .WillOnce(SetArrayArgument<1>(fb_ids + 1, fb_ids + 2))
|
| .RetiresOnSaturation();
|
| - EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, gl_ids[1]))
|
| + EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[1]))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
| @@ -369,11 +370,11 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
| GL_RGBA, GL_FLOAT, _))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| - EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, gl_ids[1]))
|
| + EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1]))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER,
|
| - GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gl_ids[1], 0))
|
| + GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
|
| @@ -398,10 +399,10 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
| EXPECT_CALL(*gl, DeleteTextures(1, _))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| - EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, gl_ids[0]))
|
| + EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[0]))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| - EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, gl_ids[0]))
|
| + EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0]))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| #if DCHECK_IS_ON
|
| @@ -421,6 +422,59 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
|
| .WillOnce(SetArgumentPointee<1>(8))
|
| .RetiresOnSaturation();
|
| }
|
| +
|
| + if (is_es3 || strstr(extensions, "GL_EXT_texture_rg") ||
|
| + (strstr(extensions, "GL_ARB_texture_rg"))) {
|
| + static const GLuint tx_ids[] = {101, 102};
|
| + static const GLuint fb_ids[] = {103, 104};
|
| + const GLsizei width = 1;
|
| + EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _))
|
| + .WillOnce(SetArgumentPointee<1>(fb_ids[0]))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, GetIntegerv(GL_TEXTURE_BINDING_2D, _))
|
| + .WillOnce(SetArgumentPointee<1>(tx_ids[0]))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, GenTextures(1, _))
|
| + .WillOnce(SetArrayArgument<1>(tx_ids + 1, tx_ids + 2))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[1]))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RED_EXT, width, width, 0,
|
| + GL_RED_EXT, GL_UNSIGNED_BYTE, _))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, GenFramebuffersEXT(1, _))
|
| + .WillOnce(SetArrayArgument<1>(fb_ids + 1, fb_ids + 2))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1]))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER,
|
| + GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
|
| + .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, DeleteFramebuffersEXT(1, _))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, DeleteTextures(1, _))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[0]))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0]))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| +#if DCHECK_IS_ON
|
| + EXPECT_CALL(*gl, GetError())
|
| + .WillOnce(Return(GL_NO_ERROR))
|
| + .RetiresOnSaturation();
|
| +#endif
|
| + }
|
| }
|
|
|
| void TestHelper::SetupExpectationsForClearingUniforms(
|
|
|