From e8cc9680d06337d480f3e71e80e9d495dd5800cd Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Wed, 9 Jan 2013 21:39:06 +0000 Subject: [PATCH] efl/software_generic: Fix map/image drawing with Cserve2 We must check whether source image has been loaded or not before enqueueing draw commands. Otherwise, cserve2 may not have a specific loader and then it does not load the source image and the enqueued draw commands dereference the NULL pointer "data" from source image. Patch by: Paulo Alcantara SVN revision: 82483 --- .../evas/engines/software_generic/evas_engine.c | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index 7652259..93754b6 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -1275,6 +1275,8 @@ eng_image_draw(void *data EINA_UNUSED, void *context, void *surface, void *image else #endif evas_cache_image_load_data(&im->cache_entry); + + if (!im->cache_entry.flags.loaded) return; } evas_common_image_colorspace_normalize(im); @@ -1609,14 +1611,35 @@ evas_software_image_map_draw(void *data, void *context, RGBA_Image *surface, RGB static void eng_image_map_draw(void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async) { - if (!image) return; + RGBA_Image *im = image; + + if (!im) return; if (m->count < 3) return; if (do_async) - evas_common_map_thread_rgba_cb(image, surface, context, - m, smooth, level, 0, _map_draw_thread_cmd); + { + /* Since the thread that'll draw the map won't call eng_image_draw() + * (which sends the load request of source image to Cserve2) - we need + * to send the load request here before enqueueing thread command. + */ + if (im->cache_entry.space == EVAS_COLORSPACE_ARGB8888) + { +#if EVAS_CSERVE2 + if (evas_cserve2_use_get()) + evas_cache2_image_load_data(&im->cache_entry); + else +#endif + evas_cache_image_load_data(&im->cache_entry); + + if (!im->cache_entry.flags.loaded) return; + } + + evas_common_map_thread_rgba_cb(im, surface, context, + m, smooth, level, 0, + _map_draw_thread_cmd); + } else - evas_software_image_map_draw(data, context, surface, image, m, + evas_software_image_map_draw(data, context, surface, im, m, smooth, level, 0, do_async); } -- 2.7.4