evas image: fix a bug in image preloading.
authorHermet Park <hermetpark@gmail.com>
Mon, 3 Sep 2018 06:19:02 +0000 (15:19 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Fri, 7 Sep 2018 06:58:18 +0000 (15:58 +0900)
commitb86028790be13a5f3fa84708de0719532dc73fce
tree7dd869e96c87216e61f04f17aeafd3c890c3a5b1
parent7eabaa2a9f79bfb366c935ea3a726582f3922249
evas image: fix a bug in image preloading.

Summary:
Current preloading is too buggy since it's on thread-based.
This is a fundamental improvement to fix a bug.

The critical issue here is,
When preloading img object suddenly cancel its preloading,
the object possibly cannot render image next then because
renderer doesn't have any idea when async cancelling is
finished. Renderer just tries to render regardless of
image loading status, and this could occur no-texture(in gl case)
image object.

So, here improvement is, adding a notification for async cancelled
so that putting img objects to redraw images properly after their preloading is
cancelled.

The best scenario to reproduce this bug is this one.

Evas_Object *img2 = evas_object_image_filled_add(evas);
evas_object_image_file_set(img2, "test.jpg", NULL);
evas_object_image_preload(img2, EINA_FALSE);
evas_object_resize(img2, 200, 200);
evas_object_show(img2);

Evas_Object *img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.jpg", NULL);
evas_object_image_preload(img, EINA_FALSE);
evas_object_move(img, 200, 200);
evas_object_resize(img, 200, 200);
evas_object_show(img);

evas_object_image_preload(img2, EINA_TRUE);
If you run this on gl backend, occasionally happens rendering fail.

Yet there other bugs on preloading feature....

@fix

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6919
12 files changed:
src/lib/evas/cache/evas_cache.h
src/lib/evas/cache/evas_cache_image.c
src/lib/evas/canvas/efl_canvas_image.c
src/lib/evas/canvas/evas_image_legacy.c
src/lib/evas/canvas/evas_image_private.h
src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_object_inform.c
src/lib/evas/include/evas_common_private.h
src/lib/evas/include/evas_private.h
src/modules/evas/engines/gl_common/evas_gl_image.c
src/modules/evas/engines/gl_generic/evas_engine.c
src/modules/evas/engines/software_generic/evas_engine.c