OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 AddExtensionString("GL_OES_element_index_uint"); | 494 AddExtensionString("GL_OES_element_index_uint"); |
495 validators_.index_type.AddValue(GL_UNSIGNED_INT); | 495 validators_.index_type.AddValue(GL_UNSIGNED_INT); |
496 } | 496 } |
497 | 497 |
498 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the | 498 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the |
499 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support | 499 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support |
500 // for SRGB Textures but the accepted internal formats for TexImage2D are only | 500 // for SRGB Textures but the accepted internal formats for TexImage2D are only |
501 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid | 501 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid |
502 // <format> in this case. So, even with GLES3 explicitly check for | 502 // <format> in this case. So, even with GLES3 explicitly check for |
503 // GL_EXT_sRGB. | 503 // GL_EXT_sRGB. |
504 if (((gl_version_info_->is_es3 || | 504 if (!workarounds_.disable_ext_srgb && |
505 extensions.Contains("GL_OES_rgb8_rgba8")) && | 505 (((gl_version_info_->is_es3 || |
506 extensions.Contains("GL_EXT_sRGB")) || gfx::HasDesktopGLFeatures()) { | 506 extensions.Contains("GL_OES_rgb8_rgba8")) && |
| 507 extensions.Contains("GL_EXT_sRGB")) || gfx::HasDesktopGLFeatures())) { |
507 AddExtensionString("GL_EXT_sRGB"); | 508 AddExtensionString("GL_EXT_sRGB"); |
508 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); | 509 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); |
509 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 510 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
510 validators_.texture_format.AddValue(GL_SRGB_EXT); | 511 validators_.texture_format.AddValue(GL_SRGB_EXT); |
511 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); | 512 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); |
512 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); | 513 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); |
513 validators_.frame_buffer_parameter.AddValue( | 514 validators_.frame_buffer_parameter.AddValue( |
514 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); | 515 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); |
515 } | 516 } |
516 | 517 |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 if (pos == std::string::npos) { | 1238 if (pos == std::string::npos) { |
1238 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1239 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1239 } | 1240 } |
1240 } | 1241 } |
1241 | 1242 |
1242 FeatureInfo::~FeatureInfo() { | 1243 FeatureInfo::~FeatureInfo() { |
1243 } | 1244 } |
1244 | 1245 |
1245 } // namespace gles2 | 1246 } // namespace gles2 |
1246 } // namespace gpu | 1247 } // namespace gpu |
OLD | NEW |