Chromium Code Reviews| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 592 AddExtensionString("GL_EXT_sRGB"); | 592 AddExtensionString("GL_EXT_sRGB"); |
| 593 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); | 593 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); |
| 594 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 594 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 595 validators_.texture_format.AddValue(GL_SRGB_EXT); | 595 validators_.texture_format.AddValue(GL_SRGB_EXT); |
| 596 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); | 596 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 597 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); | 597 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); |
| 598 validators_.framebuffer_parameter.AddValue( | 598 validators_.framebuffer_parameter.AddValue( |
| 599 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); | 599 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); |
| 600 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); | 600 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); |
| 601 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); | 601 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 602 | |
| 603 // GL_FRAMEBUFFER_SRGB_EXT is exposed by the GLES extension | |
| 604 // GL_EXT_sRGB_write_control (which is not part of the core, even in GLES3), | |
| 605 // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in | |
| 606 // 3.0). | |
| 607 if (feature_flags_.desktop_srgb_support || | |
| 608 extensions.Contains("GL_EXT_sRGB_write_control")) { | |
|
Zhenyao Mo
2016/11/30 19:31:11
Don't does this if IsWebGLContext(). Otherwise you
ccameron
2016/11/30 23:59:44
Updated to track if we support srgb framebuffers,
| |
| 609 feature_flags_.ext_srgb_write_control = true; | |
| 610 AddExtensionString("GL_EXT_sRGB_write_control"); | |
| 611 validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT); | |
| 612 } | |
| 602 } | 613 } |
| 603 | 614 |
| 604 // On desktop, GL_EXT_texture_sRGB is required regardless of GL version, | 615 // On desktop, GL_EXT_texture_sRGB is required regardless of GL version, |
| 605 // since the sRGB formats in OpenGL 3.0 Core do not support S3TC. | 616 // since the sRGB formats in OpenGL 3.0 Core do not support S3TC. |
| 606 // TODO(kainino): Support GL_EXT_texture_compression_s3tc_srgb once ratified. | 617 // TODO(kainino): Support GL_EXT_texture_compression_s3tc_srgb once ratified. |
| 607 if ((gl_version_info_->is_es && extensions.Contains("GL_NV_sRGB_formats")) || | 618 if ((gl_version_info_->is_es && extensions.Contains("GL_NV_sRGB_formats")) || |
| 608 (!gl_version_info_->is_es && | 619 (!gl_version_info_->is_es && |
| 609 extensions.Contains("GL_EXT_texture_sRGB") && | 620 extensions.Contains("GL_EXT_texture_sRGB") && |
| 610 extensions.Contains("GL_EXT_texture_compression_s3tc"))) { | 621 extensions.Contains("GL_EXT_texture_compression_s3tc"))) { |
| 611 AddExtensionString("GL_EXT_texture_compression_s3tc_srgb"); | 622 AddExtensionString("GL_EXT_texture_compression_s3tc_srgb"); |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1539 if (pos == std::string::npos) { | 1550 if (pos == std::string::npos) { |
| 1540 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1551 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1541 } | 1552 } |
| 1542 } | 1553 } |
| 1543 | 1554 |
| 1544 FeatureInfo::~FeatureInfo() { | 1555 FeatureInfo::~FeatureInfo() { |
| 1545 } | 1556 } |
| 1546 | 1557 |
| 1547 } // namespace gles2 | 1558 } // namespace gles2 |
| 1548 } // namespace gpu | 1559 } // namespace gpu |
| OLD | NEW |