| 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 de3eb5623ef77375cdcb2cb5091abb0413f575e4..004a75bbffe5b1c860b3602291ef8deb6caa02c2 100644
|
| --- a/gpu/command_buffer/service/feature_info.cc
|
| +++ b/gpu/command_buffer/service/feature_info.cc
|
| @@ -236,11 +236,13 @@ void FeatureInfo::InitializeFeatures() {
|
| feature_flags_.is_angle = StartsWithASCII(renderer_str, "ANGLE", true);
|
| }
|
|
|
| + bool is_es = false;
|
| bool is_es3 = false;
|
| const char* version_str =
|
| reinterpret_cast<const char*>(glGetString(GL_VERSION));
|
| if (version_str) {
|
| std::string lstr(base::StringToLowerASCII(std::string(version_str)));
|
| + is_es = (lstr.substr(0, 9) == "opengl es");
|
| is_es3 = (lstr.substr(0, 12) == "opengl es 3.");
|
| }
|
|
|
| @@ -396,10 +398,14 @@ void FeatureInfo::InitializeFeatures() {
|
| bool enable_texture_format_bgra8888 = false;
|
| bool enable_read_format_bgra = false;
|
| bool enable_render_buffer_bgra = false;
|
| + // Only APPLE_texture_format_BGRA8888 extension allows BGRA8_EXT in GLES's
|
| + // glTexStorage2D.
|
| + bool enable_immutable_texture_format_bgra_on_es =
|
| + extensions.Contains("GL_APPLE_texture_format_BGRA8888");
|
|
|
| // Check if we should allow GL_EXT_texture_format_BGRA8888
|
| if (extensions.Contains("GL_EXT_texture_format_BGRA8888") ||
|
| - extensions.Contains("GL_APPLE_texture_format_BGRA8888") ||
|
| + enable_immutable_texture_format_bgra_on_es ||
|
| extensions.Contains("GL_EXT_bgra")) {
|
| enable_texture_format_bgra8888 = true;
|
| }
|
| @@ -692,7 +698,12 @@ void FeatureInfo::InitializeFeatures() {
|
| validators_.texture_parameter.AddValue(GL_TEXTURE_USAGE_ANGLE);
|
| }
|
|
|
| - if (extensions.Contains("GL_EXT_texture_storage")) {
|
| + // Disable it if BGRA8_EXT isn't allowed.
|
| + bool support_bgra = (enable_texture_format_bgra8888 && !is_es) ||
|
| + (enable_immutable_texture_format_bgra_on_es && is_es);
|
| + if (support_bgra &&
|
| + (extensions.Contains("GL_EXT_texture_storage") ||
|
| + extensions.Contains("GL_ARB_texture_storage") || is_es3)) {
|
| feature_flags_.ext_texture_storage = true;
|
| AddExtensionString("GL_EXT_texture_storage");
|
| validators_.texture_parameter.AddValue(GL_TEXTURE_IMMUTABLE_FORMAT_EXT);
|
|
|