aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-09-17 16:32:49 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-09-17 16:54:00 -0400
commitbff9ae5feb2709bc3d416f6b6e6a07b1e2f3c487 (patch)
tree59a855b1756d34547d7126795a1f55dc6dc3eba4
parentenable depth+stencil bits for x11 gl compositor canvas creation (diff)
downloadenlightenment-bff9ae5feb2709bc3d416f6b6e6a07b1e2f3c487.tar.gz
add pre-render callback list for compositor canvas
someone doing fancy effects might want to add a callback to do various tasks only when a render is about to occur
-rw-r--r--src/bin/e_comp.h2
-rw-r--r--src/bin/e_comp_canvas.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h
index 2c9c9d6ca..d34303663 100644
--- a/src/bin/e_comp.h
+++ b/src/bin/e_comp.h
@@ -89,6 +89,8 @@ struct _E_Comp
Eina_List *clients;
unsigned int new_clients;
+ Eina_List *pre_render_cbs; /* E_Comp_Cb */
+
E_Comp_X_Data *x_comp_data;
E_Comp_Wl_Data *wl_comp_data;
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index 87fc003f8..5f90c8c34 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -211,6 +211,16 @@ _e_comp_canvas_resize(Ecore_Evas *ee EINA_UNUSED)
e_comp_canvas_update();
}
+static void
+_e_comp_canvas_prerender(Ecore_Evas *ee EINA_UNUSED)
+{
+ E_Comp_Cb cb;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb)
+ cb();
+}
+
E_API Eina_Bool
e_comp_canvas_init(int w, int h)
{
@@ -266,6 +276,7 @@ e_comp_canvas_init(int w, int h)
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_cb_screensaver_on, NULL);
E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_OFF, _e_comp_cb_screensaver_off, NULL);
+ ecore_evas_callback_pre_render_set(e_comp->ee, _e_comp_canvas_prerender);
ecore_evas_callback_resize_set(e_comp->ee, _e_comp_canvas_resize);
ecore_evas_resize(e_comp->ee, w, h);