From c368c8c27b7d7ffa55a1413e54e5f7a99487833c Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Tue, 4 Sep 2012 08:42:38 +0000 Subject: [PATCH] evas/evas_object_image - clean the code SVN revision: 76114 --- .../evas/src/lib/canvas/evas_object_image.c | 790 +++++++++--------- 1 file changed, 375 insertions(+), 415 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c index 884773b208..ebb863ff47 100644 --- a/legacy/evas/src/lib/canvas/evas_object_image.c +++ b/legacy/evas/src/lib/canvas/evas_object_image.c @@ -32,12 +32,12 @@ struct _Evas_Object_Image int spread; Evas_Coord_Rectangle fill; struct { - short w, h, stride; + short w, h, stride; } image; struct { - short l, r, t, b; - unsigned char fill; - double scale; + short l, r, t, b; + unsigned char fill; + double scale; } border; Evas_Object *source; @@ -182,8 +182,7 @@ evas_object_image_add(Evas *e) evas_object_image_init(obj); evas_object_inject(obj, e); o = (Evas_Object_Image *)(obj->object_data); - o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, - o->engine_data); + o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, o->engine_data); return obj; } @@ -235,7 +234,7 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) if (fd < 0) { const char *tmpdir = getenv("TMPDIR"); - + if (!tmpdir) { tmpdir = getenv("TMP"); @@ -245,7 +244,7 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) if (!tmpdir) tmpdir = "/tmp"; } } - snprintf(buf, sizeof(buf), "%s/.evas-tmpf-%i-%p-%i-XXXXXX", + snprintf(buf, sizeof(buf), "%s/.evas-tmpf-%i-%p-%i-XXXXXX", tmpdir, (int)getpid(), data, (int)size); fd = mkstemp(buf); if (fd < 0) return; @@ -259,12 +258,12 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) #ifdef __linux__ unlink(buf); #endif - + eina_mmap_safety_enabled_set(EINA_TRUE); - - dst = mmap(NULL, size, - PROT_READ | PROT_WRITE, - MAP_SHARED, + + dst = mmap(NULL, size, + PROT_READ | PROT_WRITE, + MAP_SHARED, fd, 0); if (dst == MAP_FAILED) { @@ -332,14 +331,14 @@ evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) if ((o->tmpf) && (file != o->tmpf)) _cleanup_tmpf(obj); if ((o->cur.file) && (file) && (!strcmp(o->cur.file, file))) { - if ((!o->cur.key) && (!key)) - return; - if ((o->cur.key) && (key) && (!strcmp(o->cur.key, key))) - return; + if ((!o->cur.key) && (!key)) + return; + if ((o->cur.key) && (key) && (!strcmp(o->cur.key, key))) + return; } -/* - * WTF? why cancel a null image preload? this is just silly (tm) - if (!o->engine_data) + /* + * WTF? why cancel a null image preload? this is just silly (tm) + if (!o->engine_data) obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, obj); @@ -358,12 +357,9 @@ evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) if (o->preloading) { o->preloading = 0; - obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, - o->engine_data, - obj); + obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, obj); } - obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, - o->engine_data); + obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); } o->load_error = EVAS_LOAD_ERROR_NONE; lo.scale_down_by = o->load_opts.scale_down_by; @@ -376,39 +372,35 @@ evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) lo.region.h = o->load_opts.region.h; lo.orientation = o->load_opts.orientation; o->engine_data = obj->layer->evas->engine.func->image_load(obj->layer->evas->engine.data.output, - o->cur.file, - o->cur.key, - &o->load_error, - &lo); + o->cur.file, + o->cur.key, + &o->load_error, + &lo); if (o->engine_data) { - int w, h; - int stride; + int w, h; + int stride; - obj->layer->evas->engine.func->image_size_get(obj->layer->evas->engine.data.output, - o->engine_data, &w, &h); - if (obj->layer->evas->engine.func->image_stride_get) - obj->layer->evas->engine.func->image_stride_get(obj->layer->evas->engine.data.output, - o->engine_data, &stride); - else - stride = w * 4; - o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get(obj->layer->evas->engine.data.output, - o->engine_data); - o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, - o->engine_data); - o->cur.image.w = w; - o->cur.image.h = h; - o->cur.image.stride = stride; + obj->layer->evas->engine.func->image_size_get(obj->layer->evas->engine.data.output, o->engine_data, &w, &h); + if (obj->layer->evas->engine.func->image_stride_get) + obj->layer->evas->engine.func->image_stride_get(obj->layer->evas->engine.data.output, o->engine_data, &stride); + else + stride = w * 4; + o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get(obj->layer->evas->engine.data.output, o->engine_data); + o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, o->engine_data); + o->cur.image.w = w; + o->cur.image.h = h; + o->cur.image.stride = stride; } else { - if (o->load_error == EVAS_LOAD_ERROR_NONE) - o->load_error = EVAS_LOAD_ERROR_GENERIC; - o->cur.has_alpha = 1; - o->cur.cspace = EVAS_COLORSPACE_ARGB8888; - o->cur.image.w = 0; - o->cur.image.h = 0; - o->cur.image.stride = 0; + if (o->load_error == EVAS_LOAD_ERROR_NONE) + o->load_error = EVAS_LOAD_ERROR_GENERIC; + o->cur.has_alpha = 1; + o->cur.cspace = EVAS_COLORSPACE_ARGB8888; + o->cur.image.w = 0; + o->cur.image.h = 0; + o->cur.image.stride = 0; } o->changed = 1; evas_object_change(obj); @@ -618,15 +610,18 @@ evas_object_image_filled_set(Evas_Object *obj, Eina_Bool setting) o->filled = setting; if (!o->filled) - evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, evas_object_image_filled_resize_listener); + evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, + evas_object_image_filled_resize_listener); else { - Evas_Coord w, h; + Evas_Coord w, h; - evas_object_geometry_get(obj, NULL, NULL, &w, &h); - evas_object_image_fill_set(obj, 0, 0, w, h); + evas_object_geometry_get(obj, NULL, NULL, &w, &h); + evas_object_image_fill_set(obj, 0, 0, w, h); - evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, evas_object_image_filled_resize_listener, NULL); + evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, + evas_object_image_filled_resize_listener, + NULL); } } @@ -793,9 +788,7 @@ evas_object_image_size_set(Evas_Object *obj, int w, int h) o->cur.image.w = w; o->cur.image.h = h; if (o->engine_data) - o->engine_data = obj->layer->evas->engine.func->image_size_set(obj->layer->evas->engine.data.output, - o->engine_data, - w, h); + o->engine_data = obj->layer->evas->engine.func->image_size_set(obj->layer->evas->engine.data.output, o->engine_data, w, h); else o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data (obj->layer->evas->engine.data.output, w, h, NULL, o->cur.has_alpha, @@ -900,25 +893,18 @@ evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) if ((o->preloading) && (o->engine_data)) { o->preloading = 0; - obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, - o->engine_data, - obj); + obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, obj); } if (!o->engine_data) return NULL; if (o->video_surface) o->video.update_pixels(o->video.data, obj, &o->video); if (o->cur.cspace == to_cspace) return NULL; data = NULL; - o->engine_data = - obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, - o->engine_data, 0, &data, - &o->load_error); + o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, 0, &data, &o->load_error); result = evas_object_image_data_convert_internal(o, data, to_cspace); if (o->engine_data) { - o->engine_data = - obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, - o->engine_data, data); + o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, data); } return result; @@ -940,17 +926,17 @@ evas_object_image_data_set(Evas_Object *obj, void *data) p_data = o->engine_data; if (data) { - if (o->engine_data) + if (o->engine_data) { - o->engine_data = + o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, data); } - else + else { - o->engine_data = - obj->layer->evas->engine.func->image_new_from_data(obj->layer->evas->engine.data.output, + o->engine_data = + obj->layer->evas->engine.func->image_new_from_data(obj->layer->evas->engine.data.output, o->cur.image.w, o->cur.image.h, data, @@ -960,7 +946,7 @@ evas_object_image_data_set(Evas_Object *obj, void *data) if (o->engine_data) { int stride = 0; - + if (obj->layer->evas->engine.func->image_scale_hint_set) obj->layer->evas->engine.func->image_scale_hint_set (obj->layer->evas->engine.data.output, @@ -968,7 +954,7 @@ evas_object_image_data_set(Evas_Object *obj, void *data) if (obj->layer->evas->engine.func->image_content_hint_set) obj->layer->evas->engine.func->image_content_hint_set (obj->layer->evas->engine.data.output, - o->engine_data, o->content_hint); + o->engine_data, o->content_hint); if (obj->layer->evas->engine.func->image_stride_get) obj->layer->evas->engine.func->image_stride_get (obj->layer->evas->engine.data.output, @@ -980,14 +966,13 @@ evas_object_image_data_set(Evas_Object *obj, void *data) } else { - if (o->engine_data) - obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, - o->engine_data); - o->load_error = EVAS_LOAD_ERROR_NONE; - o->cur.image.w = 0; - o->cur.image.h = 0; - o->cur.image.stride = 0; - o->engine_data = NULL; + if (o->engine_data) + obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); + o->load_error = EVAS_LOAD_ERROR_NONE; + o->cur.image.w = 0; + o->cur.image.h = 0; + o->cur.image.stride = 0; + o->engine_data = NULL; } /* FIXME - in engine call above if (o->engine_data) @@ -998,8 +983,8 @@ evas_object_image_data_set(Evas_Object *obj, void *data) if (o->pixels_checked_out > 0) o->pixels_checked_out--; if (p_data != o->engine_data) { - EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o); - o->pixels_checked_out = 0; + EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o); + o->pixels_checked_out = 0; } o->changed = 1; evas_object_change(obj); @@ -1029,11 +1014,7 @@ evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) obj->layer->evas->engine.func->image_content_hint_set (obj->layer->evas->engine.data.output, o->engine_data, o->content_hint); - o->engine_data = - obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, - o->engine_data, - for_writing, &data, - &o->load_error); + o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, for_writing, &data, &o->load_error); /* if we fail to get engine_data, we have to return NULL */ if (!o->engine_data) return NULL; @@ -1053,7 +1034,7 @@ evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) o->pixels_checked_out++; if (for_writing) { - EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o); + EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o); } return data; @@ -1074,8 +1055,8 @@ evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel) if (!o->engine_data) { o->preloading = 1; - evas_object_inform_call_image_preloaded(obj); - return; + evas_object_inform_call_image_preloaded(obj); + return; } // FIXME: if already busy preloading, then dont request again until // preload done @@ -1119,8 +1100,8 @@ evas_object_image_data_copy_set(Evas_Object *obj, void *data) (o->cur.image.h <= 0)) return; if (o->engine_data) obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, - o->engine_data); - o->engine_data = + o->engine_data); + o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data(obj->layer->evas->engine.data.output, o->cur.image.w, o->cur.image.h, @@ -1131,7 +1112,7 @@ evas_object_image_data_copy_set(Evas_Object *obj, void *data) { int stride = 0; - o->engine_data = + o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, o->engine_data, o->cur.has_alpha); @@ -1327,28 +1308,24 @@ evas_object_image_save(const Evas_Object *obj, const char *file, const char *key MAGIC_CHECK_END(); if (!o->engine_data) return 0; - o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, - o->engine_data, - 0, - &data, - &o->load_error); + o->engine_data = obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, 0, &data, &o->load_error); if (flags) { - char *p, *pp; - char *tflags; + char *p, *pp; + char *tflags; - tflags = alloca(strlen(flags) + 1); - strcpy(tflags, flags); - p = tflags; - while (p) - { - pp = strchr(p, ' '); - if (pp) *pp = 0; - sscanf(p, "quality=%i", &quality); - sscanf(p, "compress=%i", &compress); - if (pp) p = pp + 1; - else break; - } + tflags = alloca(strlen(flags) + 1); + strcpy(tflags, flags); + p = tflags; + while (p) + { + pp = strchr(p, ' '); + if (pp) *pp = 0; + sscanf(p, "quality=%i", &quality); + sscanf(p, "compress=%i", &compress); + if (pp) p = pp + 1; + else break; + } } im = (RGBA_Image*) evas_cache_image_data(evas_common_image_cache_get(), o->cur.image.w, @@ -1358,21 +1335,21 @@ evas_object_image_save(const Evas_Object *obj, const char *file, const char *key EVAS_COLORSPACE_ARGB8888); if (im) { - if (o->cur.cspace == EVAS_COLORSPACE_ARGB8888) - im->image.data = data; - else - im->image.data = evas_object_image_data_convert_internal(o, - data, - EVAS_COLORSPACE_ARGB8888); - if (im->image.data) - { - ok = evas_common_save_image_to_file(im, file, key, quality, compress); + if (o->cur.cspace == EVAS_COLORSPACE_ARGB8888) + im->image.data = data; + else + im->image.data = evas_object_image_data_convert_internal(o, + data, + EVAS_COLORSPACE_ARGB8888); + if (im->image.data) + { + ok = evas_common_save_image_to_file(im, file, key, quality, compress); - if (o->cur.cspace != EVAS_COLORSPACE_ARGB8888) - free(im->image.data); - } + if (o->cur.cspace != EVAS_COLORSPACE_ARGB8888) + free(im->image.data); + } - evas_cache_image_drop(&im->cache_entry); + evas_cache_image_drop(&im->cache_entry); } o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, @@ -1429,41 +1406,30 @@ evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixe #endif #ifdef BUILD_CONVERT_YUV case EVAS_PIXEL_FORMAT_YUV420P_601: - { - if (o->engine_data) - { - DATA32 *image_pixels = NULL; + { + if (o->engine_data) + { + DATA32 *image_pixels = NULL; - o->engine_data = - obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, - o->engine_data, - 1, - &image_pixels, - &o->load_error); - if (image_pixels) - evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows, - (DATA8 *) image_pixels, - o->cur.image.w, - o->cur.image.h); - if (o->engine_data) - o->engine_data = - obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, - o->engine_data, - image_pixels); - if (o->engine_data) - o->engine_data = - obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, - o->engine_data, - o->cur.has_alpha); - o->changed = 1; - evas_object_change(obj); - } - } - break; + o->engine_data = + obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, 1, &image_pixels,&o->load_error); + if (image_pixels) + evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur.image.w, o->cur.image.h); + if (o->engine_data) + o->engine_data = + obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, image_pixels); + if (o->engine_data) + o->engine_data = + obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, o->engine_data, o->cur.has_alpha); + o->changed = 1; + evas_object_change(obj); + } + } + break; #endif default: - return 0; - break; + return 0; + break; } return 1; } @@ -1534,11 +1500,11 @@ evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) o->load_opts.dpi = dpi; if (o->cur.file) { - evas_object_image_unload(obj, 0); + evas_object_image_unload(obj, 0); evas_object_inform_call_image_unloaded(obj); - evas_object_image_load(obj); - o->changed = 1; - evas_object_change(obj); + evas_object_image_load(obj); + o->changed = 1; + evas_object_change(obj); } } @@ -1574,11 +1540,11 @@ evas_object_image_load_size_set(Evas_Object *obj, int w, int h) o->load_opts.h = h; if (o->cur.file) { - evas_object_image_unload(obj, 0); + evas_object_image_unload(obj, 0); evas_object_inform_call_image_unloaded(obj); - evas_object_image_load(obj); - o->changed = 1; - evas_object_change(obj); + evas_object_image_load(obj); + o->changed = 1; + evas_object_change(obj); } } @@ -1614,11 +1580,11 @@ evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) o->load_opts.scale_down_by = scale_down; if (o->cur.file) { - evas_object_image_unload(obj, 0); + evas_object_image_unload(obj, 0); evas_object_inform_call_image_unloaded(obj); - evas_object_image_load(obj); - o->changed = 1; - evas_object_change(obj); + evas_object_image_load(obj); + o->changed = 1; + evas_object_change(obj); } } @@ -1657,11 +1623,11 @@ evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) o->load_opts.region.h = h; if (o->cur.file) { - evas_object_image_unload(obj, 0); + evas_object_image_unload(obj, 0); evas_object_inform_call_image_unloaded(obj); - evas_object_image_load(obj); - o->changed = 1; - evas_object_change(obj); + evas_object_image_load(obj); + o->changed = 1; + evas_object_change(obj); } } @@ -1730,9 +1696,7 @@ evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) o->cur.cspace = cspace; if (o->engine_data) - obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas->engine.data.output, - o->engine_data, - cspace); + obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas->engine.data.output, o->engine_data, cspace); } EAPI Evas_Colorspace @@ -1766,35 +1730,35 @@ evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf) if (o->video_surface) { o->video_surface = 0; - obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj); + obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj); } if (surf) { if (surf->version != EVAS_VIDEO_SURFACE_VERSION) return ; - if (!surf->update_pixels || - !surf->move || - !surf->resize || - !surf->hide || - !surf->show) - return ; + if (!surf->update_pixels || + !surf->move || + !surf->resize || + !surf->hide || + !surf->show) + return ; o->created = EINA_TRUE; - o->video_surface = 1; - o->video = *surf; + o->video_surface = 1; + o->video = *surf; - obj->layer->evas->video_objects = eina_list_append(obj->layer->evas->video_objects, obj); + obj->layer->evas->video_objects = eina_list_append(obj->layer->evas->video_objects, obj); } else { o->video_surface = 0; - o->video.update_pixels = NULL; - o->video.move = NULL; - o->video.resize = NULL; - o->video.hide = NULL; - o->video.show = NULL; - o->video.data = NULL; + o->video.update_pixels = NULL; + o->video.move = NULL; + o->video.resize = NULL; + o->video.hide = NULL; + o->video.show = NULL; + o->video.data = NULL; } } @@ -1831,10 +1795,7 @@ evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf if ((surf) && ((surf->version < 2) || (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return; - o->engine_data = - obj->layer->evas->engine.func->image_native_set(obj->layer->evas->engine.data.output, - o->engine_data, - surf); + o->engine_data = obj->layer->evas->engine.func->image_native_set(obj->layer->evas->engine.data.output, o->engine_data, surf); } EAPI Evas_Native_Surface * @@ -1850,8 +1811,7 @@ evas_object_image_native_surface_get(const Evas_Object *obj) return NULL; MAGIC_CHECK_END(); if (!obj->layer->evas->engine.func->image_native_get) return NULL; - return obj->layer->evas->engine.func->image_native_get(obj->layer->evas->engine.data.output, - o->engine_data); + return obj->layer->evas->engine.func->image_native_get(obj->layer->evas->engine.data.output, o->engine_data); } EAPI void @@ -1871,10 +1831,10 @@ evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) if (o->engine_data) { int stride = 0; - + if (obj->layer->evas->engine.func->image_scale_hint_set) - obj->layer->evas->engine.func->image_scale_hint_set - (obj->layer->evas->engine.data.output, + obj->layer->evas->engine.func->image_scale_hint_set + (obj->layer->evas->engine.data.output, o->engine_data, o->scale_hint); if (obj->layer->evas->engine.func->image_stride_get) obj->layer->evas->engine.func->image_stride_get @@ -1918,7 +1878,7 @@ evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hin if (o->engine_data) { int stride = 0; - + if (obj->layer->evas->engine.func->image_content_hint_set) obj->layer->evas->engine.func->image_content_hint_set (obj->layer->evas->engine.data.output, @@ -2154,37 +2114,37 @@ evas_image_cache_reload(Evas *e) evas_image_cache_flush(e); EINA_INLIST_FOREACH(e->layers, layer) { - Evas_Object *obj; + Evas_Object *obj; - EINA_INLIST_FOREACH(layer->objects, obj) - { - Evas_Object_Image *o; + EINA_INLIST_FOREACH(layer->objects, obj) + { + Evas_Object_Image *o; - o = (Evas_Object_Image *)(obj->object_data); - if (o->magic == MAGIC_OBJ_IMAGE) - { - evas_object_image_unload(obj, 1); + o = (Evas_Object_Image *)(obj->object_data); + if (o->magic == MAGIC_OBJ_IMAGE) + { + evas_object_image_unload(obj, 1); evas_object_inform_call_image_unloaded(obj); - } - } + } + } } evas_image_cache_flush(e); EINA_INLIST_FOREACH(e->layers, layer) { - Evas_Object *obj; + Evas_Object *obj; - EINA_INLIST_FOREACH(layer->objects, obj) - { - Evas_Object_Image *o; + EINA_INLIST_FOREACH(layer->objects, obj) + { + Evas_Object_Image *o; - o = (Evas_Object_Image *)(obj->object_data); - if (o->magic == MAGIC_OBJ_IMAGE) - { - evas_object_image_load(obj); - o->changed = 1; - evas_object_change(obj); - } - } + o = (Evas_Object_Image *)(obj->object_data); + if (o->magic == MAGIC_OBJ_IMAGE) + { + evas_object_image_load(obj); + o->changed = 1; + evas_object_change(obj); + } + } } evas_image_cache_flush(e); } @@ -2217,7 +2177,7 @@ evas_image_max_size_get(const Evas *e, int *maxw, int *maxh) MAGIC_CHECK(e, Evas, MAGIC_EVAS); return EINA_FALSE; MAGIC_CHECK_END(); - + if (maxw) *maxw = 0xffff; if (maxh) *maxh = 0xffff; if (!e->engine.func->image_max_size_get) return EINA_FALSE; @@ -2274,11 +2234,11 @@ _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int r = rand() % 255; int g = rand() % 255; int b = rand() % 255; - + /* XXX: Eina log error or something I'm sure * If it bugs you, just fix it. Don't tell me */ if (VERBOSE_PROXY_ERROR) printf("Err: Argh! Recursive proxies.\n"); - + func = proxy->layer->evas->engine.func; func->context_color_set(output, context, r, g, b, 255); func->context_multiplier_unset(output, context); @@ -2363,7 +2323,7 @@ _proxy_subrender(Evas *e, Evas_Object *source) source->proxy.h = h; } - if (!source->proxy.surface) return; +// if (!source->proxy.surface) return; ctx = e->engine.func->context_new(e->engine.data.output); e->engine.func->context_color_set(e->engine.data.output, ctx, 0, 0, 0, 0); @@ -2566,9 +2526,9 @@ static void evas_object_image_unload(Evas_Object *obj, Eina_Bool dirty) { Evas_Object_Image *o; - + o = (Evas_Object_Image *)(obj->object_data); - + if ((!o->cur.file) || (o->pixels_checked_out > 0)) return; if (dirty) @@ -2627,31 +2587,31 @@ evas_object_image_load(Evas_Object *obj) &lo); if (o->engine_data) { - int w, h; - int stride = 0; + int w, h; + int stride = 0; - obj->layer->evas->engine.func->image_size_get + obj->layer->evas->engine.func->image_size_get (obj->layer->evas->engine.data.output, - o->engine_data, &w, &h); - if (obj->layer->evas->engine.func->image_stride_get) - obj->layer->evas->engine.func->image_stride_get + o->engine_data, &w, &h); + if (obj->layer->evas->engine.func->image_stride_get) + obj->layer->evas->engine.func->image_stride_get + (obj->layer->evas->engine.data.output, + o->engine_data, &stride); + else + stride = w * 4; + o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get (obj->layer->evas->engine.data.output, - o->engine_data, &stride); - else - stride = w * 4; - o->cur.has_alpha = obj->layer->evas->engine.func->image_alpha_get + o->engine_data); + o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get (obj->layer->evas->engine.data.output, - o->engine_data); - o->cur.cspace = obj->layer->evas->engine.func->image_colorspace_get - (obj->layer->evas->engine.data.output, - o->engine_data); - o->cur.image.w = w; - o->cur.image.h = h; - o->cur.image.stride = stride; + o->engine_data); + o->cur.image.w = w; + o->cur.image.h = h; + o->cur.image.stride = stride; } else { - o->load_error = EVAS_LOAD_ERROR_GENERIC; + o->load_error = EVAS_LOAD_ERROR_GENERIC; } } @@ -2661,18 +2621,18 @@ evas_object_image_figure_x_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord s Evas_Coord w; w = ((size * obj->layer->evas->output.w) / - (Evas_Coord)obj->layer->evas->viewport.w); + (Evas_Coord)obj->layer->evas->viewport.w); if (size <= 0) size = 1; if (start > 0) { - while (start - size > 0) start -= size; + while (start - size > 0) start -= size; } else if (start < 0) { - while (start < 0) start += size; + while (start < 0) start += size; } start = ((start * obj->layer->evas->output.w) / - (Evas_Coord)obj->layer->evas->viewport.w); + (Evas_Coord)obj->layer->evas->viewport.w); *size_ret = w; return start; } @@ -2683,18 +2643,18 @@ evas_object_image_figure_y_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord s Evas_Coord h; h = ((size * obj->layer->evas->output.h) / - (Evas_Coord)obj->layer->evas->viewport.h); + (Evas_Coord)obj->layer->evas->viewport.h); if (size <= 0) size = 1; if (start > 0) { - while (start - size > 0) start -= size; + while (start - size > 0) start -= size; } else if (start < 0) { - while (start < 0) start += size; + while (start < 0) start += size; } start = ((start * obj->layer->evas->output.h) / - (Evas_Coord)obj->layer->evas->viewport.h); + (Evas_Coord)obj->layer->evas->viewport.h); *size_ret = h; return start; } @@ -2779,7 +2739,7 @@ evas_object_image_free(Evas_Object *obj) if (o->video_surface) { o->video_surface = 0; - obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj); + obj->layer->evas->video_objects = eina_list_remove(obj->layer->evas->video_objects, obj); } o->engine_data = NULL; o->magic = 0; @@ -2831,27 +2791,27 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su } obj->layer->evas->engine.func->context_color_set(output, - context, - 255, 255, 255, 255); + context, + 255, 255, 255, 255); if ((obj->cur.cache.clip.r == 255) && (obj->cur.cache.clip.g == 255) && (obj->cur.cache.clip.b == 255) && (obj->cur.cache.clip.a == 255)) { - obj->layer->evas->engine.func->context_multiplier_unset(output, - context); + obj->layer->evas->engine.func->context_multiplier_unset(output, + context); } else obj->layer->evas->engine.func->context_multiplier_set(output, - context, - obj->cur.cache.clip.r, - obj->cur.cache.clip.g, - obj->cur.cache.clip.b, - obj->cur.cache.clip.a); + context, + obj->cur.cache.clip.r, + obj->cur.cache.clip.g, + obj->cur.cache.clip.b, + obj->cur.cache.clip.a); obj->layer->evas->engine.func->context_render_op_set(output, context, - obj->cur.render_op); + obj->cur.render_op); if (!o->cur.source) { @@ -2942,17 +2902,17 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su } } #endif - + if (pixels) { - Evas_Coord idw, idh, idx, idy; - int ix, iy, iw, ih; + Evas_Coord idw, idh, idx, idy; + int ix, iy, iw, ih; int img_set = 0; - if (o->dirty_pixels) - { - if (o->func.get_pixels) - { + if (o->dirty_pixels) + { + if (o->func.get_pixels) + { // Set img object for direct rendering optimization // Check for image w/h against image geometry w/h // Check for image color r,g,b,a = {255,255,255,255} @@ -2962,7 +2922,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su (obj->cur.color.r == 255) && (obj->cur.color.g == 255) && (obj->cur.color.b == 255) && - (obj->cur.color.a == 255) && + (obj->cur.color.a == 255) && (!obj->cur.map) ) { if (obj->layer->evas->engine.func->gl_img_obj_set) @@ -2972,22 +2932,22 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su } } - o->func.get_pixels(o->func.get_pixels_data, obj); - if (o->engine_data != pixels) - pixels = o->engine_data; - o->engine_data = obj->layer->evas->engine.func->image_dirty_region + o->func.get_pixels(o->func.get_pixels_data, obj); + if (o->engine_data != pixels) + pixels = o->engine_data; + o->engine_data = obj->layer->evas->engine.func->image_dirty_region (obj->layer->evas->engine.data.output, o->engine_data, - 0, 0, o->cur.image.w, o->cur.image.h); - } - o->dirty_pixels = 0; - } + 0, 0, o->cur.image.w, o->cur.image.h); + } + o->dirty_pixels = 0; + } if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap)) { evas_object_map_update(obj, x, y, imagew, imageh, uvw, uvh); obj->layer->evas->engine.func->image_map_draw - (output, context, surface, pixels, obj->spans, - o->cur.smooth_scale | obj->cur.map->smooth, 0); + (output, context, surface, pixels, obj->spans, + o->cur.smooth_scale | obj->cur.map->smooth, 0); } else { @@ -3010,7 +2970,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su { Evas_Coord ydy; int dobreak_w = 0; - + ydy = idy; ix = idx; if ((o->cur.fill.w == obj->cur.geometry.w) && @@ -3024,7 +2984,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su while ((int)idy < obj->cur.geometry.h) { int dobreak_h = 0; - + iy = idy; if ((o->cur.fill.h == obj->cur.geometry.h) && (o->cur.fill.y == 0)) @@ -3055,7 +3015,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su int inx, iny, inw, inh, outx, outy, outw, outh; int bl, br, bt, bb, bsl, bsr, bst, bsb; int imw, imh, ox, oy; - + ox = obj->cur.geometry.x + ix + x; oy = obj->cur.geometry.y + iy + y; imw = imagew; @@ -3190,7 +3150,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su obj->layer->evas->engine.func->gl_img_obj_set(output, NULL, 0); img_set = 0; } - } + } } } @@ -3216,18 +3176,18 @@ evas_object_image_render_pre(Evas_Object *obj) { ERR("%p has invalid fill size: %dx%d. Ignored", obj, o->cur.fill.w, o->cur.fill.h); - return; + return; } /* if someone is clipping this obj - go calculate the clipper */ if (obj->cur.clipper) { - if (obj->cur.cache.clip.dirty) - evas_object_clip_recalc(obj->cur.clipper); - obj->cur.clipper->func->render_pre(obj->cur.clipper); + if (obj->cur.cache.clip.dirty) + evas_object_clip_recalc(obj->cur.clipper); + obj->cur.clipper->func->render_pre(obj->cur.clipper); } /* Proxy: Do it early */ - if (o->cur.source && + if (o->cur.source && (o->cur.source->proxy.redraw || o->cur.source->changed)) { /* XXX: Do I need to sort out the map here? */ @@ -3241,12 +3201,12 @@ evas_object_image_render_pre(Evas_Object *obj) was_v = evas_object_was_visible(obj); if (is_v != was_v) { - evas_object_render_pre_visible_change(&e->clip_changes, obj, is_v, was_v); - if (!o->pixel_updates) goto done; + evas_object_render_pre_visible_change(&e->clip_changes, obj, is_v, was_v); + if (!o->pixel_updates) goto done; } if (obj->changed_map) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); goto done; } /* it's not visible - we accounted for it appearing or not so just abort */ @@ -3256,8 +3216,8 @@ evas_object_image_render_pre(Evas_Object *obj) /* if we restacked (layer or just within a layer) and don't clip anyone */ if (obj->restack) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; } /* if it changed color */ if ((obj->cur.color.r != obj->prev.color.r) || @@ -3265,62 +3225,62 @@ evas_object_image_render_pre(Evas_Object *obj) (obj->cur.color.b != obj->prev.color.b) || (obj->cur.color.a != obj->prev.color.a)) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; } /* if it changed render op */ if (obj->cur.render_op != obj->prev.render_op) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; } /* if it changed anti_alias */ if (obj->cur.anti_alias != obj->prev.anti_alias) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; } if (o->changed) { - if (((o->cur.file) && (!o->prev.file)) || - ((!o->cur.file) && (o->prev.file)) || - ((o->cur.key) && (!o->prev.key)) || - ((!o->cur.key) && (o->prev.key)) - ) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } - if ((o->cur.image.w != o->prev.image.w) || - (o->cur.image.h != o->prev.image.h) || - (o->cur.has_alpha != o->prev.has_alpha) || - (o->cur.cspace != o->prev.cspace) || - (o->cur.smooth_scale != o->prev.smooth_scale)) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } - if ((o->cur.border.l != o->prev.border.l) || - (o->cur.border.r != o->prev.border.r) || - (o->cur.border.t != o->prev.border.t) || - (o->cur.border.b != o->prev.border.b) || + if (((o->cur.file) && (!o->prev.file)) || + ((!o->cur.file) && (o->prev.file)) || + ((o->cur.key) && (!o->prev.key)) || + ((!o->cur.key) && (o->prev.key)) + ) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } + if ((o->cur.image.w != o->prev.image.w) || + (o->cur.image.h != o->prev.image.h) || + (o->cur.has_alpha != o->prev.has_alpha) || + (o->cur.cspace != o->prev.cspace) || + (o->cur.smooth_scale != o->prev.smooth_scale)) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } + if ((o->cur.border.l != o->prev.border.l) || + (o->cur.border.r != o->prev.border.r) || + (o->cur.border.t != o->prev.border.t) || + (o->cur.border.b != o->prev.border.b) || (o->cur.border.fill != o->prev.border.fill) || (o->cur.border.scale != o->prev.border.scale)) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } - if (o->dirty_pixels) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } - if (o->cur.frame != o->prev.frame) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } - + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } + if (o->dirty_pixels) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } + if (o->cur.frame != o->prev.frame) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } + } /* if it changed geometry - and obviously not visibility or color */ /* calculate differences since we have a constant color fill */ @@ -3348,26 +3308,26 @@ evas_object_image_render_pre(Evas_Object *obj) obj->prev.geometry.h); if (!o->pixel_updates) goto done; } -#endif +#endif if (((obj->cur.geometry.x != obj->prev.geometry.x) || - (obj->cur.geometry.y != obj->prev.geometry.y) || - (obj->cur.geometry.w != obj->prev.geometry.w) || - (obj->cur.geometry.h != obj->prev.geometry.h)) - ) + (obj->cur.geometry.y != obj->prev.geometry.y) || + (obj->cur.geometry.w != obj->prev.geometry.w) || + (obj->cur.geometry.h != obj->prev.geometry.h)) + ) { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; } if (o->changed) { - if ((o->cur.fill.x != o->prev.fill.x) || - (o->cur.fill.y != o->prev.fill.y) || - (o->cur.fill.w != o->prev.fill.w) || - (o->cur.fill.h != o->prev.fill.h)) - { - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - if (!o->pixel_updates) goto done; - } + if ((o->cur.fill.x != o->prev.fill.x) || + (o->cur.fill.y != o->prev.fill.y) || + (o->cur.fill.w != o->prev.fill.w) || + (o->cur.fill.h != o->prev.fill.h)) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + if (!o->pixel_updates) goto done; + } if (o->pixel_updates) { if ((o->cur.border.l == 0) && @@ -3376,20 +3336,20 @@ evas_object_image_render_pre(Evas_Object *obj) (o->cur.border.b == 0) && (o->cur.image.w > 0) && (o->cur.image.h > 0) && - (!((obj->cur.map) && (obj->cur.usemap)))) + (!((obj->cur.map) && (obj->cur.usemap)))) { Eina_Rectangle *rr; - + EINA_LIST_FREE(o->pixel_updates, rr) { Evas_Coord idw, idh, idx, idy; int x, y, w, h; - + e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, rr->x, rr->y, rr->w, rr->h); - + idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw); idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh); - + if (idw < 1) idw = 1; if (idh < 1) idh = 1; if (idx > 0) idx -= idw; @@ -3397,17 +3357,17 @@ evas_object_image_render_pre(Evas_Object *obj) while (idx < obj->cur.geometry.w) { Evas_Coord ydy; - + ydy = idy; x = idx; w = ((int)(idx + idw)) - x; while (idy < obj->cur.geometry.h) { Eina_Rectangle r; - + y = idy; h = ((int)(idy + idh)) - y; - + r.x = (rr->x * w) / o->cur.image.w; r.y = (rr->y * h) / o->cur.image.h; r.w = ((rr->w * w) + (o->cur.image.w * 2) - 1) / o->cur.image.w; @@ -3429,22 +3389,22 @@ evas_object_image_render_pre(Evas_Object *obj) } else { - Eina_Rectangle *r; - - EINA_LIST_FREE(o->pixel_updates, r) + Eina_Rectangle *r; + + EINA_LIST_FREE(o->pixel_updates, r) eina_rectangle_free(r); - e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h); - evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); - goto done; - } - } + e->engine.func->image_dirty_region(e->engine.data.output, o->engine_data, 0, 0, o->cur.image.w, o->cur.image.h); + evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); + goto done; + } + } } #if 0 // filtering disabled if (obj->filter && obj->filter->dirty) { evas_object_render_pre_prev_cur_add(&e->clip_changes, obj); } -#endif +#endif /* it obviously didn't change - add a NO obscure - this "unupdates" this */ /* area so if there were updates for it they get wiped. don't do it if we */ /* aren't fully opaque and we are visible */ @@ -3452,7 +3412,7 @@ evas_object_image_render_pre(Evas_Object *obj) evas_object_is_opaque(obj)) { Evas_Coord x, y, w, h; - + x = obj->cur.cache.clip.x; y = obj->cur.cache.clip.y; w = obj->cur.cache.clip.w; @@ -3564,7 +3524,7 @@ evas_object_image_is_opaque(Evas_Object *obj) if ((obj->cur.map) && (obj->cur.usemap)) { Evas_Map *m = obj->cur.map; - + if ((m->points[0].a == 255) && (m->points[1].a == 255) && (m->points[2].a == 255) && @@ -3661,7 +3621,7 @@ evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) else { int bl, br, bt, bb, bsl, bsr, bst, bsb; - + bl = o->cur.border.l; br = o->cur.border.r; bt = o->cur.border.t; @@ -3697,17 +3657,17 @@ evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { bsl = bl; bsr = br; bst = bt; bsb = bb; } - + w = o->cur.fill.w; h = o->cur.fill.h; x -= o->cur.fill.x; y -= o->cur.fill.y; x %= w; y %= h; - + if (x < 0) x += w; if (y < 0) y += h; - + if (o->cur.border.fill != EVAS_BORDER_FILL_DEFAULT) { if ((x > bsl) && (x < (w - bsr)) && @@ -3717,28 +3677,28 @@ evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) return 0; } } - + if (x < bsl) x = (x * bl) / bsl; else if (x > (w - bsr)) x = iw - (((w - x) * br) / bsr); else if ((bsl + bsr) < w) x = bl + (((x - bsl) * (iw - bl - br)) / (w - bsl - bsr)); else return 1; - + if (y < bst) y = (y * bt) / bst; else if (y > (h - bsb)) y = ih - (((h - y) * bb) / bsb); else if ((bst + bsb) < h) y = bt + (((y - bst) * (ih - bt - bb)) / (h - bst - bsb)); else return 1; } - + if (x < 0) x = 0; if (y < 0) y = 0; if (x >= iw) x = iw - 1; if (y >= ih) y = ih - 1; - + stride = o->cur.image.stride; - + o->engine_data = obj->layer->evas->engine.func->image_data_get (obj->layer->evas->engine.data.output, - o->engine_data, + o->engine_data, 0, &data, &o->load_error); @@ -3839,25 +3799,25 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C switch (o->cur.cspace) { - case EVAS_COLORSPACE_ARGB8888: - out = evas_common_convert_argb8888_to(data, - o->cur.image.w, - o->cur.image.h, - o->cur.image.stride >> 2, - o->cur.has_alpha, - to_cspace); - break; - case EVAS_COLORSPACE_RGB565_A5P: - out = evas_common_convert_rgb565_a5p_to(data, - o->cur.image.w, - o->cur.image.h, - o->cur.image.stride >> 1, - o->cur.has_alpha, - to_cspace); - break; - case EVAS_COLORSPACE_YCBCR422601_PL: - out = evas_common_convert_yuv_422_601_to(data, - o->cur.image.w, + case EVAS_COLORSPACE_ARGB8888: + out = evas_common_convert_argb8888_to(data, + o->cur.image.w, + o->cur.image.h, + o->cur.image.stride >> 2, + o->cur.has_alpha, + to_cspace); + break; + case EVAS_COLORSPACE_RGB565_A5P: + out = evas_common_convert_rgb565_a5p_to(data, + o->cur.image.w, + o->cur.image.h, + o->cur.image.stride >> 1, + o->cur.has_alpha, + to_cspace); + break; + case EVAS_COLORSPACE_YCBCR422601_PL: + out = evas_common_convert_yuv_422_601_to(data, + o->cur.image.w, o->cur.image.h, to_cspace); break; @@ -3875,13 +3835,13 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C break; case EVAS_COLORSPACE_YCBCR420TM12601_PL: out = evas_common_convert_yuv_420T_601_to(data, - o->cur.image.w, - o->cur.image.h, - to_cspace); + o->cur.image.w, + o->cur.image.h, + to_cspace); break; - default: + default: WRN("unknow colorspace: %i\n", o->cur.cspace); - break; + break; } return out;