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; |
594 AddExtensionString("GL_EXT_sRGB"); | 595 AddExtensionString("GL_EXT_sRGB"); |
595 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); | 596 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); |
596 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 597 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
597 validators_.texture_format.AddValue(GL_SRGB_EXT); | 598 validators_.texture_format.AddValue(GL_SRGB_EXT); |
598 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); | 599 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); |
599 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); | 600 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); |
600 validators_.framebuffer_parameter.AddValue( | 601 validators_.framebuffer_parameter.AddValue( |
601 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); | 602 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); |
602 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); | 603 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); |
603 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 604 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 if (pos == std::string::npos) { | 1588 if (pos == std::string::npos) { |
1588 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1589 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1589 } | 1590 } |
1590 } | 1591 } |
1591 | 1592 |
1592 FeatureInfo::~FeatureInfo() { | 1593 FeatureInfo::~FeatureInfo() { |
1593 } | 1594 } |
1594 | 1595 |
1595 } // namespace gles2 | 1596 } // namespace gles2 |
1596 } // namespace gpu | 1597 } // namespace gpu |
OLD | NEW |