summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/test_helper.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 21:29:11 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-30 21:29:11 +0000
commit915a59a10d1a1bb008821fd4e4f2019a4c676142 (patch)
treebec2e4c963ea3f6da1e839799a144de14086945e /gpu/command_buffer/service/test_helper.cc
parentd15e56c68d773261b98d20b61aeeb03cfa0fb24e (diff)
downloadchromium_src-915a59a10d1a1bb008821fd4e4f2019a4c676142.zip
chromium_src-915a59a10d1a1bb008821fd4e4f2019a4c676142.tar.gz
chromium_src-915a59a10d1a1bb008821fd4e4f2019a4c676142.tar.bz2
A step in making it possible for WebGL to request no features
and the add them in as extensions are enabled. The idea is when WebGL inits it's context it will pass "" to FeatureInfo::Initialize. After that it can pass various GL extension strings to FeatureInfo::AddFeatures to turn on more features. It can then call glGetString(GL_EXTENSIONS) to see if the feature was turned on. Questions: I started this CL trying to make it possible so each context could have it's own FeatureInfo. I decided against that. So that brings up the question, should I get rid of FeatureInfo and just put this stuff back on ContextGroup or leave it as is? If I leave it as is, should I move all the max_XXX stuff on ContextGroup to FeatureInfo? TEST=unit tests BUG=none Review URL: http://codereview.chromium.org/3413038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/test_helper.cc')
-rw-r--r--gpu/command_buffer/service/test_helper.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
index 9002e7f..578c3c9 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -36,8 +36,11 @@ const GLint TestHelper::kNumTextureUnits;
const GLint TestHelper::kMaxTextureImageUnits;
const GLint TestHelper::kMaxVertexTextureImageUnits;
const GLint TestHelper::kMaxFragmentUniformVectors;
+const GLint TestHelper::kMaxFragmentUniformComponents;
const GLint TestHelper::kMaxVaryingVectors;
+const GLint TestHelper::kMaxVaryingFloats;
const GLint TestHelper::kMaxVertexUniformVectors;
+const GLint TestHelper::kMaxVertexUniformComponents;
#endif
void TestHelper::SetupTextureManagerInitExpectations(
@@ -90,9 +93,8 @@ void TestHelper::SetupContextGroupInitExpectations(
::gfx::MockGLInterface* gl, const char* extensions) {
InSequence sequence;
- EXPECT_CALL(*gl, GetString(GL_EXTENSIONS))
- .WillOnce(Return(reinterpret_cast<const uint8*>(extensions)))
- .RetiresOnSaturation();
+ SetupFeatureInfoInitExpectations(gl, extensions);
+
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_ATTRIBS, _))
.WillOnce(SetArgumentPointee<1>(kNumVertexAttribs))
.RetiresOnSaturation();
@@ -105,6 +107,7 @@ void TestHelper::SetupContextGroupInitExpectations(
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _))
.WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize))
.RetiresOnSaturation();
+
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, _))
.WillOnce(SetArgumentPointee<1>(kMaxTextureImageUnits))
.RetiresOnSaturation();
@@ -112,18 +115,27 @@ void TestHelper::SetupContextGroupInitExpectations(
.WillOnce(SetArgumentPointee<1>(kMaxVertexTextureImageUnits))
.RetiresOnSaturation();
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, _))
- .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformVectors))
+ .WillOnce(SetArgumentPointee<1>(kMaxFragmentUniformComponents))
.RetiresOnSaturation();
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VARYING_FLOATS, _))
- .WillOnce(SetArgumentPointee<1>(kMaxVaryingVectors))
+ .WillOnce(SetArgumentPointee<1>(kMaxVaryingFloats))
.RetiresOnSaturation();
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, _))
- .WillOnce(SetArgumentPointee<1>(kMaxVertexUniformVectors))
+ .WillOnce(SetArgumentPointee<1>(kMaxVertexUniformComponents))
.RetiresOnSaturation();
SetupTextureManagerInitExpectations(gl);
}
+void TestHelper::SetupFeatureInfoInitExpectations(
+ ::gfx::MockGLInterface* gl, const char* extensions) {
+ InSequence sequence;
+
+ EXPECT_CALL(*gl, GetString(GL_EXTENSIONS))
+ .WillOnce(Return(reinterpret_cast<const uint8*>(extensions)))
+ .RetiresOnSaturation();
+}
+
} // namespace gles2
} // namespace gpu