summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_image.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-09-03 15:19:02 +0900
committerHermet Park <hermetpark@gmail.com>2018-09-03 17:12:55 +0900
commit423d8a22961436299df0feca17b03544678b8c0f (patch)
tree6a0155fa02da114802d671cd96fd43c427b0a555 /src/modules/evas/engines/gl_common/evas_gl_image.c
parent4e0b2c2fff72706d302363a604428e5b5342caf9 (diff)
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
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 3aa40ead42..9ea18e5306 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -793,7 +793,6 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
793 } 793 }
794 else 794 else
795 */ 795 */
796
797 switch (im->cs.space) 796 switch (im->cs.space)
798 { 797 {
799 case EVAS_COLORSPACE_ARGB8888: 798 case EVAS_COLORSPACE_ARGB8888:
@@ -811,13 +810,15 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
811 if ((im->tex) && 810 if ((im->tex) &&
812 ((im->dirty) || (ie->animated.animated) || (ie->flags.updated_data))) 811 ((im->dirty) || (ie->animated.animated) || (ie->flags.updated_data)))
813 { 812 {
814 evas_cache_image_load_data(ie); 813 ie->load_error = evas_cache_image_load_data(ie);
815 evas_gl_common_texture_update(im->tex, im->im); 814 evas_gl_common_texture_update(im->tex, im->im);
816 evas_cache_image_unload_data(ie); 815 evas_cache_image_unload_data(ie);
817 } 816 }
818 else if (!im->tex && !ie->load_error) 817 else if (!im->tex &&
818 ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) ||
819 (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED)))
819 { 820 {
820 evas_cache_image_load_data(ie); 821 ie->load_error = evas_cache_image_load_data(ie);
821 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas); 822 im->tex = evas_gl_common_texture_new(gc, im->im, im->disable_atlas);
822 evas_cache_image_unload_data(ie); 823 evas_cache_image_unload_data(ie);
823 } 824 }
@@ -827,13 +828,15 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
827 case EVAS_COLORSPACE_ETC1_ALPHA: 828 case EVAS_COLORSPACE_ETC1_ALPHA:
828 if ((im->tex) && (im->dirty)) 829 if ((im->tex) && (im->dirty))
829 { 830 {
830 evas_cache_image_load_data(ie); 831 ie->load_error = evas_cache_image_load_data(ie);
831 evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im); 832 evas_gl_common_texture_rgb_a_pair_update(im->tex, im->im);
832 evas_cache_image_unload_data(ie); 833 evas_cache_image_unload_data(ie);
833 } 834 }
834 else if (!im->tex && !ie->load_error) 835 else if (!im->tex &&
836 ((ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_NONE) ||
837 (ie->load_error == EFL_GFX_IMAGE_LOAD_ERROR_CANCELLED)))
835 { 838 {
836 evas_cache_image_load_data(ie); 839 ie->load_error = evas_cache_image_load_data(ie);
837 im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im); 840 im->tex = evas_gl_common_texture_rgb_a_pair_new(gc, im->im);
838 evas_cache_image_unload_data(ie); 841 evas_cache_image_unload_data(ie);
839 } 842 }