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

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

Issue 1881883002: SRGB_EXT is a valid format of texture in WebGL1.0 and ES2.0 contexts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address ken's comment: shrink the context range Created 4 years, 7 months 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 | « no previous file | gpu/command_buffer/service/texture_manager.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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 AddExtensionString("GL_OES_element_index_uint"); 535 AddExtensionString("GL_OES_element_index_uint");
536 validators_.index_type.AddValue(GL_UNSIGNED_INT); 536 validators_.index_type.AddValue(GL_UNSIGNED_INT);
537 } 537 }
538 538
539 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the 539 // With EXT_sRGB, unsized SRGB_EXT and SRGB_ALPHA_EXT are accepted by the
540 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support 540 // <format> and <internalformat> parameter of TexImage2D. GLES3 adds support
541 // for SRGB Textures but the accepted internal formats for TexImage2D are only 541 // for SRGB Textures but the accepted internal formats for TexImage2D are only
542 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid 542 // sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid
543 // <format> in this case. So, even with GLES3 explicitly check for 543 // <format> in this case. So, even with GLES3 explicitly check for
544 // GL_EXT_sRGB. 544 // GL_EXT_sRGB.
545 if (((gl_version_info_->is_es3 || extensions.Contains("GL_OES_rgb8_rgba8")) && 545 if ((((gl_version_info_->is_es3 ||
546 extensions.Contains("GL_EXT_sRGB")) || 546 extensions.Contains("GL_OES_rgb8_rgba8")) &&
547 gfx::HasDesktopGLFeatures()) { 547 extensions.Contains("GL_EXT_sRGB")) ||
548 gfx::HasDesktopGLFeatures()) &&
549 (context_type_ == CONTEXT_TYPE_WEBGL1 ||
550 context_type_ == CONTEXT_TYPE_OPENGLES2)) {
548 AddExtensionString("GL_EXT_sRGB"); 551 AddExtensionString("GL_EXT_sRGB");
549 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); 552 validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
550 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 553 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
551 validators_.texture_format.AddValue(GL_SRGB_EXT); 554 validators_.texture_format.AddValue(GL_SRGB_EXT);
552 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); 555 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT);
553 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); 556 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT);
554 validators_.frame_buffer_parameter.AddValue( 557 validators_.frame_buffer_parameter.AddValue(
555 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); 558 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
559 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT);
556 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 560 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
557 } 561 }
558 562
559 bool enable_texture_format_bgra8888 = false; 563 bool enable_texture_format_bgra8888 = false;
560 bool enable_read_format_bgra = false; 564 bool enable_read_format_bgra = false;
561 bool enable_render_buffer_bgra = false; 565 bool enable_render_buffer_bgra = false;
562 bool enable_immutable_texture_format_bgra_on_es3 = 566 bool enable_immutable_texture_format_bgra_on_es3 =
563 extensions.Contains("GL_APPLE_texture_format_BGRA8888"); 567 extensions.Contains("GL_APPLE_texture_format_BGRA8888");
564 568
565 // Check if we should allow GL_EXT_texture_format_BGRA8888. 569 // Check if we should allow GL_EXT_texture_format_BGRA8888.
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 if (pos == std::string::npos) { 1371 if (pos == std::string::npos) {
1368 extensions_ += (extensions_.empty() ? "" : " ") + str; 1372 extensions_ += (extensions_.empty() ? "" : " ") + str;
1369 } 1373 }
1370 } 1374 }
1371 1375
1372 FeatureInfo::~FeatureInfo() { 1376 FeatureInfo::~FeatureInfo() {
1373 } 1377 }
1374 1378
1375 } // namespace gles2 1379 } // namespace gles2
1376 } // namespace gpu 1380 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698