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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 if (workarounds_.use_client_side_arrays_for_stream_buffers) { | 386 if (workarounds_.use_client_side_arrays_for_stream_buffers) { |
387 feature_flags_.native_vertex_array_object = false; | 387 feature_flags_.native_vertex_array_object = false; |
388 } | 388 } |
389 | 389 |
390 if (is_es3 || extensions.Contains("GL_OES_element_index_uint") || | 390 if (is_es3 || extensions.Contains("GL_OES_element_index_uint") || |
391 gfx::HasDesktopGLFeatures()) { | 391 gfx::HasDesktopGLFeatures()) { |
392 AddExtensionString("GL_OES_element_index_uint"); | 392 AddExtensionString("GL_OES_element_index_uint"); |
393 validators_.index_type.AddValue(GL_UNSIGNED_INT); | 393 validators_.index_type.AddValue(GL_UNSIGNED_INT); |
394 } | 394 } |
395 | 395 |
| 396 if (is_es3 || extensions.Contains("GL_EXT_sRGB") || |
| 397 gfx::HasDesktopGLFeatures()) { |
| 398 AddExtensionString("GL_EXT_sRGB"); |
| 399 texture_format_validators_[GL_SRGB_EXT].AddValue(GL_UNSIGNED_BYTE); |
| 400 texture_format_validators_[GL_SRGB_ALPHA_EXT].AddValue(GL_UNSIGNED_BYTE); |
| 401 validators_.texture_internal_format.AddValue(GL_SRGB_EXT); |
| 402 validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 403 validators_.texture_format.AddValue(GL_SRGB_EXT); |
| 404 validators_.texture_format.AddValue(GL_SRGB_ALPHA_EXT); |
| 405 validators_.render_buffer_format.AddValue(GL_SRGB8_ALPHA8_EXT); |
| 406 validators_.frame_buffer_parameter.AddValue( |
| 407 GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT); |
| 408 } |
| 409 |
396 bool enable_texture_format_bgra8888 = false; | 410 bool enable_texture_format_bgra8888 = false; |
397 bool enable_read_format_bgra = false; | 411 bool enable_read_format_bgra = false; |
398 bool enable_render_buffer_bgra = false; | 412 bool enable_render_buffer_bgra = false; |
399 bool enable_immutable_texture_format_bgra_on_es3 = | 413 bool enable_immutable_texture_format_bgra_on_es3 = |
400 extensions.Contains("GL_APPLE_texture_format_BGRA8888"); | 414 extensions.Contains("GL_APPLE_texture_format_BGRA8888"); |
401 | 415 |
402 // Check if we should allow GL_EXT_texture_format_BGRA8888 | 416 // Check if we should allow GL_EXT_texture_format_BGRA8888 |
403 if (extensions.Contains("GL_EXT_texture_format_BGRA8888") || | 417 if (extensions.Contains("GL_EXT_texture_format_BGRA8888") || |
404 enable_immutable_texture_format_bgra_on_es3 || | 418 enable_immutable_texture_format_bgra_on_es3 || |
405 extensions.Contains("GL_EXT_bgra")) { | 419 extensions.Contains("GL_EXT_bgra")) { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 if (pos == std::string::npos) { | 902 if (pos == std::string::npos) { |
889 extensions_ += (extensions_.empty() ? "" : " ") + str; | 903 extensions_ += (extensions_.empty() ? "" : " ") + str; |
890 } | 904 } |
891 } | 905 } |
892 | 906 |
893 FeatureInfo::~FeatureInfo() { | 907 FeatureInfo::~FeatureInfo() { |
894 } | 908 } |
895 | 909 |
896 } // namespace gles2 | 910 } // namespace gles2 |
897 } // namespace gpu | 911 } // namespace gpu |
OLD | NEW |