summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--opengl/java/android/opengl/GLSurfaceView.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index 3f547fd..4c7f84e 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -1073,6 +1073,15 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
return gl;
}
+ public void purgeBuffers() {
+ mEgl.eglMakeCurrent(mEglDisplay,
+ EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE,
+ EGL10.EGL_NO_CONTEXT);
+ mEgl.eglMakeCurrent(mEglDisplay,
+ mEglSurface, mEglSurface,
+ mEglContext);
+ }
+
/**
* Display the current render surface.
* @return false if the context has been lost.
@@ -1415,6 +1424,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
if (LOG_RENDERER) {
Log.w("GLThread", "onSurfaceChanged(" + w + ", " + h + ")");
}
+ mEglHelper.purgeBuffers();
mRenderer.onSurfaceChanged(gl, w, h);
sizeChanged = false;
}