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

Unified Diff: ui/gfx/gl/gl_surface_osmesa.cc

Issue 8869007: GLSurface::Resize implementations release the current context if they are current before resize. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years 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/gfx/gl/gl_surface_egl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_surface_osmesa.cc
===================================================================
--- ui/gfx/gl/gl_surface_osmesa.cc (revision 113398)
+++ ui/gfx/gl/gl_surface_osmesa.cc (working copy)
@@ -5,6 +5,7 @@
#include "ui/gfx/gl/gl_surface_osmesa.h"
#include "base/logging.h"
#include "ui/gfx/gl/gl_bindings.h"
+#include "ui/gfx/gl/gl_context.h"
namespace gfx {
@@ -21,6 +22,11 @@
if (new_size == size_)
return true;
+ GLContext* current_context = GLContext::GetCurrent();
+ bool was_current = current_context && current_context->IsCurrent(this);
+ if (was_current)
+ current_context->ReleaseCurrent(this);
+
// Preserve the old buffer.
scoped_array<int32> old_buffer(buffer_.release());
@@ -37,6 +43,10 @@
}
size_ = new_size;
+
+ if (was_current)
+ return current_context->MakeCurrent(this);
+
return true;
}
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698