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

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

Issue 2471913003: change enable_es3 to context_type in SetupFeatureInfo (Closed)
Patch Set: update Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/texture_manager_unittest.cc
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index da1c9f9d2263d2789001b5112b64d9956924dcc2..a3b51f825ea001a2296bda170b50ea959fce8c67 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -81,7 +81,7 @@ class TextureManagerTest : public GpuServiceTest {
NULL, feature_info_.get(), kMaxTextureSize, kMaxCubeMapTextureSize,
kMaxRectangleTextureSize, kMax3DTextureSize, kMaxArrayTextureLayers,
kUseDefaultTextures, nullptr));
- SetupFeatureInfo("", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("", "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
TestHelper::SetupTextureManagerInitExpectations(
gl_.get(), false, false, false, "", kUseDefaultTextures);
manager_->Initialize();
@@ -103,9 +103,7 @@ class TextureManagerTest : public GpuServiceTest {
void SetupFeatureInfo(const char* gl_extensions,
const char* gl_version,
- bool enable_es3) {
- ContextType context_type =
- enable_es3 ? CONTEXT_TYPE_OPENGLES3 : CONTEXT_TYPE_OPENGLES2;
+ ContextType context_type) {
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
gl_.get(), gl_extensions, "", gl_version, context_type);
feature_info_->InitializeForTesting(context_type);
@@ -275,7 +273,7 @@ TEST_F(TextureManagerTest, UseDefaultTexturesFalse) {
TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) {
bool use_default_textures = true;
- SetupFeatureInfo("", "OpenGL ES 3.0", true);
+ SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES3);
TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
true, true, false, "", use_default_textures);
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
@@ -292,7 +290,7 @@ TEST_F(TextureManagerTest, UseDefaultTexturesTrueES3) {
TEST_F(TextureManagerTest, UseDefaultTexturesFalseES3) {
bool use_default_textures = false;
- SetupFeatureInfo("", "OpenGL ES 3.0", true);
+ SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES3);
TestHelper::SetupTextureManagerInitExpectations(gl_.get(),
true, true, false, "", use_default_textures);
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
@@ -510,7 +508,7 @@ TEST_F(TextureManagerTest, AlphaLuminanceCompatibilityProfile) {
const GLuint kClientId = 1;
const GLuint kServiceId = 11;
- SetupFeatureInfo("", "2.1", false);
+ SetupFeatureInfo("", "2.1", CONTEXT_TYPE_OPENGLES2);
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), false, false,
false, "", kUseDefaultTextures);
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
@@ -551,7 +549,7 @@ TEST_F(TextureManagerTest, AlphaLuminanceCoreProfileEmulation) {
const GLuint kClientId = 1;
const GLuint kServiceId = 11;
- SetupFeatureInfo("", "4.2", true);
+ SetupFeatureInfo("", "4.2", CONTEXT_TYPE_OPENGLES3);
TestHelper::SetupTextureManagerInitExpectations(gl_.get(), true, true, true,
"", kUseDefaultTextures);
TextureManager manager(nullptr, feature_info_.get(), kMaxTextureSize,
@@ -2177,7 +2175,7 @@ class SharedTextureTest : public GpuServiceTest {
TextureManagerTest::kMax3DTextureSize,
TextureManagerTest::kMaxArrayTextureLayers,
kUseDefaultTextures, nullptr));
- SetupFeatureInfo("", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("", "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
TestHelper::SetupTextureManagerInitExpectations(
gl_.get(), false, false, false, "", kUseDefaultTextures);
texture_manager1_->Initialize();
@@ -2197,9 +2195,7 @@ class SharedTextureTest : public GpuServiceTest {
protected:
void SetupFeatureInfo(const char* gl_extensions,
const char* gl_version,
- bool enable_es3) {
- ContextType context_type =
- enable_es3 ? CONTEXT_TYPE_OPENGLES3 : CONTEXT_TYPE_OPENGLES2;
+ ContextType context_type) {
TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
gl_.get(), gl_extensions, "", gl_version, context_type);
feature_info_->InitializeForTesting(context_type);
@@ -2474,7 +2470,7 @@ class TextureFormatTypeValidationTest : public TextureManagerTest {
};
TEST_F(TextureFormatTypeValidationTest, ES2Basic) {
- SetupFeatureInfo("", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("", "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA);
ExpectValid(true, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB);
@@ -2507,19 +2503,22 @@ TEST_F(TextureFormatTypeValidationTest, ES2Basic) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithExtTextureFormatBGRA8888) {
- SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_EXT_texture_format_BGRA8888", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT);
}
TEST_F(TextureFormatTypeValidationTest, ES2WithAppleTextureFormatBGRA8888) {
- SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_APPLE_texture_format_BGRA8888", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_BGRA_EXT);
}
TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) {
- SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_ARB_depth_texture", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2528,7 +2527,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithArbDepth) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) {
- SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_OES_depth_texture", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2537,7 +2537,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesDepth) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) {
- SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_ANGLE_depth_texture", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2546,10 +2547,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithAngleDepth) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) {
- SetupFeatureInfo(
- "GL_EXT_packed_depth_stencil GL_ARB_depth_texture",
- "OpenGL ES 2.0",
- false);
+ SetupFeatureInfo("GL_EXT_packed_depth_stencil GL_ARB_depth_texture",
+ "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT);
ExpectValid(true, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT);
@@ -2559,8 +2558,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithExtPackedDepthStencil) {
TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) {
SetupFeatureInfo(
"GL_EXT_texture_rg GL_OES_texture_float GL_OES_texture_half_float",
- "OpenGL ES 2.0",
- false);
+ "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RED_EXT, GL_HALF_FLOAT_OES, GL_RED_EXT);
ExpectValid(true, GL_RG_EXT, GL_HALF_FLOAT_OES, GL_RG_EXT);
@@ -2574,7 +2572,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGWithFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) {
- SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_ARB_texture_rg", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RED_EXT, GL_UNSIGNED_BYTE, GL_RED_EXT);
ExpectValid(true, GL_RG_EXT, GL_UNSIGNED_BYTE, GL_RG_EXT);
@@ -2584,7 +2583,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithRGNoFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) {
- SetupFeatureInfo("", "OpenGL ES 3.0", false);
+ SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES2);
ExpectInvalidEnum(true, GL_RGB, GL_FLOAT, GL_RGB);
ExpectInvalidEnum(true, GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2598,7 +2597,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2OnTopOfES3) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) {
- SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_OES_texture_float", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RGB, GL_FLOAT, GL_RGB);
ExpectValid(true, GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2615,10 +2615,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) {
- SetupFeatureInfo(
- "GL_OES_texture_float GL_OES_texture_float_linear",
- "OpenGL ES 2.0",
- false);
+ SetupFeatureInfo("GL_OES_texture_float GL_OES_texture_float_linear",
+ "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RGB, GL_FLOAT, GL_RGB);
ExpectValid(true, GL_RGBA, GL_FLOAT, GL_RGBA);
@@ -2635,7 +2633,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureFloatLinear) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) {
- SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0", false);
+ SetupFeatureInfo("GL_OES_texture_half_float", "OpenGL ES 2.0",
+ CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RGB, GL_HALF_FLOAT_OES, GL_RGB);
ExpectValid(true, GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA);
@@ -2651,10 +2650,8 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloat) {
}
TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) {
- SetupFeatureInfo(
- "GL_OES_texture_half_float GL_OES_texture_half_float_linear",
- "OpenGL ES 2.0",
- false);
+ SetupFeatureInfo("GL_OES_texture_half_float GL_OES_texture_half_float_linear",
+ "OpenGL ES 2.0", CONTEXT_TYPE_OPENGLES2);
ExpectValid(true, GL_RGB, GL_HALF_FLOAT_OES, GL_RGB);
ExpectValid(true, GL_RGBA, GL_HALF_FLOAT_OES, GL_RGBA);
@@ -2670,7 +2667,7 @@ TEST_F(TextureFormatTypeValidationTest, ES2WithOesTextureHalfFloatLinear) {
}
TEST_F(TextureFormatTypeValidationTest, ES3Basic) {
- SetupFeatureInfo("", "OpenGL ES 3.0", true);
+ SetupFeatureInfo("", "OpenGL ES 3.0", CONTEXT_TYPE_OPENGLES3);
ExpectValid(true, GL_ALPHA, GL_UNSIGNED_BYTE, GL_ALPHA);
ExpectValid(true, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, GL_RGB);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698