From e5c36a65bc14820ab3053411665ee8d4cff5d498 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Mon, 25 May 2020 14:48:31 +0900 Subject: [PATCH] evas image: reload after alpha_set Summary: The alpha_set cancels preload, and do not try to load it again. So the image is not showing, if the alpha_set is called while preloading. [Sample] Evas_Object *image = elm_image_add(box); elm_box_pack_end(box, image); evas_object_show(image); elm_image_file_set(image, "img.png", NULL); // start preloading Evas_Object *eimg = elm_image_object_get(image); evas_object_image_alpha_set(eimg, EINA_TRUE); // cancel preloading Reviewers: Hermet, jsuya, herb Reviewed By: Hermet Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11864 --- src/lib/evas/canvas/evas_object_image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index e907d37..3f78f5b 100755 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1163,6 +1163,10 @@ _efl_canvas_image_internal_efl_gfx_buffer_alpha_set(Eo *eo_obj, Evas_Image_Data { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + has_alpha = !!has_alpha; + if (has_alpha == o->cur->has_alpha) + return; + evas_object_async_block(obj); if ((o->preload & EVAS_IMAGE_PRELOADING) && (o->engine_data)) { @@ -1170,10 +1174,6 @@ _efl_canvas_image_internal_efl_gfx_buffer_alpha_set(Eo *eo_obj, Evas_Image_Data ENFN->image_data_preload_cancel(ENC, o->engine_data, eo_obj, EINA_TRUE); } - has_alpha = !!has_alpha; - if (has_alpha == o->cur->has_alpha) - return; - EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) { state_write->has_alpha = has_alpha; -- 2.7.4