Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 331293003: Add common GLFence::IsSupported() check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_fence.h"
17 #include "ui/gl/gl_implementation.h" 18 #include "ui/gl/gl_implementation.h"
18 19
19 namespace gpu { 20 namespace gpu {
20 namespace gles2 { 21 namespace gles2 {
21 22
22 namespace { 23 namespace {
23 24
24 struct FormatInfo { 25 struct FormatInfo {
25 GLenum format; 26 GLenum format;
26 const GLenum* types; 27 const GLenum* types;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 AddExtensionString("GL_EXT_frag_depth"); 783 AddExtensionString("GL_EXT_frag_depth");
783 feature_flags_.ext_frag_depth = true; 784 feature_flags_.ext_frag_depth = true;
784 } 785 }
785 786
786 if (extensions.Contains("GL_EXT_shader_texture_lod") || 787 if (extensions.Contains("GL_EXT_shader_texture_lod") ||
787 gfx::HasDesktopGLFeatures()) { 788 gfx::HasDesktopGLFeatures()) {
788 AddExtensionString("GL_EXT_shader_texture_lod"); 789 AddExtensionString("GL_EXT_shader_texture_lod");
789 feature_flags_.ext_shader_texture_lod = true; 790 feature_flags_.ext_shader_texture_lod = true;
790 } 791 }
791 792
792 bool egl_khr_fence_sync = false;
793 #if !defined(OS_MACOSX) 793 #if !defined(OS_MACOSX)
794 if (workarounds_.disable_egl_khr_fence_sync) { 794 if (workarounds_.disable_egl_khr_fence_sync) {
795 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false; 795 gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync = false;
796 } 796 }
797 egl_khr_fence_sync = gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync;
798 #endif 797 #endif
799 if (workarounds_.disable_arb_sync) 798 if (workarounds_.disable_arb_sync)
800 gfx::g_driver_gl.ext.b_GL_ARB_sync = false; 799 gfx::g_driver_gl.ext.b_GL_ARB_sync = false;
801 bool ui_gl_fence_works = is_es3 || extensions.Contains("GL_NV_fence") || 800 bool ui_gl_fence_works = gfx::GLFence::IsSupported();
802 gfx::g_driver_gl.ext.b_GL_ARB_sync ||
803 egl_khr_fence_sync;
804 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works); 801 UMA_HISTOGRAM_BOOLEAN("GPU.FenceSupport", ui_gl_fence_works);
805 802
806 feature_flags_.map_buffer_range = 803 feature_flags_.map_buffer_range =
807 is_es3 || extensions.Contains("GL_ARB_map_buffer_range"); 804 is_es3 || extensions.Contains("GL_ARB_map_buffer_range");
808 805
809 // Really it's part of core OpenGL 2.1 and up, but let's assume the 806 // Really it's part of core OpenGL 2.1 and up, but let's assume the
810 // extension is still advertised. 807 // extension is still advertised.
811 bool has_pixel_buffers = 808 bool has_pixel_buffers =
812 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object"); 809 is_es3 || extensions.Contains("GL_ARB_pixel_buffer_object");
813 810
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 if (pos == std::string::npos) { 844 if (pos == std::string::npos) {
848 extensions_ += (extensions_.empty() ? "" : " ") + str; 845 extensions_ += (extensions_.empty() ? "" : " ") + str;
849 } 846 }
850 } 847 }
851 848
852 FeatureInfo::~FeatureInfo() { 849 FeatureInfo::~FeatureInfo() {
853 } 850 }
854 851
855 } // namespace gles2 852 } // namespace gles2
856 } // namespace gpu 853 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698