diff options
Diffstat (limited to 'opengl/libs/EGL/egl_object.cpp')
-rw-r--r-- | opengl/libs/EGL/egl_object.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp index b42b268..aaa5e72 100644 --- a/opengl/libs/EGL/egl_object.cpp +++ b/opengl/libs/EGL/egl_object.cpp @@ -63,6 +63,29 @@ bool egl_object_t::get(egl_display_t const* display, egl_object_t* object) { // ---------------------------------------------------------------------------- +egl_surface_t::egl_surface_t(egl_display_t* dpy, EGLConfig config, + EGLNativeWindowType win, EGLSurface surface, + egl_connection_t const* cnx) : + egl_object_t(dpy), surface(surface), config(config), win(win), cnx(cnx) +{ + if (win) { + getDisplay()->onWindowSurfaceCreated(); + } +} + +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)) { + ALOGW("EGLNativeWindowType %p disconnect failed", window); + } + getDisplay()->onWindowSurfaceDestroyed(); + } +} + +// ---------------------------------------------------------------------------- + egl_context_t::egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, egl_connection_t const* cnx, int version) : egl_object_t(get_display_nowake(dpy)), dpy(dpy), context(context), |