summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXiaowei Guan <xiaowei.guan@samsung.com>2019-05-13 21:55:47 +0800
committerJoonbum Ko <joonbum.ko@samsung.com>2019-05-30 09:35:50 +0900
commite235e1fe2cc6046cac22135c9779b5630eeb8a3c (patch)
tree115c468405e39359630d60c84c4e908c9dc10eeb /src
parent2b33296f882d9537937523ad0d1faa29429ba295 (diff)
downloadmesa-e235e1fe2cc6046cac22135c9779b5630eeb8a3c.tar.gz
mesa-e235e1fe2cc6046cac22135c9779b5630eeb8a3c.tar.bz2
mesa-e235e1fe2cc6046cac22135c9779b5630eeb8a3c.zip
sync wayland-egl code
Change-Id: I9faadf482a236a1551f667f49c8ac7a7c4cd940c
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c4
-rw-r--r--src/egl/wayland/wayland-egl/wayland-egl-priv.h26
-rw-r--r--src/egl/wayland/wayland-egl/wayland-egl.c30
3 files changed, 45 insertions, 15 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index c4a58a28d15..40c6b38a339 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -344,7 +344,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
dri2_surf->wl_queue);
dri2_surf->wl_win = window;
- dri2_surf->wl_win->driver_private = dri2_surf;
+ 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;
@@ -430,7 +430,7 @@ dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
wl_callback_destroy(dri2_surf->throttle_callback);
if (dri2_surf->wl_win) {
- dri2_surf->wl_win->driver_private = NULL;
+ dri2_surf->wl_win->private = NULL;
dri2_surf->wl_win->resize_callback = NULL;
dri2_surf->wl_win->destroy_window_callback = NULL;
}
diff --git a/src/egl/wayland/wayland-egl/wayland-egl-priv.h b/src/egl/wayland/wayland-egl/wayland-egl-priv.h
index 63545fee221..3a1beb420bd 100644
--- a/src/egl/wayland/wayland-egl/wayland-egl-priv.h
+++ b/src/egl/wayland/wayland-egl/wayland-egl-priv.h
@@ -3,21 +3,17 @@
#include <wayland-client.h>
-
+#include <wayland-egl.h>
#ifdef __cplusplus
extern "C" {
#endif
-/*
- * NOTE: This version must be kept in sync with the Version field in the
- * wayland-egl-backend.pc.in file.
- */
-#define WL_EGL_WINDOW_VERSION 3
-struct wl_surface;
+#define WL_EGL_WINDOW_VERSION 3
struct wl_egl_window {
const intptr_t version;
+ struct wl_surface *surface;
int width;
int height;
@@ -27,11 +23,19 @@ struct wl_egl_window {
int attached_width;
int attached_height;
- void *driver_private;
- void (*resize_callback)(struct wl_egl_window *, void *);
- void (*destroy_window_callback)(void *);
+ wl_egl_window_rotation rotation;
+ int frontbuffer_mode;
+ int transform;
+ int window_transform;
+ unsigned int serial;
- struct wl_surface *surface;
+ void *private;
+ void (*destroy_window_callback)(void *);
+ void (*resize_callback)(struct wl_egl_window *, void *);
+ void (*rotate_callback)(struct wl_egl_window *, void *);
+ int (*get_rotation_capability)(struct wl_egl_window *, void *);
+ void (*set_frontbuffer_callback)(struct wl_egl_window *, void *, int);
+ void (*set_window_serial_callback)(struct wl_egl_window *, void *, unsigned int);
};
#ifdef __cplusplus
diff --git a/src/egl/wayland/wayland-egl/wayland-egl.c b/src/egl/wayland/wayland-egl/wayland-egl.c
index 0ef5fa70291..46ac3f6cc18 100644
--- a/src/egl/wayland/wayland-egl/wayland-egl.c
+++ b/src/egl/wayland/wayland-egl/wayland-egl.c
@@ -47,7 +47,7 @@ wl_egl_window_resize(struct wl_egl_window *egl_window,
egl_window->dy = dy;
if (egl_window->resize_callback)
- egl_window->resize_callback(egl_window, egl_window->driver_private);
+ egl_window->resize_callback(egl_window, egl_window->private);
}
WL_EGL_EXPORT struct wl_egl_window *
@@ -80,14 +80,40 @@ wl_egl_window_create(struct wl_surface *surface,
egl_window->width = width;
egl_window->height = height;
+ 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->frontbuffer_mode = 0;
+ egl_window->transform = 0;
+ egl_window->window_transform = 0;
+ egl_window->serial = 0;
+
+ egl_window->private = NULL;
+ egl_window->rotate_callback = NULL;
+ egl_window->get_rotation_capability = NULL;
+
+ egl_window->destroy_window_callback = NULL;
+
+ WL_EGL_LOG(2, "surf:%10p WxH:%dx%d egl_win:%10p priv:%10p",
+ surface, width, height, egl_window, egl_window->private);
+
return egl_window;
}
WL_EGL_EXPORT void
wl_egl_window_destroy(struct wl_egl_window *egl_window)
{
+ if (egl_window == NULL) {
+ WL_EGL_ERR("egl_window is NULL");
+ return;
+ }
+
if (egl_window->destroy_window_callback)
- egl_window->destroy_window_callback(egl_window->driver_private);
+ egl_window->destroy_window_callback(egl_window->private);
free(egl_window);
}