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

Unified Diff: ui/gfx/gl/gl_surface_egl.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 | « no previous file | ui/gfx/gl/gl_surface_osmesa.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_surface_egl.cc
===================================================================
--- ui/gfx/gl/gl_surface_egl.cc (revision 113398)
+++ ui/gfx/gl/gl_surface_egl.cc (working copy)
@@ -12,6 +12,7 @@
#include "third_party/angle/include/EGL/eglext.h"
#endif
#include "ui/gfx/gl/egl_util.h"
+#include "ui/gfx/gl/gl_context.h"
#if defined(OS_ANDROID)
#include <EGL/egl.h>
@@ -357,9 +358,22 @@
if (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);
+
Destroy();
+
size_ = size;
- return Initialize();
+
+ if (!Initialize())
+ return false;
+
+ if (was_current)
+ return current_context->MakeCurrent(this);
+
+ return true;
}
EGLSurface PbufferGLSurfaceEGL::GetHandle() {
« no previous file with comments | « no previous file | ui/gfx/gl/gl_surface_osmesa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698