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

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

Issue 10822029: Use EXT_robustness where available on GLES2 platforms to detect and respond to resets of the graphi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed GL interface mock. Created 8 years, 4 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return new GLFenceNVFence(); 86 return new GLFenceNVFence();
87 } else if (gfx::g_GL_ARB_sync) { 87 } else if (gfx::g_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) 96 if (!gfx::g_GL_ARB_robustness && !gfx::g_GL_EXT_robustness)
97 return false; 97 return false;
98 98
99 if (!gfx::GLContext::GetCurrent() || 99 if (!gfx::GLContext::GetCurrent() ||
100 !gfx::GLContext::GetCurrent()-> 100 !gfx::GLContext::GetCurrent()->
101 WasAllocatedUsingARBRobustness()) 101 WasAllocatedUsingRobustnessExtension())
102 return false; 102 return false;
103 103
104 GLenum status = glGetGraphicsResetStatusARB(); 104 GLenum status;
105 if (gfx::g_GL_ARB_robustness)
106 status = glGetGraphicsResetStatusARB();
apatrick_chromium 2012/07/26 22:12:38 Ditto.
107 else
108 status = glGetGraphicsResetStatusEXT();
105 return status != GL_NO_ERROR; 109 return status != GL_NO_ERROR;
106 } 110 }
107 111
108 } // namespace gfx 112 } // namespace gfx
OLDNEW
« ui/gl/generate_bindings.py ('K') | « ui/gl/gl_context_glx.cc ('k') | ui/gl/gl_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698