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

Unified Diff: ui/gl/gl_context_osmesa.cc

Issue 221433004: gpu: Bind dummy GL API when no context is current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix two gpu unittests Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context_nsview.mm ('k') | ui/gl/gl_context_wgl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context_osmesa.cc
diff --git a/ui/gl/gl_context_osmesa.cc b/ui/gl/gl_context_osmesa.cc
index e7ccba99039c116727f7c9f4061ad6adea717c0e..524fe42bb1716d110999e3321ea658be28cfae1b 100644
--- a/ui/gl/gl_context_osmesa.cc
+++ b/ui/gl/gl_context_osmesa.cc
@@ -52,6 +52,7 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) {
gfx::Size size = surface->GetSize();
+ ScopedReleaseCurrent release_current;
if (!OSMesaMakeCurrent(context_,
surface->GetHandle(),
GL_UNSIGNED_BYTE,
@@ -70,7 +71,6 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) {
SetCurrent(surface);
if (!InitializeDynamicBindings()) {
- ReleaseCurrent(surface);
return false;
}
@@ -79,6 +79,7 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) {
return false;
}
+ release_current.Cancel();
return true;
}
@@ -87,6 +88,7 @@ void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) {
return;
SetCurrent(NULL);
+ // TODO: Calling with NULL here does not work to release the context.
OSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0);
}
« no previous file with comments | « ui/gl/gl_context_nsview.mm ('k') | ui/gl/gl_context_wgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698