forked from enlightenment/efl
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.
This commit is contained in:
parent
1c33a1a57b
commit
839a737a62
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue