summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-12-22 20:46:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-01-17 14:35:27 +0900
commitc2ba0939d8df6b8f6bc076a75780d74f3e83a960 (patch)
treede39b3693ebe697f95dcb4d53132b323aa63e6b6 /src
parentb2a4039bda21989ab9f9316579750f48a83e052a (diff)
evas: Add a very simple post-render job list
This will be used by the filters
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_main.c10
-rw-r--r--src/lib/evas/canvas/evas_render.c32
-rw-r--r--src/lib/evas/include/evas_private.h13
3 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 912760cc60..2a75399e97 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -240,6 +240,7 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
240#undef EVAS_ARRAY_SET 240#undef EVAS_ARRAY_SET
241 eina_lock_new(&(e->lock_objects)); 241 eina_lock_new(&(e->lock_objects));
242 eina_spinlock_new(&(e->render.lock)); 242 eina_spinlock_new(&(e->render.lock));
243 eina_spinlock_new(&(e->post_render.lock));
243 244
244 _evas_canvas_event_init(eo_obj, e); 245 _evas_canvas_event_init(eo_obj, e);
245 246
@@ -266,6 +267,7 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
266{ 267{
267 Eina_Rectangle *r; 268 Eina_Rectangle *r;
268 Evas_Coord_Touch_Point *touch_point; 269 Evas_Coord_Touch_Point *touch_point;
270 Evas_Post_Render_Job *job;
269 Evas_Layer *lay; 271 Evas_Layer *lay;
270 Evas_Out *evo; 272 Evas_Out *evo;
271 int i; 273 int i;
@@ -383,6 +385,13 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
383 eina_array_flush(&e->texts_unref_queue); 385 eina_array_flush(&e->texts_unref_queue);
384 eina_hash_free(e->focused_objects); 386 eina_hash_free(e->focused_objects);
385 387
388 EINA_INLIST_FREE(e->post_render.jobs, job)
389 {
390 e->post_render.jobs = (Evas_Post_Render_Job *)
391 eina_inlist_remove(EINA_INLIST_GET(e->post_render.jobs), EINA_INLIST_GET(job));
392 free(job);
393 }
394
386 EINA_LIST_FREE(e->touch_points, touch_point) 395 EINA_LIST_FREE(e->touch_points, touch_point)
387 free(touch_point); 396 free(touch_point);
388 397
@@ -397,6 +406,7 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
397 406
398 eina_lock_free(&(e->lock_objects)); 407 eina_lock_free(&(e->lock_objects));
399 eina_spinlock_free(&(e->render.lock)); 408 eina_spinlock_free(&(e->render.lock));
409 eina_spinlock_free(&(e->post_render.lock));
400 eina_hash_free(e->locks.masks); 410 eina_hash_free(e->locks.masks);
401 eina_hash_free(e->modifiers.masks); 411 eina_hash_free(e->modifiers.masks);
402 412
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index ba360ebdd5..c7b96883ec 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -3440,7 +3440,9 @@ evas_render_wakeup(Evas *eo_e)
3440 Render_Updates *ru; 3440 Render_Updates *ru;
3441 Eina_Bool haveup = EINA_FALSE; 3441 Eina_Bool haveup = EINA_FALSE;
3442 Eina_List *ret_updates = NULL; 3442 Eina_List *ret_updates = NULL;
3443 Evas_Post_Render_Job *job;
3443 Evas_Public_Data *evas; 3444 Evas_Public_Data *evas;
3445 Eina_Inlist *jobs_il;
3444 3446
3445 evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 3447 evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
3446 3448
@@ -3483,6 +3485,18 @@ evas_render_wakeup(Evas *eo_e)
3483 eina_array_foreach(&evas->texts_unref_queue, _drop_texts_ref, NULL); 3485 eina_array_foreach(&evas->texts_unref_queue, _drop_texts_ref, NULL);
3484 eina_array_clean(&evas->texts_unref_queue); 3486 eina_array_clean(&evas->texts_unref_queue);
3485 3487
3488 SLKL(evas->post_render.lock);
3489 jobs_il = EINA_INLIST_GET(evas->post_render.jobs);
3490 evas->post_render.jobs = NULL;
3491 SLKU(evas->post_render.lock);
3492 EINA_INLIST_FREE(jobs_il, job)
3493 {
3494 jobs_il = eina_inlist_remove(jobs_il, EINA_INLIST_GET(job));
3495 if (job->func)
3496 job->func(job->data);
3497 free(job);
3498 }
3499
3486 /* post rendering */ 3500 /* post rendering */
3487 _rendering_evases = eina_list_remove(_rendering_evases, evas); 3501 _rendering_evases = eina_list_remove(_rendering_evases, evas);
3488 evas->rendering = EINA_FALSE; 3502 evas->rendering = EINA_FALSE;
@@ -3864,5 +3878,23 @@ evas_unref_queue_texts_put(Evas_Public_Data *pd, void *texts)
3864 eina_array_push(&pd->texts_unref_queue, texts); 3878 eina_array_push(&pd->texts_unref_queue, texts);
3865} 3879}
3866 3880
3881void
3882evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data)
3883{
3884 Evas_Post_Render_Job *job;
3885
3886 if (!pd || pd->delete_me) return;
3887 if (!func) return;
3888
3889 job = malloc(sizeof(*job));
3890 job->func = func;
3891 job->data = data;
3892
3893 SLKL(pd->post_render.lock);
3894 pd->post_render.jobs = (Evas_Post_Render_Job *)
3895 eina_inlist_append(EINA_INLIST_GET(pd->post_render.jobs), EINA_INLIST_GET(job));
3896 SLKU(pd->post_render.lock);
3897}
3898
3867/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 3899/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
3868 3900
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index b75ef49613..0d0d416e1e 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -817,6 +817,13 @@ struct _Evas_Pointer_Data
817 unsigned char inside : 1; 817 unsigned char inside : 1;
818}; 818};
819 819
820typedef struct _Evas_Post_Render_Job
821{
822 EINA_INLIST;
823 void (*func)(void *);
824 void *data;
825} Evas_Post_Render_Job;
826
820struct _Evas_Public_Data 827struct _Evas_Public_Data
821{ 828{
822 EINA_INLIST; 829 EINA_INLIST;
@@ -889,6 +896,11 @@ struct _Evas_Public_Data
889 Eina_Array glyph_unref_queue; 896 Eina_Array glyph_unref_queue;
890 Eina_Array texts_unref_queue; 897 Eina_Array texts_unref_queue;
891 898
899 struct {
900 Evas_Post_Render_Job *jobs;
901 Eina_Spinlock lock;
902 } post_render;
903
892 Eina_Clist calc_list; 904 Eina_Clist calc_list;
893 Eina_Clist calc_done; 905 Eina_Clist calc_done;
894 Eina_List *video_objects; 906 Eina_List *video_objects;
@@ -1714,6 +1726,7 @@ void _evas_object_textblock_rehint(Evas_Object *obj);
1714void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image); 1726void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image);
1715void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph); 1727void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph);
1716void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph); 1728void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph);
1729void evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data);
1717 1730
1718void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj, 1731void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
1719 void *data, void *context, void *surface, 1732 void *data, void *context, void *surface,