summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r--src/lib/evas/canvas/evas_render.c91
1 files changed, 54 insertions, 37 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index a2d30daeb1..79f7a92091 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -100,7 +100,6 @@ rend_dbg(const char *txt)
100#undef ENDT 100#undef ENDT
101#undef ENC 101#undef ENC
102#define ENFN evas->engine.func 102#define ENFN evas->engine.func
103#define ENDT _evas_default_output_get(evas)
104#define ENC _evas_engine_context(evas) 103#define ENC _evas_engine_context(evas)
105 104
106typedef struct _Render_Updates Render_Updates; 105typedef struct _Render_Updates Render_Updates;
@@ -117,8 +116,10 @@ struct _Cutout_Margin
117 int l, r, t, b; 116 int l, r, t, b;
118}; 117};
119 118
119static void
120evas_render_pipe_wakeup(void *data);
120static Eina_Bool 121static Eina_Bool
121evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned char do_draw, Evas_Render_Done_Cb done_func, void *done_data, Eina_Bool do_async); 122evas_render_updates_internal(Evas *eo_e, unsigned char make_updates, unsigned char do_draw, Eina_Bool do_async);
122static void 123static void
123evas_render_mask_subrender(Evas_Public_Data *evas, 124evas_render_mask_subrender(Evas_Public_Data *evas,
124 void *output, 125 void *output,
@@ -3125,8 +3126,6 @@ static Eina_Bool
3125evas_render_updates_internal(Evas *eo_e, 3126evas_render_updates_internal(Evas *eo_e,
3126 unsigned char make_updates, 3127 unsigned char make_updates,
3127 unsigned char do_draw, 3128 unsigned char do_draw,
3128 Evas_Render_Done_Cb done_func,
3129 void *done_data,
3130 Eina_Bool do_async) 3129 Eina_Bool do_async)
3131{ 3130{
3132 // FIXME: handle multiple output 3131 // FIXME: handle multiple output
@@ -3484,7 +3483,7 @@ evas_render_updates_internal(Evas *eo_e,
3484 //XXX: need a way of reffing output surfaces 3483 //XXX: need a way of reffing output surfaces
3485 NEW_RECT(ru->area, ux, uy, uw, uh); 3484 NEW_RECT(ru->area, ux, uy, uw, uh);
3486 eina_spinlock_take(&(e->render.lock)); 3485 eina_spinlock_take(&(e->render.lock));
3487 e->render.updates = eina_list_append(e->render.updates, ru); 3486 out->updates = eina_list_append(out->updates, ru);
3488 eina_spinlock_release(&(e->render.lock)); 3487 eina_spinlock_release(&(e->render.lock));
3489 } 3488 }
3490 3489
@@ -3517,7 +3516,7 @@ evas_render_updates_internal(Evas *eo_e,
3517 e->rendering = EINA_TRUE; 3516 e->rendering = EINA_TRUE;
3518 _rendering_evases = eina_list_append(_rendering_evases, e); 3517 _rendering_evases = eina_list_append(_rendering_evases, e);
3519 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); 3518 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
3520 evas_thread_queue_flush((Evas_Thread_Command_Cb)done_func, done_data); 3519 evas_thread_queue_flush((Evas_Thread_Command_Cb)evas_render_pipe_wakeup, e);
3521 eina_evlog("-render_output_async_flush", eo_e, 0.0, NULL); 3520 eina_evlog("-render_output_async_flush", eo_e, 0.0, NULL);
3522 } 3521 }
3523 else 3522 else
@@ -3659,16 +3658,19 @@ evas_render_updates_internal(Evas *eo_e,
3659 if (!do_async || !rendering) 3658 if (!do_async || !rendering)
3660 { 3659 {
3661 Evas_Event_Render_Post post; 3660 Evas_Event_Render_Post post;
3662 Eina_List *l; 3661 Eina_List *l, *ll;
3663 Render_Updates *ru; 3662 Render_Updates *ru;
3664 3663
3665 nothing2render: 3664 nothing2render:
3666 post.updated_area = NULL; 3665 post.updated_area = NULL;
3667 EINA_LIST_FOREACH(e->render.updates, l, ru) 3666 EINA_LIST_FOREACH(e->outputs, ll, out)
3668 { 3667 {
3669 post.updated_area = eina_list_append(post.updated_area, ru->area); 3668 EINA_LIST_FOREACH(out->updates, l, ru)
3670 //XXX: need a way of unreffing output surfaces 3669 {
3671 ru->surface = NULL; 3670 post.updated_area = eina_list_append(post.updated_area, ru->area);
3671 //XXX: need a way of unreffing output surfaces
3672 ru->surface = NULL;
3673 }
3672 } 3674 }
3673 eina_spinlock_take(&(e->render.lock)); 3675 eina_spinlock_take(&(e->render.lock));
3674 e->inside_post_render = EINA_TRUE; 3676 e->inside_post_render = EINA_TRUE;
@@ -3710,20 +3712,24 @@ evas_render_wakeup(Evas *eo_e)
3710 Evas_Event_Render_Post post; 3712 Evas_Event_Render_Post post;
3711 Render_Updates *ru; 3713 Render_Updates *ru;
3712 Eina_Bool haveup = EINA_FALSE; 3714 Eina_Bool haveup = EINA_FALSE;
3713 Eina_List *ret_updates = NULL; 3715 Eina_List *ret_updates = NULL, *l;
3714 Evas_Post_Render_Job *job; 3716 Evas_Post_Render_Job *job;
3715 Evas_Public_Data *evas; 3717 Evas_Public_Data *evas;
3718 Efl_Canvas_Output *out;
3716 Eina_Inlist *jobs_il; 3719 Eina_Inlist *jobs_il;
3717 3720
3718 evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 3721 evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
3719 3722
3720 eina_evlog("+render_wakeup", eo_e, 0.0, NULL); 3723 eina_evlog("+render_wakeup", eo_e, 0.0, NULL);
3721 eina_spinlock_take(&(evas->render.lock)); 3724 eina_spinlock_take(&(evas->render.lock));
3722 EINA_LIST_FREE(evas->render.updates, ru) 3725 EINA_LIST_FOREACH(evas->outputs, l, out)
3723 { 3726 {
3724 ret_updates = eina_list_append(ret_updates, ru->area); 3727 EINA_LIST_FREE(out->updates, ru)
3725 free(ru); 3728 {
3726 haveup = EINA_TRUE; 3729 ret_updates = eina_list_append(ret_updates, ru->area);
3730 free(ru);
3731 haveup = EINA_TRUE;
3732 }
3727 } 3733 }
3728 eina_spinlock_release(&(evas->render.lock)); 3734 eina_spinlock_release(&(evas->render.lock));
3729 3735
@@ -3740,7 +3746,10 @@ evas_render_wakeup(Evas *eo_e)
3740 } 3746 }
3741 3747
3742 /* clear redraws */ 3748 /* clear redraws */
3743 ENFN->output_redraws_clear(ENC, ENDT); 3749 EINA_LIST_FOREACH(evas->outputs, l, out)
3750 {
3751 ENFN->output_redraws_clear(ENC, out->output);
3752 }
3744 3753
3745 /* unref queues */ 3754 /* unref queues */
3746 eina_array_foreach(&evas->scie_unref_queue, _drop_scie_ref, NULL); 3755 eina_array_foreach(&evas->scie_unref_queue, _drop_scie_ref, NULL);
@@ -3800,26 +3809,30 @@ evas_render_async_wakeup(void *target, Evas_Callback_Type type EINA_UNUSED, void
3800static void 3809static void
3801evas_render_pipe_wakeup(void *data) 3810evas_render_pipe_wakeup(void *data)
3802{ 3811{
3803 Eina_List *l; 3812 Eina_List *l, *ll;
3804 Render_Updates *ru; 3813 Render_Updates *ru;
3805 Evas_Public_Data *evas = data; 3814 Evas_Public_Data *evas = data;
3815 Efl_Canvas_Output *out;
3806 3816
3807 eina_evlog("+render_pipe_wakeup", evas->evas, 0.0, NULL); 3817 eina_evlog("+render_pipe_wakeup", evas->evas, 0.0, NULL);
3808 eina_spinlock_take(&(evas->render.lock)); 3818 eina_spinlock_take(&(evas->render.lock));
3809 EINA_LIST_FOREACH(evas->render.updates, l, ru) 3819 EINA_LIST_FOREACH(evas->outputs, ll, out)
3810 { 3820 {
3811 eina_evlog("+render_push", evas->evas, 0.0, NULL); 3821 EINA_LIST_FOREACH(out->updates, l, ru)
3812 ENFN->output_redraws_next_update_push 3822 {
3813 (ENC, ENDT, ru->surface, ru->area->x, ru->area->y, ru->area->w, ru->area->h, 3823 eina_evlog("+render_push", evas->evas, 0.0, NULL);
3814 EVAS_RENDER_MODE_ASYNC_END); 3824 ENFN->output_redraws_next_update_push
3815 eina_evlog("-render_push", evas->evas, 0.0, NULL); 3825 (ENC, out->output, ru->surface, ru->area->x, ru->area->y, ru->area->w, ru->area->h,
3816 //XXX: need a way to unref render output surfaces 3826 EVAS_RENDER_MODE_ASYNC_END);
3817 ru->surface = NULL; 3827 eina_evlog("-render_push", evas->evas, 0.0, NULL);
3828 //XXX: need a way to unref render output surfaces
3829 ru->surface = NULL;
3830 }
3831 eina_evlog("+render_output_flush", evas->evas, 0.0, NULL);
3832 ENFN->output_flush(ENC, out->output, EVAS_RENDER_MODE_ASYNC_END);
3833 eina_evlog("-render_output_flush", evas->evas, 0.0, NULL);
3818 } 3834 }
3819 eina_evlog("+render_output_flush", evas->evas, 0.0, NULL);
3820 eina_spinlock_release(&(evas->render.lock)); 3835 eina_spinlock_release(&(evas->render.lock));
3821 ENFN->output_flush(ENC, ENDT, EVAS_RENDER_MODE_ASYNC_END);
3822 eina_evlog("-render_output_flush", evas->evas, 0.0, NULL);
3823 evas_async_events_put(data, 0, NULL, evas_render_async_wakeup); 3836 evas_async_events_put(data, 0, NULL, evas_render_async_wakeup);
3824 eina_evlog("-render_pipe_wakeup", evas->evas, 0.0, NULL); 3837 eina_evlog("-render_pipe_wakeup", evas->evas, 0.0, NULL);
3825} 3838}
@@ -3863,8 +3876,7 @@ _evas_canvas_render_async(Eo *eo_e, Evas_Public_Data *e)
3863 evas_canvas_async_block(e); 3876 evas_canvas_async_block(e);
3864 eina_evlog("-render_block", eo_e, 0.0, NULL); 3877 eina_evlog("-render_block", eo_e, 0.0, NULL);
3865 eina_evlog("+render", eo_e, 0.0, NULL); 3878 eina_evlog("+render", eo_e, 0.0, NULL);
3866 ret = evas_render_updates_internal(eo_e, 1, 1, evas_render_pipe_wakeup, 3879 ret = evas_render_updates_internal(eo_e, 1, 1, EINA_TRUE);
3867 e, EINA_TRUE);
3868 eina_evlog("-render", eo_e, 0.0, NULL); 3880 eina_evlog("-render", eo_e, 0.0, NULL);
3869 return ret; 3881 return ret;
3870} 3882}
@@ -3874,19 +3886,24 @@ evas_render_updates_internal_wait(Evas *eo_e,
3874 unsigned char make_updates, 3886 unsigned char make_updates,
3875 unsigned char do_draw) 3887 unsigned char do_draw)
3876{ 3888{
3877 Eina_List *ret = NULL; 3889 Eina_List *ret = NULL, *l;
3878 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 3890 Efl_Canvas_Output *out;
3891 Evas_Public_Data *e;
3892
3893 e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
3879 if (e->render2) return _evas_render2_updates_wait(eo_e, e); 3894 if (e->render2) return _evas_render2_updates_wait(eo_e, e);
3880 else 3895 else
3881 { 3896 {
3882 if (!evas_render_updates_internal(eo_e, make_updates, do_draw, NULL, 3897 if (!evas_render_updates_internal(eo_e, make_updates, do_draw, EINA_FALSE))
3883 NULL, EINA_FALSE))
3884 return NULL; 3898 return NULL;
3885 } 3899 }
3886 3900
3887 eina_spinlock_take(&(e->render.lock)); 3901 eina_spinlock_take(&(e->render.lock));
3888 ret = e->render.updates; 3902 EINA_LIST_FOREACH(e->outputs, l, out)
3889 e->render.updates = NULL; 3903 {
3904 ret = eina_list_merge(ret, out->updates);
3905 out->updates = NULL;
3906 }
3890 eina_spinlock_release(&(e->render.lock)); 3907 eina_spinlock_release(&(e->render.lock));
3891 3908
3892 return ret; 3909 return ret;