summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-04-28 16:06:29 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-28 16:11:23 -0700
commit19c65cdc8deaf8f91b1ca30f3b537f7bd32aef76 (patch)
tree94380e6b33c80000c134851e29fc7873f6c239fa /src/lib/ecore_evas
parent849a18201892d0a9d0d9c19cf01bbfeb4dae2bae (diff)
ecore_evas: make ecore_evas buffer asynchronous.
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c53
1 files changed, 42 insertions, 11 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index e2096eddd5..4de2ff08c1 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -14,6 +14,8 @@
14#include "ecore_evas_buffer.h" 14#include "ecore_evas_buffer.h"
15#include "ecore_evas_private.h" 15#include "ecore_evas_private.h"
16 16
17static void _evas_evas_buffer_rendered(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED);
18
17static void 19static void
18_ecore_evas_buffer_free(Ecore_Evas *ee) 20_ecore_evas_buffer_free(Ecore_Evas *ee)
19{ 21{
@@ -141,7 +143,7 @@ _ecore_evas_buffer_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
141static int 143static int
142_ecore_evas_buffer_render(Ecore_Evas *ee) 144_ecore_evas_buffer_render(Ecore_Evas *ee)
143{ 145{
144 Eina_List *updates = NULL, *ll; 146 Eina_List *ll;
145 Ecore_Evas_Engine_Buffer_Data *bdata; 147 Ecore_Evas_Engine_Buffer_Data *bdata;
146 Ecore_Evas *ee2; 148 Ecore_Evas *ee2;
147 int rend = 0; 149 int rend = 0;
@@ -172,17 +174,25 @@ _ecore_evas_buffer_render(Ecore_Evas *ee)
172 if (bdata->pixels) 174 if (bdata->pixels)
173 { 175 {
174 bdata->in_render = 1; 176 bdata->in_render = 1;
175 updates = evas_render_updates(ee->evas); 177 if (ee->can_async_render && !ee->manual_render)
176 bdata->in_render = 0; 178 {
177 } 179 rend |= !!evas_render_async(ee->evas);
178 if (updates) 180 }
179 { 181 else
180 evas_render_updates_free(updates); 182 {
181 } 183 Eina_List *updates;
182 184
183 if (ee->func.fn_post_render) ee->func.fn_post_render(ee); 185 updates = evas_render_updates(ee->evas);
186 rend |= !!updates;
187 evas_render_updates_free(updates);
188
189 // When there is no update, there is no RENDER_POST event
190 // Should we fix that here or in evas_render ?
191 if (!updates) _evas_evas_buffer_rendered(ee, NULL, NULL);
192 }
193 }
184 194
185 return updates ? 1 : rend; 195 return rend;
186} 196}
187 197
188static void 198static void
@@ -203,14 +213,29 @@ _ecore_evas_buffer_update_image(void *data, Evas *e EINA_UNUSED, void *event_inf
203static void 213static void
204_evas_evas_buffer_rendered(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) 214_evas_evas_buffer_rendered(void *data, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
205{ 215{
216 Ecore_Evas *ee = data;
217 Ecore_Evas_Engine_Buffer_Data *bdata = ee->engine.data;
218
206 _ecore_evas_idle_timeout_update(ee); 219 _ecore_evas_idle_timeout_update(ee);
220
221 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
222 bdata->in_render = 0;
207} 223}
208 224
209EAPI int 225EAPI int
210ecore_evas_buffer_render(Ecore_Evas *ee) 226ecore_evas_buffer_render(Ecore_Evas *ee)
211{ 227{
228 Ecore_Evas_Engine_Buffer_Data *bdata;
229 Eina_Bool async;
230 int r;
212 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, 0); 231 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, 0);
213 return _ecore_evas_buffer_render(ee); 232
233 bdata = ee->engine.data;
234 async = ee->can_async_render;
235 if (bdata->in_render) evas_sync(ee->evas);
236 r = _ecore_evas_buffer_render(ee);
237 ee->can_async_render = async;
238 return r;
214} 239}
215 240
216// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar! 241// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
@@ -784,6 +809,11 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
784 ee->req.h = ee->h; 809 ee->req.h = ee->h;
785 ee->profile_supported = 1; 810 ee->profile_supported = 1;
786 811
812 if (getenv("ECORE_EVAS_FORCE_SYNC_RENDER"))
813 ee->can_async_render = 0;
814 else
815 ee->can_async_render = 1;
816
787 ee->prop.max.w = 0; 817 ee->prop.max.w = 0;
788 ee->prop.max.h = 0; 818 ee->prop.max.h = 0;
789 ee->prop.layer = 0; 819 ee->prop.layer = 0;
@@ -930,6 +960,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
930 ee->req.w = ee->w; 960 ee->req.w = ee->w;
931 ee->req.h = ee->h; 961 ee->req.h = ee->h;
932 ee->profile_supported = 1; 962 ee->profile_supported = 1;
963 ee->can_async_render = 0;
933 964
934 ee->prop.max.w = 0; 965 ee->prop.max.w = 0;
935 ee->prop.max.h = 0; 966 ee->prop.max.h = 0;