Chromium Code Reviews| Index: gpu/command_buffer/service/feature_info.cc |
| diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc |
| index 55ea77d55213a26f4558966d9120953cc6d8587c..fc0642819c625bc15a94bc5f6695837133007e36 100644 |
| --- a/gpu/command_buffer/service/feature_info.cc |
| +++ b/gpu/command_buffer/service/feature_info.cc |
| @@ -83,12 +83,10 @@ class StringSet { |
| class ScopedPixelUnpackBufferOverride { |
| public: |
| explicit ScopedPixelUnpackBufferOverride( |
| - bool is_es3_capable, |
| - ContextType context_type, |
| + bool enable_es3, |
| GLuint binding_override) |
| : orig_binding_(-1) { |
| - if (!(context_type == CONTEXT_TYPE_WEBGL1 || |
| - context_type == CONTEXT_TYPE_OPENGLES2) && is_es3_capable) { |
| + if (enable_es3) { |
| GLint orig_binding; |
| glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, &orig_binding); |
| if (static_cast<GLuint>(orig_binding) != binding_override) { |
| @@ -199,10 +197,6 @@ void FeatureInfo::InitializeBasicState(const base::CommandLine* command_line) { |
| feature_flags_.is_swiftshader = |
| (command_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); |
| - enable_unsafe_es3_apis_switch_ = |
| - command_line->HasSwitch(switches::kEnableUnsafeES3APIs) && |
|
Zhenyao Mo
2016/11/02 21:46:28
Per our offline discussion, we need to hook up Gpu
|
| - !command_line->HasSwitch(switches::kDisableES3APIs); |
| - |
| // The shader translator is needed to translate from WebGL-conformant GLES SL |
| // to normal GLES SL, enforce WebGL conformance, translate from GLES SL 1.0 to |
| // target context GLSL, implement emulation of OpenGL ES features on OpenGL, |
| @@ -350,10 +344,9 @@ void FeatureInfo::InitializeFeatures() { |
| gl_version_info_.reset( |
| new gl::GLVersionInfo(version_str, renderer_str, extensions.GetImpl())); |
| - // TODO(kainino): This call to IsES3Capable is sort of a hack to get some |
| - // mocked tests working. |
| - ScopedPixelUnpackBufferOverride scoped_pbo_override( |
| - IsES3Capable(), context_type_, 0); |
| + bool enable_es3 = IsWebGL2OrES3Context(); |
| + |
| + ScopedPixelUnpackBufferOverride scoped_pbo_override(enable_es3, 0); |
| AddExtensionString("GL_ANGLE_translated_shader_source"); |
| AddExtensionString("GL_CHROMIUM_async_pixel_transfers"); |
| @@ -856,7 +849,7 @@ void FeatureInfo::InitializeFeatures() { |
| // For desktop systems, check to see if we support rendering to the full |
| // range of formats supported by EXT_color_buffer_float |
| - if (status_rgba == GL_FRAMEBUFFER_COMPLETE && IsES3Capable()) { |
| + if (status_rgba == GL_FRAMEBUFFER_COMPLETE && enable_es3) { |
|
piman
2016/11/02 22:05:08
I think we still expose the extension on ES2/WebGL
Zhenyao Mo
2016/11/02 22:15:00
I checked the spec, the ES spec says it's ES3 exte
|
| bool full_float_support = true; |
| glTexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, 0, GL_RED, |
| @@ -908,7 +901,7 @@ void FeatureInfo::InitializeFeatures() { |
| } |
| // Enable the GL_EXT_color_buffer_float extension for WebGL 2.0 |
| - if (enable_ext_color_buffer_float && IsES3Capable()) { |
| + if (enable_ext_color_buffer_float && enable_es3) { |
|
piman
2016/11/02 22:05:08
ditto
|
| ext_color_buffer_float_available_ = true; |
| if (!disallowed_features_.ext_color_buffer_float) |
| EnableEXTColorBufferFloat(); |
| @@ -1413,8 +1406,6 @@ void FeatureInfo::InitializeFeatures() { |
| } |
| bool FeatureInfo::IsES3Capable() const { |
| - if (!enable_unsafe_es3_apis_switch_) |
| - return false; |
| if (workarounds_.disable_texture_storage) |
| return false; |
| if (gl_version_info_) |