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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 678 // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in | 678 // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in |
| 679 // 3.0). | 679 // 3.0). |
| 680 if (feature_flags_.desktop_srgb_support || | 680 if (feature_flags_.desktop_srgb_support || |
| 681 extensions.Contains("GL_EXT_sRGB_write_control")) { | 681 extensions.Contains("GL_EXT_sRGB_write_control")) { |
| 682 feature_flags_.ext_srgb_write_control = true; | 682 feature_flags_.ext_srgb_write_control = true; |
| 683 AddExtensionString("GL_EXT_sRGB_write_control"); | 683 AddExtensionString("GL_EXT_sRGB_write_control"); |
| 684 validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT); | 684 validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT); |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 | 687 |
| 688 // The extension GL_EXT_texture_sRGB_decode is the same on desktop and GLES. | |
| 689 if (extensions.Contains("GL_EXT_texture_sRGB_decode") && !IsWebGLContext()) { | |
| 690 AddExtensionString("GL_EXT_texture_sRGB_decode"); | |
| 691 validators_.texture_parameter.AddValue(GL_TEXTURE_SRGB_DECODE_EXT); | |
| 692 } | |
|
Ken Russell (switch to Gerrit)
2017/04/25 16:15:01
Simply stopping the command buffer from advertisin
zakerinasab
2017/04/25 16:45:46
Done.
| |
| 693 | |
| 694 bool have_s3tc_srgb = false; | 688 bool have_s3tc_srgb = false; |
| 695 if (gl_version_info_->is_es) { | 689 if (gl_version_info_->is_es) { |
| 696 // On mobile, the only extension that supports S3TC+sRGB is NV_sRGB_formats. | 690 // On mobile, the only extension that supports S3TC+sRGB is NV_sRGB_formats. |
| 697 // The draft extension EXT_texture_compression_s3tc_srgb also supports it | 691 // The draft extension EXT_texture_compression_s3tc_srgb also supports it |
| 698 // and is used if available (e.g. if ANGLE exposes it). | 692 // and is used if available (e.g. if ANGLE exposes it). |
| 699 have_s3tc_srgb = extensions.Contains("GL_NV_sRGB_formats") || | 693 have_s3tc_srgb = extensions.Contains("GL_NV_sRGB_formats") || |
| 700 extensions.Contains("GL_EXT_texture_compression_s3tc_srgb"); | 694 extensions.Contains("GL_EXT_texture_compression_s3tc_srgb"); |
| 701 } else { | 695 } else { |
| 702 // On desktop, strictly-speaking, S3TC+sRGB is only available if both | 696 // On desktop, strictly-speaking, S3TC+sRGB is only available if both |
| 703 // EXT_texture_sRGB and EXT_texture_compression_s3tc_srgb are available. | 697 // EXT_texture_sRGB and EXT_texture_compression_s3tc_srgb are available. |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1683 if (pos == std::string::npos) { | 1677 if (pos == std::string::npos) { |
| 1684 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1678 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1685 } | 1679 } |
| 1686 } | 1680 } |
| 1687 | 1681 |
| 1688 FeatureInfo::~FeatureInfo() { | 1682 FeatureInfo::~FeatureInfo() { |
| 1689 } | 1683 } |
| 1690 | 1684 |
| 1691 } // namespace gles2 | 1685 } // namespace gles2 |
| 1692 } // namespace gpu | 1686 } // namespace gpu |
| OLD | NEW |