wayland-egl: clean up wl_egl_window_create() 02/104402/2
authorYoungJun Cho <yj44.cho@samsung.com>
Tue, 13 Dec 2016 08:11:41 +0000 (17:11 +0900)
committerGwan-gyeong Mun <kk.moon@samsung.com>
Wed, 11 Jan 2017 09:29:22 +0000 (01:29 -0800)
This patch cleans up wl_egl_window_create().
Some callbacks are also initialized.

Change-Id: I3361d02299287af0313ed96371ea61c8984fb964
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
src/wayland-egl/wayland-egl.c

index 77e8e22..1034539 100644 (file)
@@ -78,29 +78,37 @@ wl_egl_window_resize(struct wl_egl_window *egl_window,
 
 WL_EGL_EXPORT struct wl_egl_window *
 wl_egl_window_create(struct wl_surface *surface,
-                                        int width, int height)
+                               int width, int height)
 {
        struct wl_egl_window *egl_window;
 
-       if (width <= 0 || height <= 0) return NULL;
-       if (!surface) return NULL;
+       if (width <= 0 || height <= 0)
+               return NULL;
+       if (!surface)
+               return NULL;
 
-       egl_window = malloc(sizeof * egl_window);
+       egl_window = malloc(sizeof *egl_window);
        if (!egl_window) {
                WL_EGL_ERR("failed to allocate memory for egl_window");
                return NULL;
        }
 
        egl_window->surface = surface;
-       egl_window->private = NULL;
+
        egl_window->resize_callback = NULL;
        wl_egl_window_resize(egl_window, width, height, 0, 0);
+
        egl_window->attached_width  = 0;
        egl_window->attached_height = 0;
+
        egl_window->rotation = ROTATION_0;
 
+       egl_window->private = NULL;
+       egl_window->rotate_callback = NULL;
+       egl_window->get_rotation_capability = NULL;
+
        WL_EGL_LOG(2, "surf:%10p WxH:%dx%d egl_win:%10p priv:%10p",
-                          surface, width, height, egl_window, egl_window->private);
+                  surface, width, height, egl_window, egl_window->private);
 
        return egl_window;
 }