Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35c70f94 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

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

parents 00c5620a c8ba0b46
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
            }