Merge "When destroying a surface, only unmake current if necessary Bug #9404946"

This commit is contained in:
Romain Guy
2013-06-21 23:44:32 +00:00
committed by Android (Google) Code Review

View File

@@ -1301,7 +1301,10 @@ public abstract class HardwareRenderer {
void destroySurface() {
if (mEglSurface != null && mEglSurface != EGL_NO_SURFACE) {
sEgl.eglMakeCurrent(sEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (mEglSurface.equals(sEgl.eglGetCurrentSurface(EGL_DRAW))) {
sEgl.eglMakeCurrent(sEglDisplay,
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
sEgl.eglDestroySurface(sEglDisplay, mEglSurface);
mEglSurface = null;
}