summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-08-25 13:48:25 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-25 13:48:25 -0700
commitc63764e834445c4b0db1dfa56770d6928d65bc56 (patch)
treeade9abb944106be25abb346fd2dbfeb1ca8d8a6f /opengl
parent8e7e95f22f700fae6926d87b25c388bf9b509389 (diff)
parent7de41f1bf73cc7fe2a193293873a6f418a735369 (diff)
downloadframeworks_base-c63764e834445c4b0db1dfa56770d6928d65bc56.zip
frameworks_base-c63764e834445c4b0db1dfa56770d6928d65bc56.tar.gz
frameworks_base-c63764e834445c4b0db1dfa56770d6928d65bc56.tar.bz2
Merge "EGL: move disconnect to surface dtor"
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/eglApi.cpp7
-rw-r--r--opengl/libs/EGL/egl_object.h11
2 files changed, 9 insertions, 9 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 10cea22..1f0016a 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -454,13 +454,6 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
EGLBoolean result = s->cnx->egl.eglDestroySurface(
dp->disp[s->impl].dpy, s->surface);
if (result == EGL_TRUE) {
- ANativeWindow* const window = s->win.get();
- if (window != NULL) {
- native_window_set_buffers_format(window, 0);
- if (native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL)) {
- LOGE("EGLNativeWindowType %p disconnected failed", window);
- }
- }
_s.terminate();
}
return result;
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index 3459a8a..d2b7378 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -125,7 +125,15 @@ void egl_object_t::LocalRef<N,T>::terminate() {
class egl_surface_t: public egl_object_t {
protected:
- ~egl_surface_t() {}
+ ~egl_surface_t() {
+ ANativeWindow* const window = win.get();
+ if (window != NULL) {
+ native_window_set_buffers_format(window, 0);
+ if (native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL)) {
+ LOGE("EGLNativeWindowType %p disconnected failed", window);
+ }
+ }
+ }
public:
typedef egl_object_t::LocalRef<egl_surface_t, EGLSurface> Ref;
@@ -232,4 +240,3 @@ egl_sync_t* get_sync(EGLSyncKHR sync) {
// ----------------------------------------------------------------------------
#endif // ANDROID_EGL_OBJECT_H
-