compositor: Move unbind_display call into gles2-renderer.c

dev
Kristian Høgsberg 12 years ago
parent 9793fc7a4e
commit 3a0de88abf
  1. 2
      src/compositor-android.c
  2. 2
      src/compositor-drm.c
  3. 2
      src/compositor-wayland.c
  4. 2
      src/compositor-x11.c
  5. 3
      src/compositor.c
  6. 2
      src/compositor.h
  7. 7
      src/gles2-renderer.c

@ -423,6 +423,8 @@ android_init_egl(struct android_compositor *compositor,
static void static void
android_fini_egl(struct android_compositor *compositor) android_fini_egl(struct android_compositor *compositor)
{ {
gles2_renderer_destroy(&compositor->base);
eglMakeCurrent(compositor->base.egl_display, eglMakeCurrent(compositor->base.egl_display,
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT); EGL_NO_CONTEXT);

@ -2034,6 +2034,8 @@ drm_destroy(struct weston_compositor *ec)
weston_compositor_shutdown(ec); weston_compositor_shutdown(ec);
gles2_renderer_destroy(ec);
/* Work around crash in egl_dri2.c's dri2_make_current() */ /* Work around crash in egl_dri2.c's dri2_make_current() */
eglMakeCurrent(ec->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, eglMakeCurrent(ec->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT); EGL_NO_CONTEXT);

@ -797,6 +797,8 @@ wayland_restore(struct weston_compositor *ec)
static void static void
wayland_destroy(struct weston_compositor *ec) wayland_destroy(struct weston_compositor *ec)
{ {
gles2_renderer_destroy(ec);
weston_compositor_shutdown(ec); weston_compositor_shutdown(ec);
free(ec); free(ec);

@ -273,6 +273,8 @@ x11_compositor_init_egl(struct x11_compositor *c)
static void static void
x11_compositor_fini_egl(struct x11_compositor *compositor) x11_compositor_fini_egl(struct x11_compositor *compositor)
{ {
gles2_renderer_destroy(&compositor->base);
eglMakeCurrent(compositor->base.egl_display, eglMakeCurrent(compositor->base.egl_display,
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT); EGL_NO_CONTEXT);

@ -3142,9 +3142,6 @@ int main(int argc, char *argv[])
wl_signal_emit(&ec->destroy_signal, ec); wl_signal_emit(&ec->destroy_signal, ec);
if (ec->has_bind_display)
ec->unbind_display(ec->egl_display, display);
for (i = ARRAY_LENGTH(signals); i;) for (i = ARRAY_LENGTH(signals); i;)
wl_event_source_remove(signals[--i]); wl_event_source_remove(signals[--i]);

@ -803,5 +803,7 @@ weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode
int int
gles2_renderer_init(struct weston_compositor *ec); gles2_renderer_init(struct weston_compositor *ec);
void
gles2_renderer_destroy(struct weston_compositor *ec);
#endif #endif

@ -1039,6 +1039,13 @@ struct gles2_renderer {
struct weston_renderer base; struct weston_renderer base;
}; };
WL_EXPORT void
gles2_renderer_destroy(struct weston_compositor *ec)
{
if (ec->has_bind_display)
ec->unbind_display(ec->egl_display, ec->wl_display);
}
WL_EXPORT int WL_EXPORT int
gles2_renderer_init(struct weston_compositor *ec) gles2_renderer_init(struct weston_compositor *ec)
{ {

Loading…
Cancel
Save