diff options
author | Jesse Hall <jessehall@google.com> | 2015-10-14 11:10:24 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2015-10-14 11:21:25 -0700 |
commit | 312d7555cb71ce7fb73bc758b9e30653e223b2f3 (patch) | |
tree | dbf79b71040629d6ed7157023762b9cb954788fe /opengl | |
parent | 16b0ae105e4e94ff09d1517b68f7c66f2022a19e (diff) | |
download | frameworks_native-312d7555cb71ce7fb73bc758b9e30653e223b2f3.zip frameworks_native-312d7555cb71ce7fb73bc758b9e30653e223b2f3.tar.gz frameworks_native-312d7555cb71ce7fb73bc758b9e30653e223b2f3.tar.bz2 |
egl: Remove window disconnect before calling driver eglDestroySurface
This was originally added for b/14445579. An in-development app was
attempting to render to a window as an EGLSurface, then tear that
down, change some window properties, and create a new EGLSurface. The
second eglCreateWindowSurface failed because the window was already
connected. This change went in, but it turned out the real problem was
that the app still (unintentionally) had the surface current. After
the app bug was fixed, nobody revisited whether this change was
actually needed.
Turns out it wasn't needed. After an EGLSurface is both destroyed
*AND* not current (basically refcount==0), we were already
disconnecting the window in ~egl_surface_t().
Apart from being unnecessary and redundant, disconnecting the window
here is wrong for two reasons:
(a) The surface may still be in use after eglDestroySurface, if it was
still current. Rendering is undefined in that case, but disconnecting
the window leads to more catastrophic results than necessary.
(b) It's being called before calling the driver's eglDestroySurface.
The driver will almost definitely have a buffer dequeued that it needs
to cancel, and by disconnecting first we turn that into an error that
they don't have a graceful way to deal with.
Bug: 24524053
Change-Id: Ib063134413d25d3526f794aafb5e333e3417ea42
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 8378907..cdec565 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -595,15 +595,6 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface) return setError(EGL_BAD_SURFACE, EGL_FALSE); egl_surface_t * const s = get_surface(surface); - ANativeWindow* window = s->win.get(); - if (window) { - int result = native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL); - if (result != OK) { - ALOGE("eglDestroySurface: native_window_api_disconnect (win=%p) " - "failed (%#x)", - window, result); - } - } EGLBoolean result = s->cnx->egl.eglDestroySurface(dp->disp.dpy, s->surface); if (result == EGL_TRUE) { _s.terminate(); |