#include <wayland-client.h>
#include "wayland-egl/wayland-egl-priv.h"
+#include "wayland-egl/wayland-egl-tizen-priv.h"
#undef inline
static void
__tpl_wayland_egl_buffer_free(tpl_wayland_egl_buffer_t *wayland_egl_buffer);
+static struct tizen_private *
+_get_tizen_private(struct wl_egl_window * wl_egl_window)
+{
+ if (wl_egl_window && wl_egl_window->driver_private)
+ return (struct tizen_private *)wl_egl_window->driver_private;
+
+ return NULL;
+}
+
static TPL_INLINE tpl_wayland_egl_buffer_t *
__tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface_h surface)
{
TPL_ASSERT(window);
struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)window;
+ struct tizen_private *tizen_private = _get_tizen_private(wl_egl_window);
if (format) {
/* Wayland-egl window doesn't have native format information.
It is fixed from 'EGLconfig' when called eglCreateWindowSurface().
So we use the tpl_surface format instead. */
- tpl_surface_t *surface = wl_egl_window->driver_private;
- if (surface) *format = surface->format;
- else {
+ if (tizen_private && tizen_private->data) {
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
+ *format = surface->format;
+ } else {
if (a_size == 8) *format = TBM_FORMAT_ARGB8888;
else if (a_size == 0) *format = TBM_FORMAT_XRGB8888;
}
void *private);
static void
+__cb_client_window_destroy_callback(void *private);
+
+static void
__cb_client_window_rotate_callback(struct wl_egl_window *wl_egl_window,
void *private);
tpl_wayland_egl_display_t *wayland_egl_display;
tpl_wayland_egl_surface_t *wayland_egl_surface;
struct wl_egl_window *wl_egl_window;
+ struct tizen_private *tizen_private = NULL;
tbm_bufmgr bufmgr = NULL;
unsigned int capability;
int flags = TBM_BO_DEFAULT;
wayland_egl_surface->vblank_done = TPL_TRUE;
wayland_egl_surface->is_activated = TPL_FALSE;
wayland_egl_surface->current_buffer = NULL;
- wayland_egl_surface->latest_transform = wl_egl_window->transform;
wayland_egl_surface->set_serial_is_used = TPL_FALSE;
wayland_egl_surface->serial = 0;
goto add_reset_cb_fail;
}
+
+ if (wl_egl_window->driver_private)
+ tizen_private = _get_tizen_private(wl_egl_window);
+ else {
+ tizen_private = tizen_private_create();
+ wl_egl_window->driver_private = (void *)tizen_private;
+ }
+
+ if (!tizen_private) {
+ TPL_ERR("Failed to create tizen_private for wl_egl_window(%p)", wl_egl_window);
+ goto tizen_private_create_fail;
+ }
+
surface->width = wl_egl_window->width;
surface->height = wl_egl_window->height;
- surface->rotation = wl_egl_window->rotation;
+ surface->rotation = tizen_private->rotation;
surface->rotation_capability = TPL_FALSE;
- wl_egl_window->driver_private = surface;
+ wayland_egl_surface->latest_transform = tizen_private->transform;
wl_egl_window->resize_callback = (void *)__cb_client_window_resize_callback;
- wl_egl_window->rotate_callback = (void *)__cb_client_window_rotate_callback;
- wl_egl_window->get_rotation_capability = (void *)
+ wl_egl_window->destroy_window_callback = (void *)__cb_client_window_destroy_callback;
+
+ tizen_private->data = (void *)surface;
+ tizen_private->rotate_callback = (void *)__cb_client_window_rotate_callback;
+ tizen_private->get_rotation_capability = (void *)
__cb_client_window_get_rotation_capability;
- wl_egl_window->set_frontbuffer_callback = (void *)
+ tizen_private->set_frontbuffer_callback = (void *)
__cb_client_window_set_frontbuffer_mode;
- wl_egl_window->set_window_serial_callback = (void *)
+ tizen_private->set_window_serial_callback = (void *)
__cb_client_window_set_window_serial_callback;
/* tdm_vblank object decide to be maintained every tpl_wayland_egl_surface
return TPL_ERROR_NONE;
+tizen_private_create_fail:
create_vblank_fail:
tbm_surface_queue_remove_reset_cb(wayland_egl_surface->tbm_queue,
__cb_tbm_surface_queue_reset_callback,
if (surface->type == TPL_SURFACE_TYPE_WINDOW) {
struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)
surface->native_handle;
+ struct tizen_private *tizen_private = _get_tizen_private(wl_egl_window);
int lock_res = 0;
TPL_ASSERT(wl_egl_window);
/* TPL_ASSERT(wl_egl_window->surface); */ /* to be enabled once evas/gl patch is in place */
+ if (tizen_private) {
+ tizen_private->data = NULL;
+ tizen_private->rotate_callback = NULL;
+ tizen_private->get_rotation_capability = NULL;
+ tizen_private->set_frontbuffer_callback = NULL;
+ tizen_private->set_window_serial_callback = NULL;
+ free(tizen_private);
+ tizen_private = NULL;
+ }
+
wl_egl_window->driver_private = NULL;
wl_egl_window->resize_callback = NULL;
- wl_egl_window->rotate_callback = NULL;
- wl_egl_window->get_rotation_capability = NULL;
- wl_egl_window->set_frontbuffer_callback = NULL;
- wl_egl_window->set_window_serial_callback = NULL;
+ wl_egl_window->destroy_window_callback = NULL;
__tpl_wayland_egl_surface_buffer_flusher_fini(surface);
struct wl_proxy *wl_proxy = NULL;
struct wl_egl_window *wl_egl_window =
(struct wl_egl_window *)surface->native_handle;
+ struct tizen_private *tizen_private = _get_tizen_private(wl_egl_window);
tbm_surface_queue_error_e tsq_err = 0;
int is_activated = 0;
int lock_res = 0;
+ TPL_ASSERT(tizen_private);
+
if (sync_fence)
*sync_fence = -1;
wayland_egl_buffer->width = wl_egl_window->width;
wayland_egl_buffer->height = wl_egl_window->height;
- if (wayland_egl_buffer->window_transform != wl_egl_window->window_transform) {
- wayland_egl_buffer->window_transform = wl_egl_window->window_transform;
+ if (wayland_egl_buffer->window_transform != tizen_private->window_transform) {
+ wayland_egl_buffer->window_transform = tizen_private->window_transform;
wayland_egl_buffer->w_rotated = TPL_TRUE;
} else {
wayland_egl_buffer->w_rotated = TPL_FALSE;
}
- if (wayland_egl_surface->latest_transform != wl_egl_window->transform) {
- wayland_egl_surface->latest_transform = wl_egl_window->transform;
- wayland_egl_buffer->transform = wl_egl_window->transform;
+ if (wayland_egl_surface->latest_transform != tizen_private->transform) {
+ wayland_egl_surface->latest_transform = tizen_private->transform;
+ wayland_egl_buffer->transform = tizen_private->transform;
wayland_egl_buffer->rotated = TPL_TRUE;
} else {
wayland_egl_buffer->rotated = TPL_FALSE;
if (wayland_egl_surface->set_serial_is_used) {
wayland_egl_buffer->serial = wayland_egl_surface->serial;
} else {
- ++wl_egl_window->serial;
- wayland_egl_buffer->serial = wl_egl_window->serial;
+ ++tizen_private->serial;
+ wayland_egl_buffer->serial = tizen_private->serial;
}
wayland_egl_buffer->dx = wl_egl_window->dx;
wayland_egl_buffer->wl_proxy = wl_proxy;
wayland_egl_buffer->bo = tbm_surface_internal_get_bo(tbm_surface, 0);
wayland_egl_buffer->wayland_egl_surface = wayland_egl_surface;
- wayland_egl_buffer->transform = wl_egl_window->transform;
+ wayland_egl_buffer->transform = tizen_private->transform;
wayland_egl_buffer->rotated = TPL_TRUE;
- if (wayland_egl_buffer->window_transform != wl_egl_window->window_transform) {
- wayland_egl_buffer->window_transform = wl_egl_window->window_transform;
+ if (wayland_egl_buffer->window_transform != tizen_private->window_transform) {
+ wayland_egl_buffer->window_transform = tizen_private->window_transform;
wayland_egl_buffer->w_rotated = TPL_TRUE;
} else {
wayland_egl_buffer->w_rotated = TPL_FALSE;
}
- if (wayland_egl_surface->latest_transform != wl_egl_window->transform) {
- wayland_egl_surface->latest_transform = wl_egl_window->transform;
+ if (wayland_egl_surface->latest_transform != tizen_private->transform) {
+ wayland_egl_surface->latest_transform = tizen_private->transform;
wayland_egl_buffer->rotated = TPL_TRUE;
} else {
wayland_egl_buffer->rotated = TPL_FALSE;
};
static void
+__cb_client_window_destroy_callback(void *private)
+{
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = NULL;
+ struct wl_egl_window *wl_egl_window = NULL;
+
+ if (!tizen_private) {
+ TPL_WARN("[DESTROY_CB] Already destroyed surface");
+ return;
+ }
+
+ surface = (tpl_surface_t *)tizen_private->data;
+ if (surface) {
+ TPL_LOG_B("WL_EGL", "[DESTROY_CB] wl_egl_window(%p) tpl_surface(%p)",
+ surface->native_handle, surface);
+ wl_egl_window = (struct wl_egl_window *)surface->native_handle;
+
+ wl_egl_window->driver_private = NULL;
+ surface->native_handle = NULL;
+ }
+
+ tizen_private->set_window_serial_callback = NULL;
+ tizen_private->rotate_callback = NULL;
+ tizen_private->get_rotation_capability = NULL;
+ tizen_private->set_frontbuffer_callback = NULL;
+ tizen_private->data = NULL;
+ free(tizen_private);
+ tizen_private = NULL;
+}
+
+static void
__cb_client_window_resize_callback(struct wl_egl_window *wl_egl_window,
- void *private)
+ void *private)
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
int cur_w, cur_h, req_w, req_h;
- tpl_surface_t *surface = (tpl_surface_t *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
tpl_wayland_egl_surface_t *wayland_egl_surface =
(tpl_wayland_egl_surface_t *)surface->backend.data;
TPL_ASSERT(wl_egl_window);
int rotation;
- tpl_surface_t *surface = (tpl_surface_t *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
- rotation = wl_egl_window->rotation;
+ rotation = tizen_private->rotation;
TPL_LOG_B("WL_EGL", "[ROTATE_CB] wl_egl_window(%p) (%d) -> (%d)",
wl_egl_window, surface->rotation, rotation);
int rotation_capability = WL_EGL_WINDOW_CAPABILITY_NONE;
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- tpl_surface_t *surface = (tpl_surface_t *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
+
if (TPL_TRUE == surface->rotation_capability)
rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED;
else
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- tpl_surface_t *surface = (tpl_surface_t *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
if (set)
surface->is_frontbuffer_mode = TPL_TRUE;
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- tpl_surface_t *surface = (tpl_surface_t *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ tpl_surface_t *surface = (tpl_surface_t *)tizen_private->data;
TPL_ASSERT(surface->backend.data);
#include "tpl_utils.h"
#include "tpl_internal.h"
#include "wayland-egl/wayland-egl-priv.h"
+#include "wayland-egl/wayland-egl-tizen-priv.h"
#include "tpl_wayland_egl_thread.h"
#include "wayland-vulkan/wayland-vulkan-client-protocol.h"
#include "tpl_utils.h"
__cb_buffer_remove_from_list(void *data);
static tpl_result_t
_twe_surface_wait_vblank(twe_wl_surf_source *surf_source);
+static struct tizen_private *
+_get_tizen_private(struct wl_egl_window *);
static gpointer
_twe_thread_loop(gpointer data)
return TPL_ERROR_NONE;
}
+static struct tizen_private *
+_get_tizen_private(struct wl_egl_window * wl_egl_window)
+{
+ if (wl_egl_window && wl_egl_window->driver_private)
+ return (struct tizen_private *)wl_egl_window->driver_private;
+
+ return NULL;
+}
static void
__cb_destroy_callback(void *private)
{
- twe_wl_surf_source *surf_source = (twe_wl_surf_source *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ twe_wl_surf_source *surf_source = NULL;
+
+ if (!tizen_private) {
+ TPL_LOG_T(BACKEND, "[DESTROY_CB] Already destroyed surface");
+ return;
+ }
+ surf_source = (twe_wl_surf_source *)tizen_private->data;
if (surf_source) {
TPL_LOG_T(BACKEND, "[DESTROY_CB] wl_egl_window(%p) surf_source(%p)",
surf_source->wl_egl_window, surf_source);
surf_source->wl_egl_window = NULL;
surf_source->surf = NULL;
surf_source->is_destroying = TPL_TRUE;
+
+ tizen_private->set_window_serial_callback = NULL;
+ tizen_private->rotate_callback = NULL;
+ tizen_private->get_rotation_capability = NULL;
+ tizen_private->data = NULL;
+ free(tizen_private);
+ tizen_private = NULL;
g_mutex_unlock(&surf_source->surf_mutex);
}
+
+ if (tizen_private) {
+ tizen_private->set_window_serial_callback = NULL;
+ tizen_private->rotate_callback = NULL;
+ tizen_private->get_rotation_capability = NULL;
+ tizen_private->data = NULL;
+ free(tizen_private);
+ tizen_private = NULL;
+ }
}
static void
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- twe_wl_surf_source *source = (twe_wl_surf_source *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
int cur_w, cur_h, req_w, req_h, format;
+ TPL_ASSERT(tizen_private->data);
+
+ twe_wl_surf_source *source = (twe_wl_surf_source *)tizen_private->data;
+
format = tbm_surface_queue_get_format(source->tbm_queue);
cur_w = tbm_surface_queue_get_width(source->tbm_queue);
cur_h = tbm_surface_queue_get_height(source->tbm_queue);
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
- int rotation = wl_egl_window->rotation;
- twe_wl_surf_source *source = (twe_wl_surf_source *)private;
+ struct tizen_private *tizen_private = (struct tizen_private *)private;
+ twe_wl_surf_source *source = (twe_wl_surf_source *)tizen_private->data;
+ int rotation = tizen_private->rotation;
+
+ TPL_ASSERT(source);
TPL_LOG_T(BACKEND, "[ROTATE_CB] wl_egl_window(%p) (%d) -> (%d)",
wl_egl_window, source->rotation, rotation);
{
twe_wl_buffer_info *buf_info = NULL;
struct wl_egl_window *wl_egl_window = NULL;
+ struct tizen_private *tizen_private = NULL;
if (!surf_source || g_source_is_destroyed(&surf_source->gsource)) {
TPL_ERR("Invalid parameter. twe_surface(%p)", surf_source);
}
wl_egl_window = surf_source->wl_egl_window;
+ tizen_private = _get_tizen_private(wl_egl_window);
if (!tbm_surface || !tbm_surface_internal_is_valid(tbm_surface)) {
TPL_ERR("Invalid parameter. tbm_surface(%p)", tbm_surface);
(void **)&buf_info);
/* If buf_info is already existed, reuse it. */
if (buf_info) {
- if (wl_egl_window) {
- if (buf_info->w_transform != wl_egl_window->window_transform) {
- buf_info->w_transform = wl_egl_window->window_transform;
+ if (tizen_private) {
+ if (buf_info->w_transform != tizen_private->window_transform) {
+ buf_info->w_transform = tizen_private->window_transform;
buf_info->w_rotated = TPL_TRUE;
}
- if (surf_source->latest_transform != wl_egl_window->transform) {
- surf_source->latest_transform = wl_egl_window->transform;
+ if (surf_source->latest_transform != tizen_private->transform) {
+ surf_source->latest_transform = tizen_private->transform;
buf_info->rotated = TPL_TRUE;
}
- buf_info->transform = wl_egl_window->transform;
+ buf_info->transform = tizen_private->transform;
buf_info->dx = wl_egl_window->dx;
buf_info->dy = wl_egl_window->dy;
if (surf_source->set_serial_is_used) {
buf_info->serial = surf_source->serial;
} else {
- ++wl_egl_window->serial;
- buf_info->serial = wl_egl_window->serial;
+ ++tizen_private->serial;
+ buf_info->serial = tizen_private->serial;
}
}
return;
}
- if (wl_egl_window) {
+ if (wl_egl_window && tizen_private) {
buf_info->dx = wl_egl_window->dx;
buf_info->dy = wl_egl_window->dy;
buf_info->width = wl_egl_window->width;
buf_info->height = wl_egl_window->height;
- if (buf_info->w_transform != wl_egl_window->window_transform) {
- buf_info->w_transform = wl_egl_window->window_transform;
+ if (buf_info->w_transform != tizen_private->window_transform) {
+ buf_info->w_transform = tizen_private->window_transform;
buf_info->w_rotated = TPL_TRUE;
}
- if (surf_source->latest_transform != wl_egl_window->transform) {
- surf_source->latest_transform = wl_egl_window->transform;
+ if (surf_source->latest_transform != tizen_private->transform) {
+ surf_source->latest_transform = tizen_private->transform;
buf_info->rotated = TPL_TRUE;
}
- buf_info->transform = wl_egl_window->transform;
+ buf_info->transform = tizen_private->transform;
if (surf_source->set_serial_is_used) {
buf_info->serial = surf_source->serial;
} else {
- ++wl_egl_window->serial;
- buf_info->serial = wl_egl_window->serial;
+ ++tizen_private->serial;
+ buf_info->serial = tizen_private->serial;
}
if (surf_source->in_use_buffers) {
surf_source->rotate_cb = NULL;
if (surf_source->wl_egl_window) {
+ struct tizen_private *tizen_private = NULL;
TPL_LOG_T(BACKEND, "twe_surface(%p) wl_egl_window(%p) wl_surface(%p)",
surf_source, surf_source->wl_egl_window, surf_source->surf);
- surf_source->wl_egl_window->set_window_serial_callback = NULL;
+ tizen_private = _get_tizen_private(surf_source->wl_egl_window);
+ if (tizen_private) {
+ tizen_private->set_window_serial_callback = NULL;
+ tizen_private->rotate_callback = NULL;
+ tizen_private->get_rotation_capability = NULL;
+ tizen_private->data = NULL;
+ free(tizen_private);
+ }
+
surf_source->wl_egl_window->destroy_window_callback = NULL;
surf_source->wl_egl_window->resize_callback = NULL;
- surf_source->wl_egl_window->rotate_callback = NULL;
- surf_source->wl_egl_window->get_rotation_capability = NULL;
surf_source->wl_egl_window->driver_private = NULL;
surf_source->wl_egl_window = NULL;
surf_source->surf = NULL;
if (!disp_source->is_vulkan_dpy) {
struct wl_egl_window *wl_egl_window =
(struct wl_egl_window *)native_handle;
+ struct tizen_private *private = NULL;
- wl_egl_window->driver_private = (void *)source;
- wl_egl_window->destroy_window_callback = (void *)__cb_destroy_callback;
- wl_egl_window->resize_callback = (void *)__cb_resize_callback;
- wl_egl_window->rotate_callback = (void *)__cb_rotate_callback;
- wl_egl_window->get_rotation_capability = (void *)
- __cb_get_rotation_capability;
- wl_egl_window->set_window_serial_callback = (void *)
- __cb_set_window_serial_callback;
+ if (wl_egl_window->driver_private)
+ private = (struct tizen_private *)wl_egl_window->driver_private;
+ else {
+ private = tizen_private_create();
+ wl_egl_window->driver_private = (void *)private;
+ }
+
+ if (private) {
+ private->data = (void *)source;
+ private->rotate_callback = (void *)__cb_rotate_callback;
+ private->get_rotation_capability = (void *)
+ __cb_get_rotation_capability;
+ private->set_window_serial_callback = (void *)
+ __cb_set_window_serial_callback;
+
+ source->latest_transform = private->transform;
+
+ wl_egl_window->destroy_window_callback = (void *)__cb_destroy_callback;
+ wl_egl_window->resize_callback = (void *)__cb_resize_callback;
+ }
source->wl_egl_window = wl_egl_window;
source->surf = wl_egl_window->surface;
- source->latest_transform = wl_egl_window->transform;
-
source->vblank_waiting_buffers = __tpl_list_alloc();
} else {
if (width) *width = wl_egl_window->width;
if (height) *height = wl_egl_window->height;
if (format) {
- if (wl_egl_window->driver_private) {
- twe_wl_surf_source *surf_source = (twe_wl_surf_source *)wl_egl_window->driver_private;
+ struct tizen_private *tizen_private = _get_tizen_private(wl_egl_window);
+ if (tizen_private && tizen_private->data) {
+ twe_wl_surf_source *surf_source = (twe_wl_surf_source *)tizen_private->data;
*format = surf_source->format;
} else {
if (a_size == 8)
#include <wayland-egl.h>
#include "wayland-egl-tizen.h"
#include "wayland-egl-priv.h"
+#include "wayland-egl-tizen-priv.h"
#define WL_EGL_DEBUG 1
#if WL_EGL_DEBUG
wl_egl_window_tizen_set_rotation(struct wl_egl_window *egl_window,
int rotation)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return;
}
- if (egl_window->rotation == rotation) {
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ if (private->rotation == rotation) {
WL_EGL_LOG(2, "rotation(%d) egl_window->rotation(%d) already rotated",
- rotation, egl_window->rotation);
+ rotation, private->rotation);
return;
}
- egl_window->rotation = rotation;
+ private->rotation = rotation;
- if (egl_window->rotate_callback)
- egl_window->rotate_callback(egl_window, egl_window->driver_private);
+ if (private->rotate_callback)
+ private->rotate_callback(egl_window, egl_window->driver_private);
}
int
wl_egl_window_tizen_get_capabilities(struct wl_egl_window *egl_window)
{
+ struct tizen_private *private = NULL;
int capabilities = WL_EGL_WINDOW_CAPABILITY_NONE;
+
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
- return capabilities;
+ return -1;
}
- if (egl_window->get_rotation_capability)
- capabilities = egl_window->get_rotation_capability(egl_window, egl_window->driver_private);
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return -1;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ if (private->get_rotation_capability)
+ capabilities = private->get_rotation_capability(egl_window, egl_window->driver_private);
else
capabilities = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNKNOWN;
wl_egl_window_tizen_set_buffer_transform(struct wl_egl_window *egl_window,
int wl_output_transform)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return;
}
- if (egl_window->transform == wl_output_transform) {
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ if (private->transform == wl_output_transform) {
WL_EGL_LOG(2,
- "wl_output_transform(%d) egl_window->transform(%d) already rotated",
- wl_output_transform, egl_window->transform);
+ "wl_output_transform(%d) private->transform(%d) already rotated",
+ wl_output_transform, private->transform);
return;
}
- egl_window->transform = wl_output_transform;
+ private->transform = wl_output_transform;
}
void
wl_egl_window_tizen_set_frontbuffer_mode(struct wl_egl_window *egl_window,
int set)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return;
}
- egl_window->frontbuffer_mode = set;
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ private->frontbuffer_mode = set;
- if (egl_window->set_frontbuffer_callback)
- egl_window->set_frontbuffer_callback(egl_window, egl_window->driver_private,
- set);
+ if (private->set_frontbuffer_callback)
+ private->set_frontbuffer_callback(egl_window, egl_window->driver_private,
+ set);
}
void
wl_egl_window_tizen_set_window_transform(struct wl_egl_window *egl_window,
int window_transform)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return;
}
- if (egl_window->window_transform == window_transform) {
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ if (private->window_transform == window_transform) {
WL_EGL_LOG(2,
"window_transform(%d) already rotated",
window_transform);
return;
}
- egl_window->window_transform = window_transform;
+ private->window_transform = window_transform;
}
unsigned int
wl_egl_window_tizen_get_window_serial(struct wl_egl_window *egl_window)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return 0;
}
- return egl_window->serial;
+ if (!egl_window->driver_private) {
+ private = tizen_private_create();
+ if (!private) {
+ WL_EGL_ERR("Failed to create tizen_private.");
+ return 0;
+ }
+
+ egl_window->driver_private = (void *)private;
+ } else {
+ private = (struct tizen_private *)egl_window->driver_private;
+ }
+
+ return private->serial;
}
void
wl_egl_window_tizen_set_window_serial(struct wl_egl_window *egl_window,
unsigned int serial)
{
+ struct tizen_private *private = NULL;
if (egl_window == NULL) {
WL_EGL_ERR("egl_window is NULL");
return;
}
- if (egl_window->set_window_serial_callback)
- egl_window->set_window_serial_callback(egl_window, egl_window->driver_private,
- serial);
+ private = egl_window->driver_private;
+ if (private == NULL) {
+ WL_EGL_ERR("wl_egl_window(%p) dirver_private is NULL", egl_window);
+ return;
+ }
+
+ if (private->set_window_serial_callback)
+ private->set_window_serial_callback(egl_window, egl_window->driver_private,
+ serial);
}
\ No newline at end of file