summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines
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
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 'src/modules/evas/engines')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c17
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c4
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c4
3 files changed, 14 insertions, 11 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 }
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 28be4be74b..5d0771a058 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1120,7 +1120,7 @@ eng_image_data_preload_request(void *engine EINA_UNUSED, void *image, const Eo *
1120} 1120}
1121 1121
1122static void 1122static void
1123eng_image_data_preload_cancel(void *engine EINA_UNUSED, void *image, const Eo *target) 1123eng_image_data_preload_cancel(void *engine EINA_UNUSED, void *image, const Eo *target, Eina_Bool force)
1124{ 1124{
1125 Evas_GL_Image *gim = image; 1125 Evas_GL_Image *gim = image;
1126 RGBA_Image *im; 1126 RGBA_Image *im;
@@ -1131,7 +1131,7 @@ eng_image_data_preload_cancel(void *engine EINA_UNUSED, void *image, const Eo *t
1131 if (!im) return; 1131 if (!im) return;
1132 1132
1133 evas_gl_common_image_preload_unwatch(gim); 1133 evas_gl_common_image_preload_unwatch(gim);
1134 evas_cache_image_preload_cancel(&im->cache_entry, target); 1134 evas_cache_image_preload_cancel(&im->cache_entry, target, force);
1135// if (gim->tex) evas_gl_preload_target_unregister(gim->tex, (Eo*) target); 1135// if (gim->tex) evas_gl_preload_target_unregister(gim->tex, (Eo*) target);
1136} 1136}
1137 1137
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 9c936944e2..c8f0ce2e0b 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -2214,13 +2214,13 @@ eng_image_data_preload_request(void *data EINA_UNUSED, void *image, const Eo *ta
2214} 2214}
2215 2215
2216static void 2216static void
2217eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const Eo *target) 2217eng_image_data_preload_cancel(void *data EINA_UNUSED, void *image, const Eo *target, Eina_Bool force)
2218{ 2218{
2219 RGBA_Image *im = image; 2219 RGBA_Image *im = image;
2220 2220
2221 if (!im) return; 2221 if (!im) return;
2222 2222
2223 evas_cache_image_preload_cancel(&im->cache_entry, target); 2223 evas_cache_image_preload_cancel(&im->cache_entry, target, force);
2224} 2224}
2225 2225
2226static void 2226static void