egl/dri2: Consolidate eglTerminate
authorChad Versace <chad.versace@linux.intel.com>
Wed, 29 Jan 2014 02:53:56 +0000 (18:53 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Mon, 17 Mar 2014 22:39:22 +0000 (15:39 -0700)
commitf506ef6784e79aeebd50184c034fc9723d6894db
tree348f5c2017130bad0e139623e7615a38b7834b6e
parent31cd0fee317c8532ac93f6de13c7955511f738a0
egl/dri2: Consolidate eglTerminate

egl_dri2.c:dri2_terminate() handled terminating X11 and DRM displays.
The Wayland platform implemented its own dri2_wl_terminate(), which was
nearly a copy of the common one.

To implement the EGL platform extensions, we either need to dispatch
eglTerminate per display or define a common implementation for all
platforms. This patch chooses consolidation.  It removes
dri2_wl_terminate() by folding it into the common dri2_terminate().

It was necessary to invert the `if (disp->PlatformDisplay == NULL)` and
the switch statement because, unlike DRM and X11, Wayland's terminator
performed action even when EGL didn't own the native display. In the
inversion, I replaced `disp->PlatformDisplay == NULL` with
`dri2_dpy->own_device` because the two expressions are synonymous, but
the latter's meaning is clearer.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/platform_wayland.c