From 839a737a626d6840c37ce166cc8834b765595bc1 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Fri, 1 Nov 2013 14:19:11 -0200 Subject: [PATCH] ecore(_evas)/wayland: Move frame callback to engine data. It's something specific to the ecore_evas engine/module, so there's no need to keep this info in the Ecore_Wl_Window. --- src/lib/ecore_wayland/Ecore_Wayland.h | 2 -- src/lib/ecore_wayland/ecore_wl_window.c | 2 -- .../engines/wayland/ecore_evas_wayland_common.c | 24 +++++++++++++--------- .../engines/wayland/ecore_evas_wayland_private.h | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 387c9f2..d42bae7 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -157,8 +157,6 @@ struct _Ecore_Wl_Window Ecore_Wl_Input *keyboard_device; /* FIXME: Shouldn't these attributes be private to the Ecore_Wl_Window? */ - Eina_Bool frame_pending : 1; - struct wl_callback *frame_callback; Eina_Bool anim_pending : 1; struct wl_callback *anim_callback; diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 8059f44..97508e2 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -112,8 +112,6 @@ ecore_wl_window_free(Ecore_Wl_Window *win) input->keyboard_focus = NULL; } - if (win->frame_callback) wl_callback_destroy(win->frame_callback); - win->frame_callback = NULL; if (win->anim_callback) wl_callback_destroy(win->anim_callback); win->anim_callback = NULL; diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 705d588..4aa27df 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -516,6 +516,8 @@ _ecore_evas_wl_common_free(Ecore_Evas *ee) LOGFN(__FILE__, __LINE__, __FUNCTION__); wdata = ee->engine.data; + if (wdata->frame_callback) wl_callback_destroy(wdata->frame_callback); + wdata->frame_callback = NULL; if (wdata->win) ecore_wl_window_free(wdata->win); wdata->win = NULL; free(wdata); @@ -1220,14 +1222,15 @@ _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t wdata = ee->engine.data; if (!(win = wdata->win)) return; - win->frame_callback = NULL; - win->frame_pending = EINA_FALSE; + wdata->frame_callback = NULL; + wdata->frame_pending = EINA_FALSE; wl_callback_destroy(callback); - if (win->surface) + if (ecore_wl_window_surface_get(win)) { - win->frame_callback = wl_surface_frame(win->surface); - wl_callback_add_listener(win->frame_callback, &frame_listener, ee); + wdata->frame_callback = wl_surface_frame + (ecore_wl_window_surface_get(win)); + wl_callback_add_listener(wdata->frame_callback, &frame_listener, ee); } } @@ -1264,14 +1267,15 @@ _ecore_evas_wl_common_render(Ecore_Evas *ee) if (!ee->can_async_render) { - if (!win->frame_pending) + if (!wdata->frame_pending) { Eina_List *updates; - if (!win->frame_callback) + if (!wdata->frame_callback) { - win->frame_callback = wl_surface_frame(win->surface); - wl_callback_add_listener(win->frame_callback, + wdata->frame_callback = wl_surface_frame + (ecore_wl_window_surface_get(win)); + wl_callback_add_listener(wdata->frame_callback, &frame_listener, ee); } @@ -1280,7 +1284,7 @@ _ecore_evas_wl_common_render(Ecore_Evas *ee) evas_render_updates_free(updates); if (rend) - win->frame_pending = EINA_TRUE; + wdata->frame_pending = EINA_TRUE; } } else if (evas_render_async(ee->evas)) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index c1fac29..8de0887 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -35,6 +35,8 @@ struct _Ecore_Evas_Engine_Wl_Data #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL struct wl_egl_window *egl_win; #endif + Eina_Bool frame_pending : 1; + struct wl_callback *frame_callback; }; Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void); -- 2.7.4