| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 if (workarounds_.disable_egl_khr_fence_sync) { | 848 if (workarounds_.disable_egl_khr_fence_sync) { |
| 849 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false; | 849 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false; |
| 850 } | 850 } |
| 851 #endif | 851 #endif |
| 852 if (workarounds_.disable_arb_sync) | 852 if (workarounds_.disable_arb_sync) |
| 853 gfx::g_driver_gl.ext.b_GL_ARB_sync = false; | 853 gfx::g_driver_gl.ext.b_GL_ARB_sync = false; |
| 854 bool ui_gl_fence_works = gfx::GLFence::IsSupported(); | 854 bool ui_gl_fence_works = gfx::GLFence::IsSupported(); |
| 855 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works); | 855 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works); |
| 856 | 856 |
| 857 feature_flags_.map_buffer_range = | 857 feature_flags_.map_buffer_range = |
| 858 is_es3 || extensions.Contains("GL_ARB_map_buffer_range"); | 858 is_es3 || extensions.Contains("GL_ARB_map_buffer_range") || |
| 859 extensions.Contains("GL_EXT_map_buffer_range"); |
| 859 | 860 |
| 860 // Really it's part of core OpenGL 2.1 and up, but let's assume the | 861 // Really it's part of core OpenGL 2.1 and up, but let's assume the |
| 861 // extension is still advertised. | 862 // extension is still advertised. |
| 862 bool has_pixel_buffers = | 863 bool has_pixel_buffers = |
| 863 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object"); | 864 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object") || |
| 865 extensions.Contains("GL_NV_pixel_buffer_object"); |
| 864 | 866 |
| 865 // We will use either glMapBuffer() or glMapBufferRange() for async readbacks. | 867 // We will use either glMapBuffer() or glMapBufferRange() for async readbacks. |
| 866 if (has_pixel_buffers && ui_gl_fence_works && | 868 if (has_pixel_buffers && ui_gl_fence_works && |
| 867 !workarounds_.disable_async_readpixels) { | 869 !workarounds_.disable_async_readpixels) { |
| 868 feature_flags_.use_async_readpixels = true; | 870 feature_flags_.use_async_readpixels = true; |
| 869 } | 871 } |
| 870 | 872 |
| 871 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { | 873 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { |
| 872 feature_flags_.enable_samplers = true; | 874 feature_flags_.enable_samplers = true; |
| 873 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 875 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 if (pos == std::string::npos) { | 944 if (pos == std::string::npos) { |
| 943 extensions_ += (extensions_.empty() ? "" : " ") + str; | 945 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 944 } | 946 } |
| 945 } | 947 } |
| 946 | 948 |
| 947 FeatureInfo::~FeatureInfo() { | 949 FeatureInfo::~FeatureInfo() { |
| 948 } | 950 } |
| 949 | 951 |
| 950 } // namespace gles2 | 952 } // namespace gles2 |
| 951 } // namespace gpu | 953 } // namespace gpu |
| OLD | NEW |