| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support | 584 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support |
| 585 // for SRGB Textures but the accepted internal formats for TexImage2D are only | 585 // for SRGB Textures but the accepted internal formats for TexImage2D are only |
| 586 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid | 586 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid |
| 587 // <format> in this case. So, even with GLES3 explicitly check for | 587 // <format> in this case. So, even with GLES3 explicitly check for |
| 588 // GL_EXT_sRGB. | 588 // GL_EXT_sRGB. |
| 589 if ((((gl_version_info_->is_es3 || | 589 if ((((gl_version_info_->is_es3 || |
| 590 extensions.Contains("GL_OES_rgb8_rgba8")) && | 590 extensions.Contains("GL_OES_rgb8_rgba8")) && |
| 591 extensions.Contains("GL_EXT_sRGB")) || | 591 extensions.Contains("GL_EXT_sRGB")) || |
| 592 feature_flags_.desktop_srgb_support) && | 592 feature_flags_.desktop_srgb_support) && |
| 593 IsWebGL1OrES2Context()) { | 593 IsWebGL1OrES2Context()) { |
| 594 feature_flags_.ext_srgb = true; | |
| 595 AddExtensionString("GL_EXT_sRGB"); | 594 AddExtensionString("GL_EXT_sRGB"); |
| 596 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); | 595 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); |
| 597 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 596 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 598 validators_.texture_format.AddValue(GL_SRGB_EXT); | 597 validators_.texture_format.AddValue(GL_SRGB_EXT); |
| 599 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); | 598 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 600 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); | 599 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); |
| 601 validators_.framebuffer_parameter.AddValue( | 600 validators_.framebuffer_parameter.AddValue( |
| 602 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); | 601 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); |
| 603 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); | 602 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); |
| 604 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 603 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1571 if (pos == std::string::npos) { | 1570 if (pos == std::string::npos) { |
| 1572 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1571 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1573 } | 1572 } |
| 1574 } | 1573 } |
| 1575 | 1574 |
| 1576 FeatureInfo::~FeatureInfo() { | 1575 FeatureInfo::~FeatureInfo() { |
| 1577 } | 1576 } |
| 1578 | 1577 |
| 1579 } // namespace gles2 | 1578 } // namespace gles2 |
| 1580 } // namespace gpu | 1579 } // namespace gpu |
| OLD | NEW |