OLD | NEW |
---|---|
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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 validators_.render_buffer_format.AddValue(GL_BGRA8_EXT); | 516 validators_.render_buffer_format.AddValue(GL_BGRA8_EXT); |
517 } | 517 } |
518 | 518 |
519 if (extensions.Contains("GL_OES_rgb8_rgba8") || gfx::HasDesktopGLFeatures()) { | 519 if (extensions.Contains("GL_OES_rgb8_rgba8") || gfx::HasDesktopGLFeatures()) { |
520 AddExtensionString("GL_OES_rgb8_rgba8"); | 520 AddExtensionString("GL_OES_rgb8_rgba8"); |
521 validators_.render_buffer_format.AddValue(GL_RGB8_OES); | 521 validators_.render_buffer_format.AddValue(GL_RGB8_OES); |
522 validators_.render_buffer_format.AddValue(GL_RGBA8_OES); | 522 validators_.render_buffer_format.AddValue(GL_RGBA8_OES); |
523 } | 523 } |
524 | 524 |
525 // Check if we should allow GL_OES_texture_npot | 525 // Check if we should allow GL_OES_texture_npot |
526 if (gl_version_info_->is_es3 || | 526 if (!disallowed_features_.npot_support && |
Zhenyao Mo
2015/06/07 21:42:11
This is where we disable NPOT support for WebGL 1.
| |
527 gl_version_info_->is_desktop_core_profile || | 527 (gl_version_info_->is_es3 || |
528 extensions.Contains("GL_ARB_texture_non_power_of_two") || | 528 gl_version_info_->is_desktop_core_profile || |
529 extensions.Contains("GL_OES_texture_npot")) { | 529 extensions.Contains("GL_ARB_texture_non_power_of_two") || |
530 extensions.Contains("GL_OES_texture_npot"))) { | |
530 AddExtensionString("GL_OES_texture_npot"); | 531 AddExtensionString("GL_OES_texture_npot"); |
531 feature_flags_.npot_ok = true; | 532 feature_flags_.npot_ok = true; |
532 } | 533 } |
533 | 534 |
534 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, | 535 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, |
535 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear | 536 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear |
536 bool enable_texture_float = false; | 537 bool enable_texture_float = false; |
537 bool enable_texture_float_linear = false; | 538 bool enable_texture_float_linear = false; |
538 bool enable_texture_half_float = false; | 539 bool enable_texture_half_float = false; |
539 bool enable_texture_half_float_linear = false; | 540 bool enable_texture_half_float_linear = false; |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1138 if (pos == std::string::npos) { | 1139 if (pos == std::string::npos) { |
1139 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1140 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1140 } | 1141 } |
1141 } | 1142 } |
1142 | 1143 |
1143 FeatureInfo::~FeatureInfo() { | 1144 FeatureInfo::~FeatureInfo() { |
1144 } | 1145 } |
1145 | 1146 |
1146 } // namespace gles2 | 1147 } // namespace gles2 |
1147 } // namespace gpu | 1148 } // namespace gpu |
OLD | NEW |