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

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: Correct texture format parameter 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
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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 extensions.Contains("GL_EXT_sRGB")) || 546 extensions.Contains("GL_EXT_sRGB")) ||
547 gfx::HasDesktopGLFeatures()) { 547 gfx::HasDesktopGLFeatures()) {
548 AddExtensionString("GL_EXT_sRGB"); 548 AddExtensionString("GL_EXT_sRGB");
549 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); 549 validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
550 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 550 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
551 validators_.texture_format.AddValue(GL_SRGB_EXT); 551 validators_.texture_format.AddValue(GL_SRGB_EXT);
552 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); 552 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT);
553 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); 553 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT);
554 validators_.frame_buffer_parameter.AddValue( 554 validators_.frame_buffer_parameter.AddValue(
555 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); 555 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT);
556 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); 556 if (context_type_ == CONTEXT_TYPE_WEBGL1 ||
557 context_type_ == CONTEXT_TYPE_OPENGLES2) {
Zhenyao Mo 2016/04/27 17:12:26 This should be part of the "if" condition in line
xinghua.cao 2016/04/28 09:59:27 Done.
558 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_EXT);
559 validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
560 }
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.
566 if (extensions.Contains("GL_EXT_texture_format_BGRA8888") || 570 if (extensions.Contains("GL_EXT_texture_format_BGRA8888") ||
(...skipping 800 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/gles2_cmd_decoder.cc » ('j') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698