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