| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "gpu/command_buffer/service/gl_utils.h" | 15 #include "gpu/command_buffer/service/gl_utils.h" |
| 16 #include "gpu/command_buffer/service/gpu_switches.h" | 16 #include "gpu/command_buffer/service/gpu_switches.h" |
| 17 #include "ui/gl/gl_implementation.h" | 17 #include "ui/gl/gl_implementation.h" |
| 18 | 18 |
| 19 #if defined(OS_MACOSX) | |
| 20 #include "ui/gl/io_surface_support_mac.h" | |
| 21 #endif | |
| 22 | |
| 23 namespace gpu { | 19 namespace gpu { |
| 24 namespace gles2 { | 20 namespace gles2 { |
| 25 | 21 |
| 26 namespace { | 22 namespace { |
| 27 | 23 |
| 28 struct FormatInfo { | 24 struct FormatInfo { |
| 29 GLenum format; | 25 GLenum format; |
| 30 const GLenum* types; | 26 const GLenum* types; |
| 31 size_t count; | 27 size_t count; |
| 32 }; | 28 }; |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 // For the moment we don't add this enum to the texture_target | 659 // For the moment we don't add this enum to the texture_target |
| 664 // validator. This implies that the only way to get image data into a | 660 // validator. This implies that the only way to get image data into a |
| 665 // rectangular texture is via glTexImageIOSurface2DCHROMIUM, which is | 661 // rectangular texture is via glTexImageIOSurface2DCHROMIUM, which is |
| 666 // just fine since again we don't want applications depending on this | 662 // just fine since again we don't want applications depending on this |
| 667 // extension. | 663 // extension. |
| 668 validators_.get_tex_param_target.AddValue(GL_TEXTURE_RECTANGLE_ARB); | 664 validators_.get_tex_param_target.AddValue(GL_TEXTURE_RECTANGLE_ARB); |
| 669 validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_RECTANGLE_ARB); | 665 validators_.g_l_state.AddValue(GL_TEXTURE_BINDING_RECTANGLE_ARB); |
| 670 } | 666 } |
| 671 | 667 |
| 672 #if defined(OS_MACOSX) | 668 #if defined(OS_MACOSX) |
| 673 if (IOSurfaceSupport::Initialize()) { | 669 AddExtensionString("GL_CHROMIUM_iosurface"); |
| 674 AddExtensionString("GL_CHROMIUM_iosurface"); | |
| 675 } | |
| 676 #endif | 670 #endif |
| 677 | 671 |
| 678 // TODO(gman): Add support for these extensions. | 672 // TODO(gman): Add support for these extensions. |
| 679 // GL_OES_depth32 | 673 // GL_OES_depth32 |
| 680 | 674 |
| 681 feature_flags_.enable_texture_float_linear |= enable_texture_float_linear; | 675 feature_flags_.enable_texture_float_linear |= enable_texture_float_linear; |
| 682 feature_flags_.enable_texture_half_float_linear |= | 676 feature_flags_.enable_texture_half_float_linear |= |
| 683 enable_texture_half_float_linear; | 677 enable_texture_half_float_linear; |
| 684 feature_flags_.npot_ok |= npot_ok; | 678 feature_flags_.npot_ok |= npot_ok; |
| 685 | 679 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 if (pos == std::string::npos) { | 847 if (pos == std::string::npos) { |
| 854 extensions_ += (extensions_.empty() ? "" : " ") + str; | 848 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 855 } | 849 } |
| 856 } | 850 } |
| 857 | 851 |
| 858 FeatureInfo::~FeatureInfo() { | 852 FeatureInfo::~FeatureInfo() { |
| 859 } | 853 } |
| 860 | 854 |
| 861 } // namespace gles2 | 855 } // namespace gles2 |
| 862 } // namespace gpu | 856 } // namespace gpu |
| OLD | NEW |