unify client post_updates management code into single function

This commit is contained in:
Mike Blumenkrantz 2016-03-14 12:23:19 -04:00
parent fd816230c4
commit 885d24eeab
4 changed files with 16 additions and 21 deletions

View File

@ -1421,6 +1421,16 @@ e_comp_render_queue(void)
}
}
E_API void
e_comp_client_post_update_add(E_Client *ec)
{
if (ec->on_post_updates) return;
ec->on_post_updates = EINA_TRUE;
e_comp->post_updates = eina_list_append(e_comp->post_updates, ec);
REFD(ec, 111);
e_object_ref(E_OBJECT(ec));
}
E_API void
e_comp_shape_queue(void)
{

View File

@ -186,6 +186,7 @@ E_API E_Comp *e_comp_new(void);
E_API int e_comp_internal_save(void);
EINTERN int e_comp_shutdown(void);
E_API void e_comp_render_queue(void);
E_API void e_comp_client_post_update_add(E_Client *ec);
E_API void e_comp_shape_queue(void);
E_API void e_comp_shape_queue_block(Eina_Bool block);
E_API E_Comp_Config *e_comp_config_get(void);

View File

@ -901,10 +901,7 @@ _e_comp_object_pixels_get(void *data, Evas_Object *obj EINA_UNUSED)
if (cw->native)
{
E_FREE_FUNC(cw->pending_updates, eina_tiler_free);
cw->ec->on_post_updates = EINA_TRUE;
e_comp->post_updates = eina_list_append(e_comp->post_updates, cw->ec);
REFD(cw->ec, 111);
e_object_ref(E_OBJECT(cw->ec));
e_comp_client_post_update_add(cw->ec);
}
else if (e_comp_object_render(ec->frame))
{
@ -3818,12 +3815,7 @@ end:
eina_iterator_free(it);
E_FREE_FUNC(cw->pending_updates, eina_tiler_free);
if (ret)
{
cw->ec->on_post_updates = EINA_TRUE;
e_comp->post_updates = eina_list_append(e_comp->post_updates, cw->ec);
REFD(cw->ec, 111);
e_object_ref(E_OBJECT(cw->ec));
}
e_comp_client_post_update_add(cw->ec);
return ret;
}

View File

@ -141,17 +141,9 @@ _e_comp_wl_evas_cb_hide(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EIN
e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
e_comp_object_dirty(ec->frame);
if (!e_comp_object_render(ec->frame))
{
e_object_unref(E_OBJECT(ec));
return;
}
if (!ec->on_post_updates)
{
ec->on_post_updates = EINA_TRUE;
e_comp->post_updates = eina_list_append(e_comp->post_updates, ec);
}
else e_object_unref(E_OBJECT(ec));
if (e_comp_object_render(ec->frame))
e_comp_client_post_update_add(ec);
e_object_unref(E_OBJECT(ec));
}
static void