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

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

Issue 1426903002: gpu: Make glTexSubImage2D work with GL_SRGB_ALPHA on OpenGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove an unneeded hunk now that workarounds are used Created 5 years, 1 month 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
« no previous file with comments | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 AddExtensionString("GL_OES_element_index_uint"); 494 AddExtensionString("GL_OES_element_index_uint");
495 validators_.index_type.AddValue(GL_UNSIGNED_INT); 495 validators_.index_type.AddValue(GL_UNSIGNED_INT);
496 } 496 }
497 497
498 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the 498 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the
499 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support 499 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support
500 // for SRGB Textures but the accepted internal formats for TexImage2D are only 500 // for SRGB Textures but the accepted internal formats for TexImage2D are only
501 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid 501 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid
502 // <format> in this case. So, even with GLES3 explicitly check for 502 // <format> in this case. So, even with GLES3 explicitly check for
503 // GL_EXT_sRGB. 503 // GL_EXT_sRGB.
504 if (((gl_version_info_->is_es3 || 504 if (!workarounds_.disable_ext_srgb &&
505 extensions.Contains("GL_OES_rgb8_rgba8")) && 505 (((gl_version_info_->is_es3 ||
506 extensions.Contains("GL_EXT_sRGB")) || gfx::HasDesktopGLFeatures()) { 506 extensions.Contains("GL_OES_rgb8_rgba8")) &&
507 extensions.Contains("GL_EXT_sRGB")) || gfx::HasDesktopGLFeatures())) {
507 AddExtensionString("GL_EXT_sRGB"); 508 AddExtensionString("GL_EXT_sRGB");
508 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); 509 validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
509 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 510 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
510 validators_.texture_format.AddValue(GL_SRGB_EXT); 511 validators_.texture_format.AddValue(GL_SRGB_EXT);
511 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); 512 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT);
512 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); 513 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT);
513 validators_.frame_buffer_parameter.AddValue( 514 validators_.frame_buffer_parameter.AddValue(
514 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); 515 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
515 } 516 }
516 517
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 if (pos == std::string::npos) { 1238 if (pos == std::string::npos) {
1238 extensions_ += (extensions_.empty() ? "" : " ") + str; 1239 extensions_ += (extensions_.empty() ? "" : " ") + str;
1239 } 1240 }
1240 } 1241 }
1241 1242
1242 FeatureInfo::~FeatureInfo() { 1243 FeatureInfo::~FeatureInfo() {
1243 } 1244 }
1244 1245
1245 } // namespace gles2 1246 } // namespace gles2
1246 } // namespace gpu 1247 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/BUILD.gn ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698