summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-10-16 15:51:06 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-10-16 15:55:40 -0400
commitef89bfbbede4721fd61d95e9186b370fa58b74b9 (patch)
tree274450086dece875d00d773bffd622bd470200c8 /src
parent5ad3c6358f67682816587240a0ff287198549d1a (diff)
ecore-evas-wayland: add frame callback listener during render
when a render occurs, frame callbacks must be managed in order to ensure successful rendering for future frames. the best place to do this is in the engine here, since this is the lowest-level place which has access to both the wl_surface as well as the evas rendering state ref T2784
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c26
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h1
2 files changed, 26 insertions, 1 deletions
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 379dcb1..41b0112 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
@@ -451,6 +451,8 @@ _ecore_evas_wl_common_free(Ecore_Evas *ee)
451 451
452 if (!ee) return; 452 if (!ee) return;
453 wdata = ee->engine.data; 453 wdata = ee->engine.data;
454 if (wdata->anim_callback)
455 wl_callback_destroy(wdata->anim_callback);
454 if (wdata->win) ecore_wl_window_free(wdata->win); 456 if (wdata->win) ecore_wl_window_free(wdata->win);
455 wdata->win = NULL; 457 wdata->win = NULL;
456 free(wdata); 458 free(wdata);
@@ -1258,6 +1260,22 @@ _ecore_evas_wl_common_pre_render(Ecore_Evas *ee)
1258 return rend; 1260 return rend;
1259} 1261}
1260 1262
1263static void
1264_anim_cb_animate(void *data, struct wl_callback *callback, uint32_t serial EINA_UNUSED)
1265{
1266 Ecore_Evas_Engine_Wl_Data *wdata = data;
1267
1268 if ((wdata->anim_callback) && (callback != wdata->anim_callback)) return;
1269
1270 wl_callback_destroy(callback);
1271 wdata->anim_callback = NULL;
1272}
1273
1274static const struct wl_callback_listener _anim_listener =
1275{
1276 _anim_cb_animate
1277};
1278
1261void 1279void
1262_ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *event) 1280_ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *event)
1263{ 1281{
@@ -1268,7 +1286,13 @@ _ecore_evas_wl_common_render_updates(void *data, Evas *evas EINA_UNUSED, void *e
1268 1286
1269 ee->in_async_render = EINA_FALSE; 1287 ee->in_async_render = EINA_FALSE;
1270 1288
1271 _ecore_evas_wl_common_render_updates_process(ee, ev->updated_area); 1289 if (_ecore_evas_wl_common_render_updates_process(ee, ev->updated_area))
1290 {
1291 Ecore_Evas_Engine_Wl_Data *wdata = ee->engine.data;
1292
1293 wdata->anim_callback = wl_surface_frame(ecore_wl_window_surface_get(wdata->win));
1294 wl_callback_add_listener(wdata->anim_callback, &_anim_listener, wdata);
1295 }
1272 1296
1273 if (ee->delayed.alpha_changed) 1297 if (ee->delayed.alpha_changed)
1274 { 1298 {
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 206d178..48e9a3f 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,7 @@ struct _Ecore_Evas_Engine_Wl_Data
35#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL 35#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
36 struct wl_egl_window *egl_win; 36 struct wl_egl_window *egl_win;
37#endif 37#endif
38 struct wl_callback *anim_callback;
38}; 39};
39 40
40Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void); 41Ecore_Evas_Interface_Wayland *_ecore_evas_wl_interface_new(void);