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

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

Issue 2479513002: Reland of Extend CopyTextureCHROMIUM to more ES 3.0 texture formats. (Closed)
Patch Set: fix comments#19 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support 582 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support
583 // for SRGB Textures but the accepted internal formats for TexImage2D are only 583 // for SRGB Textures but the accepted internal formats for TexImage2D are only
584 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid 584 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid
585 // <format> in this case. So, even with GLES3 explicitly check for 585 // <format> in this case. So, even with GLES3 explicitly check for
586 // GL_EXT_sRGB. 586 // GL_EXT_sRGB.
587 if ((((gl_version_info_->is_es3 || 587 if ((((gl_version_info_->is_es3 ||
588 extensions.Contains("GL_OES_rgb8_rgba8")) && 588 extensions.Contains("GL_OES_rgb8_rgba8")) &&
589 extensions.Contains("GL_EXT_sRGB")) || 589 extensions.Contains("GL_EXT_sRGB")) ||
590 feature_flags_.desktop_srgb_support) && 590 feature_flags_.desktop_srgb_support) &&
591 IsWebGL1OrES2Context()) { 591 IsWebGL1OrES2Context()) {
592 feature_flags_.ext_srgb = true;
592 AddExtensionString("GL_EXT_sRGB"); 593 AddExtensionString("GL_EXT_sRGB");
593 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); 594 validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
594 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 595 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
595 validators_.texture_format.AddValue(GL_SRGB_EXT); 596 validators_.texture_format.AddValue(GL_SRGB_EXT);
596 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); 597 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT);
597 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); 598 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT);
598 validators_.framebuffer_parameter.AddValue( 599 validators_.framebuffer_parameter.AddValue(
599 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); 600 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
600 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT); 601 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT);
601 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 602 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 if (pos == std::string::npos) { 1547 if (pos == std::string::npos) {
1547 extensions_ += (extensions_.empty() ? "" : " ") + str; 1548 extensions_ += (extensions_.empty() ? "" : " ") + str;
1548 } 1549 }
1549 } 1550 }
1550 1551
1551 FeatureInfo::~FeatureInfo() { 1552 FeatureInfo::~FeatureInfo() {
1552 } 1553 }
1553 1554
1554 } // namespace gles2 1555 } // namespace gles2
1555 } // namespace gpu 1556 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698