Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 2539163003: Add command buffer support for GL_EXT_texture_sRGB_decode (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in 612 // and the desktop extension GL_ARB_framebuffer_sRGB (part of the core in
613 // 3.0). 613 // 3.0).
614 if (feature_flags_.desktop_srgb_support || 614 if (feature_flags_.desktop_srgb_support ||
615 extensions.Contains("GL_EXT_sRGB_write_control")) { 615 extensions.Contains("GL_EXT_sRGB_write_control")) {
616 feature_flags_.ext_srgb_write_control = true; 616 feature_flags_.ext_srgb_write_control = true;
617 AddExtensionString("GL_EXT_sRGB_write_control"); 617 AddExtensionString("GL_EXT_sRGB_write_control");
618 validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT); 618 validators_.capability.AddValue(GL_FRAMEBUFFER_SRGB_EXT);
619 } 619 }
620 } 620 }
621 621
622 // The extension GL_EXT_texture_sRGB_decode is the same on desktop and GLES.
623 if (extensions.Contains("GL_EXT_texture_sRGB_decode") && !IsWebGLContext()) {
624 AddExtensionString("GL_EXT_texture_sRGB_decode");
625 validators_.texture_parameter.AddValue(GL_TEXTURE_SRGB_DECODE_EXT);
626 }
627
622 // On desktop, GL_EXT_texture_sRGB is required regardless of GL version, 628 // On desktop, GL_EXT_texture_sRGB is required regardless of GL version,
623 // since the sRGB formats in OpenGL 3.0 Core do not support S3TC. 629 // since the sRGB formats in OpenGL 3.0 Core do not support S3TC.
624 // TODO(kainino): Support GL_EXT_texture_compression_s3tc_srgb once ratified. 630 // TODO(kainino): Support GL_EXT_texture_compression_s3tc_srgb once ratified.
625 if ((gl_version_info_->is_es && extensions.Contains("GL_NV_sRGB_formats")) || 631 if ((gl_version_info_->is_es && extensions.Contains("GL_NV_sRGB_formats")) ||
626 (!gl_version_info_->is_es && 632 (!gl_version_info_->is_es &&
627 extensions.Contains("GL_EXT_texture_sRGB") && 633 extensions.Contains("GL_EXT_texture_sRGB") &&
628 extensions.Contains("GL_EXT_texture_compression_s3tc"))) { 634 extensions.Contains("GL_EXT_texture_compression_s3tc"))) {
629 AddExtensionString("GL_EXT_texture_compression_s3tc_srgb"); 635 AddExtensionString("GL_EXT_texture_compression_s3tc_srgb");
630 636
631 validators_.compressed_texture_format.AddValue( 637 validators_.compressed_texture_format.AddValue(
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 if (pos == std::string::npos) { 1563 if (pos == std::string::npos) {
1558 extensions_ += (extensions_.empty() ? "" : " ") + str; 1564 extensions_ += (extensions_.empty() ? "" : " ") + str;
1559 } 1565 }
1560 } 1566 }
1561 1567
1562 FeatureInfo::~FeatureInfo() { 1568 FeatureInfo::~FeatureInfo() {
1563 } 1569 }
1564 1570
1565 } // namespace gles2 1571 } // namespace gles2
1566 } // namespace gpu 1572 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698