Module: Mesa
Branch: master
Commit: 293d64e96f22ade476378262a7582482a14edec1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=293d64e96f22ade476378262a7582482a14edec1

Author: Emil Velikov <[email protected]>
Date:   Sun Aug 27 11:20:34 2017 +0100

egl/wayland: group wl_win specific code together

Make the code a bit easier to follow. There should be no functional
change since none of the bits set are accessible until the
eglCreateWindowSurface call is complete.

Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>

---

 src/egl/drivers/dri2/platform_wayland.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index dee9325fac..ea389c6e0e 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -162,7 +162,6 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay 
*disp,
          dri2_surf->format = WL_SHM_FORMAT_ARGB8888;
    }
 
-   dri2_surf->wl_win = window;
    dri2_surf->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy);
    if (!dri2_surf->wl_queue) {
       _eglError(EGL_BAD_ALLOC, "dri2_create_surface");
@@ -195,15 +194,15 @@ dri2_wl_create_window_surface(_EGLDriver *drv, 
_EGLDisplay *disp,
    wl_proxy_set_queue((struct wl_proxy *)dri2_surf->wl_surface_wrapper,
                       dri2_surf->wl_queue);
 
+   dri2_surf->wl_win = window;
    dri2_surf->wl_win->private = dri2_surf;
    dri2_surf->wl_win->destroy_window_callback = destroy_window_callback;
+   if (dri2_dpy->flush)
+      dri2_surf->wl_win->resize_callback = resize_callback;
 
    config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
                                 dri2_surf->base.GLColorspace);
 
-   if (dri2_dpy->flush)
-      dri2_surf->wl_win->resize_callback = resize_callback;
-
    if (dri2_dpy->image_driver)
       createNewDrawable = dri2_dpy->image_driver->createNewDrawable;
    else if (dri2_dpy->dri2)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to