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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/program_manager.cc ('k') | gpu/command_buffer/service/valuebuffer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/valuebuffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698