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

Side by Side Diff: ui/gl/gl_fence.cc

Issue 2170293002: Use GLVersionInfo instead of gl::GetGLImplementation() to decide GL paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 5 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
« no previous file with comments | « ui/gl/gl_context_cgl.cc ('k') | ui/gl/gl_gl_api_implementation.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 "ui/gl/gl_fence.h" 5 #include "ui/gl/gl_fence.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_context.h" 10 #include "ui/gl/gl_context.h"
(...skipping 12 matching lines...) Expand all
23 23
24 GLFence::GLFence() { 24 GLFence::GLFence() {
25 } 25 }
26 26
27 GLFence::~GLFence() { 27 GLFence::~GLFence() {
28 } 28 }
29 29
30 bool GLFence::IsSupported() { 30 bool GLFence::IsSupported() {
31 DCHECK(GetGLVersionInfo()); 31 DCHECK(GetGLVersionInfo());
32 return g_driver_gl.ext.b_GL_ARB_sync || GetGLVersionInfo()->is_es3 || 32 return g_driver_gl.ext.b_GL_ARB_sync || GetGLVersionInfo()->is_es3 ||
33 GetGLImplementation() == kGLImplementationDesktopGLCoreProfile || 33 GetGLVersionInfo()->is_desktop_core_profile ||
34 #if defined(OS_MACOSX) 34 #if defined(OS_MACOSX)
35 g_driver_gl.ext.b_GL_APPLE_fence || 35 g_driver_gl.ext.b_GL_APPLE_fence ||
36 #else 36 #else
37 g_driver_egl.ext.b_EGL_KHR_fence_sync || 37 g_driver_egl.ext.b_EGL_KHR_fence_sync ||
38 #endif 38 #endif
39 g_driver_gl.ext.b_GL_NV_fence; 39 g_driver_gl.ext.b_GL_NV_fence;
40 } 40 }
41 41
42 GLFence* GLFence::Create() { 42 GLFence* GLFence::Create() {
43 DCHECK(GLContext::GetCurrent()) 43 DCHECK(GLContext::GetCurrent())
44 << "Trying to create fence with no context"; 44 << "Trying to create fence with no context";
45 45
46 std::unique_ptr<GLFence> fence; 46 std::unique_ptr<GLFence> fence;
47 #if !defined(OS_MACOSX) 47 #if !defined(OS_MACOSX)
48 if (g_driver_egl.ext.b_EGL_KHR_fence_sync && 48 if (g_driver_egl.ext.b_EGL_KHR_fence_sync &&
49 g_driver_egl.ext.b_EGL_KHR_wait_sync) { 49 g_driver_egl.ext.b_EGL_KHR_wait_sync) {
50 // Prefer GLFenceEGL which doesn't require GL context switching. 50 // Prefer GLFenceEGL which doesn't require GL context switching.
51 fence.reset(new GLFenceEGL); 51 fence.reset(new GLFenceEGL);
52 } else 52 } else
53 #endif 53 #endif
54 if (g_driver_gl.ext.b_GL_ARB_sync || GetGLVersionInfo()->is_es3 || 54 if (g_driver_gl.ext.b_GL_ARB_sync || GetGLVersionInfo()->is_es3 ||
55 GetGLImplementation() == kGLImplementationDesktopGLCoreProfile) { 55 GetGLVersionInfo()->is_desktop_core_profile) {
56 // Prefer ARB_sync which supports server-side wait. 56 // Prefer ARB_sync which supports server-side wait.
57 fence.reset(new GLFenceARB); 57 fence.reset(new GLFenceARB);
58 #if defined(OS_MACOSX) 58 #if defined(OS_MACOSX)
59 } else if (g_driver_gl.ext.b_GL_APPLE_fence) { 59 } else if (g_driver_gl.ext.b_GL_APPLE_fence) {
60 fence.reset(new GLFenceAPPLE); 60 fence.reset(new GLFenceAPPLE);
61 #else 61 #else
62 } else if (g_driver_egl.ext.b_EGL_KHR_fence_sync) { 62 } else if (g_driver_egl.ext.b_EGL_KHR_fence_sync) {
63 fence.reset(new GLFenceEGL); 63 fence.reset(new GLFenceEGL);
64 #endif 64 #endif
65 } else if (g_driver_gl.ext.b_GL_NV_fence) { 65 } else if (g_driver_gl.ext.b_GL_NV_fence) {
(...skipping 11 matching lines...) Expand all
77 77
78 void GLFence::ResetState() { 78 void GLFence::ResetState() {
79 NOTIMPLEMENTED(); 79 NOTIMPLEMENTED();
80 } 80 }
81 81
82 void GLFence::Invalidate() { 82 void GLFence::Invalidate() {
83 NOTIMPLEMENTED(); 83 NOTIMPLEMENTED();
84 } 84 }
85 85
86 } // namespace gl 86 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_context_cgl.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698