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

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

Issue 11266023: Make GL calls go through subclassable class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « ui/gl/gl_egl_api_implementation.cc ('k') | ui/gl/gl_gl_api_implementation.h » ('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 "ui/gl/gl_bindings.h" 8 #include "ui/gl/gl_bindings.h"
9 #include "ui/gl/gl_context.h" 9 #include "ui/gl/gl_context.h"
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 namespace gfx { 75 namespace gfx {
76 76
77 GLFence::GLFence() { 77 GLFence::GLFence() {
78 } 78 }
79 79
80 GLFence::~GLFence() { 80 GLFence::~GLFence() {
81 } 81 }
82 82
83 // static 83 // static
84 GLFence* GLFence::Create() { 84 GLFence* GLFence::Create() {
85 if (gfx::g_GL_NV_fence) { 85 if (gfx::g_driver_gl.ext.b_GL_NV_fence) {
86 return new GLFenceNVFence(); 86 return new GLFenceNVFence();
87 } else if (gfx::g_GL_ARB_sync) { 87 } else if (gfx::g_driver_gl.ext.b_GL_ARB_sync) {
88 return new GLFenceARBSync(); 88 return new GLFenceARBSync();
89 } else { 89 } else {
90 return NULL; 90 return NULL;
91 } 91 }
92 } 92 }
93 93
94 // static 94 // static
95 bool GLFence::IsContextLost() { 95 bool GLFence::IsContextLost() {
96 if (!gfx::g_GL_ARB_robustness && !gfx::g_GL_EXT_robustness) 96 if (!gfx::g_driver_gl.ext.b_GL_ARB_robustness &&
97 !gfx::g_driver_gl.ext.b_GL_EXT_robustness)
97 return false; 98 return false;
98 99
99 if (!gfx::GLContext::GetCurrent() || 100 if (!gfx::GLContext::GetCurrent() ||
100 !gfx::GLContext::GetCurrent()-> 101 !gfx::GLContext::GetCurrent()->
101 WasAllocatedUsingRobustnessExtension()) 102 WasAllocatedUsingRobustnessExtension())
102 return false; 103 return false;
103 104
104 GLenum status = glGetGraphicsResetStatusARB(); 105 GLenum status = glGetGraphicsResetStatusARB();
105 return status != GL_NO_ERROR; 106 return status != GL_NO_ERROR;
106 } 107 }
107 108
108 } // namespace gfx 109 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_egl_api_implementation.cc ('k') | ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698