summaryrefslogtreecommitdiffstats
path: root/opengl/libagl
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-03 19:00:53 -0700
committerMathias Agopian <mathias@google.com>2009-06-03 19:00:53 -0700
commit36432ccc13f6d3db7af35661683c33ffa3406d85 (patch)
treeb4914f730d346ae626a43cd51514fec83bd55661 /opengl/libagl
parent4098d78b3507bfecce9f7a8a4b5d334c7842ff88 (diff)
downloadframeworks_base-36432ccc13f6d3db7af35661683c33ffa3406d85.zip
frameworks_base-36432ccc13f6d3db7af35661683c33ffa3406d85.tar.gz
frameworks_base-36432ccc13f6d3db7af35661683c33ffa3406d85.tar.bz2
make sure clear the draw and read EGLSurface when eglMakeCurrent() is called for unbinding from the thread
Diffstat (limited to 'opengl/libagl')
-rw-r--r--opengl/libagl/egl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp
index f50257a..0df2bba 100644
--- a/opengl/libagl/egl.cpp
+++ b/opengl/libagl/egl.cpp
@@ -384,7 +384,7 @@ void egl_window_surface_v2_t::connect()
void egl_window_surface_v2_t::disconnect()
{
- if (buffer) {
+ if (buffer && bits) {
bits = NULL;
unlock(buffer);
}
@@ -1681,10 +1681,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw,
egl_surface_t* d = (egl_surface_t*)c->draw;
egl_surface_t* r = (egl_surface_t*)c->read;
if (d) {
+ c->draw = 0;
d->ctx = EGL_NO_CONTEXT;
d->disconnect();
}
if (r) {
+ c->read = 0;
r->ctx = EGL_NO_CONTEXT;
// FIXME: unlock/disconnect the read surface too
}