summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-10-22 18:34:51 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-11-12 16:52:52 +0900
commit792ac177361bea36ca54b5b629699e3f346a33f2 (patch)
tree02b6aa584721a1187cae1388afa2576d3616304e /src/lib/evas/canvas
parentae4f7f4e617ccaf5888a788778ae875b69be99cb (diff)
Evas image: Use macros ENFN/ENDT to improve code readability
These macros replace some very repetitive code: - define ENFN obj->layer->evas->engine.func - define ENDT obj->layer->evas->engine.data.output This commit includes lots of space changes as well. This is a purely cosmetic commit.
Diffstat (limited to 'src/lib/evas/canvas')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c528
1 files changed, 204 insertions, 324 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 5530af4d2f..99e7b8b4cf 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -22,6 +22,10 @@
22 22
23#define VERBOSE_PROXY_ERROR 1 23#define VERBOSE_PROXY_ERROR 1
24 24
25/* save typing */
26#define ENFN obj->layer->evas->engine.func
27#define ENDT obj->layer->evas->engine.data.output
28
25/* private magic number for image objects */ 29/* private magic number for image objects */
26static const char o_type[] = "image"; 30static const char o_type[] = "image";
27 31
@@ -294,9 +298,7 @@ _evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
294 if ((o->preloading) && (o->engine_data)) 298 if ((o->preloading) && (o->engine_data))
295 { 299 {
296 o->preloading = EINA_FALSE; 300 o->preloading = EINA_FALSE;
297 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 301 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
298 o->engine_data,
299 eo_obj);
300 } 302 }
301 if (o->cur->source) _proxy_unset(eo_obj, obj, o); 303 if (o->cur->source) _proxy_unset(eo_obj, obj, o);
302 if (o->cur->scene) _3d_unset(eo_obj, obj, o); 304 if (o->cur->scene) _3d_unset(eo_obj, obj, o);
@@ -361,8 +363,7 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
361 o->prev = eina_cow_alloc(evas_object_image_state_cow); 363 o->prev = eina_cow_alloc(evas_object_image_state_cow);
362 o->proxy_src_clip = EINA_TRUE; 364 o->proxy_src_clip = EINA_TRUE;
363 365
364 cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, 366 cspace = ENFN->image_colorspace_get(ENDT, o->engine_data);
365 o->engine_data);
366 367
367 if (!o->cur->filter || (cspace != o->cur->cspace)) 368 if (!o->cur->filter || (cspace != o->cur->cspace))
368 { 369 {
@@ -459,9 +460,9 @@ _image_init_set(const Eina_File *f, const char *file, const char *key,
459 if (o->preloading) 460 if (o->preloading)
460 { 461 {
461 o->preloading = EINA_FALSE; 462 o->preloading = EINA_FALSE;
462 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, eo_obj); 463 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
463 } 464 }
464 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); 465 ENFN->image_free(ENDT, o->engine_data);
465 } 466 }
466 o->load_error = EVAS_LOAD_ERROR_NONE; 467 o->load_error = EVAS_LOAD_ERROR_NONE;
467 lo->scale_down_by = o->load_opts->scale_down_by; 468 lo->scale_down_by = o->load_opts->scale_down_by;
@@ -494,16 +495,16 @@ _image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o)
494 int w, h; 495 int w, h;
495 int stride; 496 int stride;
496 497
497 obj->layer->evas->engine.func->image_size_get(obj->layer->evas->engine.data.output, o->engine_data, &w, &h); 498 ENFN->image_size_get(ENDT, o->engine_data, &w, &h);
498 if (obj->layer->evas->engine.func->image_stride_get) 499 if (ENFN->image_stride_get)
499 obj->layer->evas->engine.func->image_stride_get(obj->layer->evas->engine.data.output, o->engine_data, &stride); 500 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
500 else 501 else
501 stride = w * 4; 502 stride = w * 4;
502 503
503 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 504 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
504 { 505 {
505 state_write->has_alpha = obj->layer->evas->engine.func->image_alpha_get(obj->layer->evas->engine.data.output, o->engine_data); 506 state_write->has_alpha = ENFN->image_alpha_get(ENDT, o->engine_data);
506 state_write->cspace = obj->layer->evas->engine.func->image_colorspace_get(obj->layer->evas->engine.data.output, o->engine_data); 507 state_write->cspace = ENFN->image_colorspace_get(ENDT, o->engine_data);
507 508
508 if ((o->cur->image.w != w) || (o->cur->image.h != h)) 509 if ((o->cur->image.w != w) || (o->cur->image.h != h))
509 resize_call = EINA_TRUE; 510 resize_call = EINA_TRUE;
@@ -554,11 +555,7 @@ _evas_image_mmap_set(Eo *eo_obj, Evas_Image_Data *o, const Eina_File *f, const c
554 } 555 }
555 556
556 _image_init_set(f, NULL, key, eo_obj, obj, o, &lo); 557 _image_init_set(f, NULL, key, eo_obj, obj, o, &lo);
557 o->engine_data = obj->layer->evas->engine.func->image_mmap(obj->layer->evas->engine.data.output, 558 o->engine_data = ENFN->image_mmap(ENDT, o->cur->u.f, o->cur->key, &o->load_error, &lo);
558 o->cur->u.f,
559 o->cur->key,
560 &o->load_error,
561 &lo);
562 _image_done_set(eo_obj, obj, o); 559 _image_done_set(eo_obj, obj, o);
563} 560}
564 561
@@ -587,16 +584,10 @@ _evas_image_efl_file_file_set(Eo *eo_obj, Evas_Image_Data *o, const char *file,
587 /* 584 /*
588 * WTF? why cancel a null image preload? this is just silly (tm) 585 * WTF? why cancel a null image preload? this is just silly (tm)
589 if (!o->engine_data) 586 if (!o->engine_data)
590 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 587 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
591 o->engine_data,
592 eo_obj);
593 */ 588 */
594 _image_init_set(NULL, file, key, eo_obj, obj, o, &lo); 589 _image_init_set(NULL, file, key, eo_obj, obj, o, &lo);
595 o->engine_data = obj->layer->evas->engine.func->image_load(obj->layer->evas->engine.data.output, 590 o->engine_data = ENFN->image_load(ENDT, o->cur->u.file, o->cur->key, &o->load_error, &lo);
596 o->cur->u.file,
597 o->cur->key,
598 &o->load_error,
599 &lo);
600 _image_done_set(eo_obj, obj, o); 591 _image_done_set(eo_obj, obj, o);
601 592
602 return EINA_TRUE; 593 return EINA_TRUE;
@@ -795,11 +786,7 @@ _evas_image_scene_set(Eo *eo_obj, Evas_Image_Data *o, Evas_3D_Scene *scene)
795 if (o->cur->scene == scene) return; 786 if (o->cur->scene == scene) return;
796 787
797 _image_init_set(NULL, NULL, NULL, eo_obj, obj, o, &lo); 788 _image_init_set(NULL, NULL, NULL, eo_obj, obj, o, &lo);
798 o->engine_data = obj->layer->evas->engine.func->image_load(obj->layer->evas->engine.data.output, 789 o->engine_data = ENFN->image_load(ENDT, o->cur->u.file, o->cur->key, &o->load_error, &lo);
799 o->cur->u.file,
800 o->cur->key,
801 &o->load_error,
802 &lo);
803 _image_done_set(eo_obj, obj, o); 790 _image_done_set(eo_obj, obj, o);
804 791
805 if (scene) _3d_set(eo_obj, scene); 792 if (scene) _3d_set(eo_obj, scene);
@@ -1002,26 +989,19 @@ _evas_image_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
1002 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); 989 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
1003 990
1004 if (o->engine_data) 991 if (o->engine_data)
1005 o->engine_data = obj->layer->evas->engine.func->image_size_set(obj->layer->evas->engine.data.output, o->engine_data, w, h); 992 o->engine_data = ENFN->image_size_set(ENDT, o->engine_data, w, h);
1006 else 993 else
1007 o->engine_data = obj->layer->evas->engine.func->image_new_from_copied_data 994 o->engine_data = ENFN->image_new_from_copied_data
1008 (obj->layer->evas->engine.data.output, w, h, NULL, o->cur->has_alpha, 995 (ENDT, w, h, NULL, o->cur->has_alpha, o->cur->cspace);
1009 o->cur->cspace);
1010 996
1011 if (o->engine_data) 997 if (o->engine_data)
1012 { 998 {
1013 if (obj->layer->evas->engine.func->image_scale_hint_set) 999 if (ENFN->image_scale_hint_set)
1014 obj->layer->evas->engine.func->image_scale_hint_set 1000 ENFN->image_scale_hint_set(ENDT, o->engine_data, o->scale_hint);
1015 (obj->layer->evas->engine.data.output, 1001 if (ENFN->image_content_hint_set)
1016 o->engine_data, o->scale_hint); 1002 ENFN->image_content_hint_set(ENDT, o->engine_data, o->content_hint);
1017 if (obj->layer->evas->engine.func->image_content_hint_set) 1003 if (ENFN->image_stride_get)
1018 obj->layer->evas->engine.func->image_content_hint_set 1004 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
1019 (obj->layer->evas->engine.data.output,
1020 o->engine_data, o->content_hint);
1021 if (obj->layer->evas->engine.func->image_stride_get)
1022 obj->layer->evas->engine.func->image_stride_get
1023 (obj->layer->evas->engine.data.output,
1024 o->engine_data, &stride);
1025 else 1005 else
1026 stride = w * 4; 1006 stride = w * 4;
1027 } 1007 }
@@ -1033,9 +1013,7 @@ _evas_image_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
1033 1013
1034/* FIXME - in engine call above 1014/* FIXME - in engine call above
1035 if (o->engine_data) 1015 if (o->engine_data)
1036 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, 1016 o->engine_data = ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1037 o->engine_data,
1038 o->cur->has_alpha);
1039*/ 1017*/
1040 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, o->prev, Evas_Object_Image_State, prev_write) 1018 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, o->prev, Evas_Object_Image_State, prev_write)
1041 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(cur_write, prev_write); 1019 EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(cur_write, prev_write);
@@ -1078,18 +1056,18 @@ _evas_image_data_convert(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace to_cspa
1078 if ((o->preloading) && (o->engine_data)) 1056 if ((o->preloading) && (o->engine_data))
1079 { 1057 {
1080 o->preloading = EINA_FALSE; 1058 o->preloading = EINA_FALSE;
1081 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, o->engine_data, eo_obj); 1059 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
1082 } 1060 }
1083 if (!o->engine_data) return NULL; 1061 if (!o->engine_data) return NULL;
1084 if (o->video_surface) 1062 if (o->video_surface)
1085 o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video); 1063 o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video);
1086 if (o->cur->cspace == to_cspace) return NULL; 1064 if (o->cur->cspace == to_cspace) return NULL;
1087 data = NULL; 1065 data = NULL;
1088 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); 1066 o->engine_data = ENFN->image_data_get(ENDT, o->engine_data, 0, &data, &o->load_error);
1089 result = evas_object_image_data_convert_internal(o, data, to_cspace); 1067 result = evas_object_image_data_convert_internal(o, data, to_cspace);
1090 if (o->engine_data) 1068 if (o->engine_data)
1091 { 1069 {
1092 o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, data); 1070 o->engine_data = ENFN->image_data_put(ENDT, o->engine_data, data);
1093 } 1071 }
1094 1072
1095 return result; 1073 return result;
@@ -1111,39 +1089,31 @@ _evas_image_data_set(Eo *eo_obj, Evas_Image_Data *o, void *data)
1111 { 1089 {
1112 if (o->engine_data) 1090 if (o->engine_data)
1113 { 1091 {
1114 o->engine_data = 1092 o->engine_data = ENFN->image_data_put(ENDT, o->engine_data, data);
1115 obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output,
1116 o->engine_data,
1117 data);
1118 } 1093 }
1119 else 1094 else
1120 { 1095 {
1121 o->engine_data = 1096 o->engine_data = ENFN->image_new_from_data(ENDT,
1122 obj->layer->evas->engine.func->image_new_from_data(obj->layer->evas->engine.data.output, 1097 o->cur->image.w,
1123 o->cur->image.w, 1098 o->cur->image.h,
1124 o->cur->image.h, 1099 data,
1125 data, 1100 o->cur->has_alpha,
1126 o->cur->has_alpha, 1101 o->cur->cspace);
1127 o->cur->cspace);
1128 } 1102 }
1129 if (o->engine_data) 1103 if (o->engine_data)
1130 { 1104 {
1131 int stride = 0; 1105 int stride = 0;
1132 1106
1133 if (obj->layer->evas->engine.func->image_scale_hint_set) 1107 if (ENFN->image_scale_hint_set)
1134 obj->layer->evas->engine.func->image_scale_hint_set 1108 ENFN->image_scale_hint_set(ENDT, o->engine_data, o->scale_hint);
1135 (obj->layer->evas->engine.data.output, 1109
1136 o->engine_data, o->scale_hint); 1110 if (ENFN->image_content_hint_set)
1137 if (obj->layer->evas->engine.func->image_content_hint_set) 1111 ENFN->image_content_hint_set(ENDT, o->engine_data, o->content_hint);
1138 obj->layer->evas->engine.func->image_content_hint_set 1112
1139 (obj->layer->evas->engine.data.output, 1113 if (ENFN->image_stride_get)
1140 o->engine_data, o->content_hint); 1114 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
1141 if (obj->layer->evas->engine.func->image_stride_get)
1142 obj->layer->evas->engine.func->image_stride_get
1143 (obj->layer->evas->engine.data.output,
1144 o->engine_data, &stride);
1145 else 1115 else
1146 stride = o->cur->image.w * 4; 1116 stride = o->cur->image.w * 4;
1147 1117
1148 if (o->cur->image.stride != stride) 1118 if (o->cur->image.stride != stride)
1149 { 1119 {
@@ -1157,7 +1127,7 @@ _evas_image_data_set(Eo *eo_obj, Evas_Image_Data *o, void *data)
1157 else 1127 else
1158 { 1128 {
1159 if (o->engine_data) 1129 if (o->engine_data)
1160 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); 1130 ENFN->image_free(ENDT, o->engine_data);
1161 o->load_error = EVAS_LOAD_ERROR_NONE; 1131 o->load_error = EVAS_LOAD_ERROR_NONE;
1162 if ((o->cur->image.w != 0) || (o->cur->image.h != 0)) 1132 if ((o->cur->image.w != 0) || (o->cur->image.h != 0))
1163 resize_call = EINA_TRUE; 1133 resize_call = EINA_TRUE;
@@ -1174,9 +1144,7 @@ _evas_image_data_set(Eo *eo_obj, Evas_Image_Data *o, void *data)
1174 } 1144 }
1175/* FIXME - in engine call above 1145/* FIXME - in engine call above
1176 if (o->engine_data) 1146 if (o->engine_data)
1177 o->engine_data = obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, 1147 o->engine_data = ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1178 o->engine_data,
1179 o->cur->has_alpha);
1180*/ 1148*/
1181 if (o->pixels_checked_out > 0) o->pixels_checked_out--; 1149 if (o->pixels_checked_out > 0) o->pixels_checked_out--;
1182 if (p_data != o->engine_data) 1150 if (p_data != o->engine_data)
@@ -1200,15 +1168,11 @@ _evas_image_data_get(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED, Eina_Bool for
1200 if (for_writing) evas_render_rendering_wait(obj->layer->evas); 1168 if (for_writing) evas_render_rendering_wait(obj->layer->evas);
1201 1169
1202 data = NULL; 1170 data = NULL;
1203 if (obj->layer->evas->engine.func->image_scale_hint_set) 1171 if (ENFN->image_scale_hint_set)
1204 obj->layer->evas->engine.func->image_scale_hint_set 1172 ENFN->image_scale_hint_set(ENDT, o->engine_data, o->scale_hint);
1205 (obj->layer->evas->engine.data.output, 1173 if (ENFN->image_content_hint_set)
1206 o->engine_data, o->scale_hint); 1174 ENFN->image_content_hint_set(ENDT, o->engine_data, o->content_hint);
1207 if (obj->layer->evas->engine.func->image_content_hint_set) 1175 o->engine_data = ENFN->image_data_get(ENDT, o->engine_data, for_writing, &data, &o->load_error);
1208 obj->layer->evas->engine.func->image_content_hint_set
1209 (obj->layer->evas->engine.data.output,
1210 o->engine_data, o->content_hint);
1211 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);
1212 1176
1213 /* if we fail to get engine_data, we have to return NULL */ 1177 /* if we fail to get engine_data, we have to return NULL */
1214 if (!o->engine_data) return NULL; 1178 if (!o->engine_data) return NULL;
@@ -1217,12 +1181,10 @@ _evas_image_data_get(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED, Eina_Bool for
1217 { 1181 {
1218 int stride = 0; 1182 int stride = 0;
1219 1183
1220 if (obj->layer->evas->engine.func->image_stride_get) 1184 if (ENFN->image_stride_get)
1221 obj->layer->evas->engine.func->image_stride_get 1185 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
1222 (obj->layer->evas->engine.data.output,
1223 o->engine_data, &stride);
1224 else 1186 else
1225 stride = o->cur->image.w * 4; 1187 stride = o->cur->image.w * 4;
1226 1188
1227 if (o->cur->image.stride != stride) 1189 if (o->cur->image.stride != stride)
1228 { 1190 {
@@ -1272,9 +1234,7 @@ _image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel)
1272 if (o->preloading) 1234 if (o->preloading)
1273 { 1235 {
1274 o->preloading = EINA_FALSE; 1236 o->preloading = EINA_FALSE;
1275 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 1237 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
1276 o->engine_data,
1277 eo_obj);
1278 } 1238 }
1279 } 1239 }
1280 else 1240 else
@@ -1282,9 +1242,7 @@ _image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel)
1282 if (!o->preloading) 1242 if (!o->preloading)
1283 { 1243 {
1284 o->preloading = EINA_TRUE; 1244 o->preloading = EINA_TRUE;
1285 obj->layer->evas->engine.func->image_data_preload_request(obj->layer->evas->engine.data.output, 1245 ENFN->image_data_preload_request(ENDT, o->engine_data, eo_obj);
1286 o->engine_data,
1287 eo_obj);
1288 } 1246 }
1289 } 1247 }
1290} 1248}
@@ -1311,37 +1269,27 @@ _evas_image_data_copy_set(Eo *eo_obj, Evas_Image_Data *o, void *data)
1311 if ((o->cur->image.w <= 0) || 1269 if ((o->cur->image.w <= 0) ||
1312 (o->cur->image.h <= 0)) return; 1270 (o->cur->image.h <= 0)) return;
1313 if (o->engine_data) 1271 if (o->engine_data)
1314 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, 1272 ENFN->image_free(ENDT, o->engine_data);
1315 o->engine_data); 1273 o->engine_data = ENFN->image_new_from_copied_data(ENDT,
1316 o->engine_data = 1274 o->cur->image.w,
1317 obj->layer->evas->engine.func->image_new_from_copied_data(obj->layer->evas->engine.data.output, 1275 o->cur->image.h,
1318 o->cur->image.w, 1276 data,
1319 o->cur->image.h, 1277 o->cur->has_alpha,
1320 data, 1278 o->cur->cspace);
1321 o->cur->has_alpha,
1322 o->cur->cspace);
1323 if (o->engine_data) 1279 if (o->engine_data)
1324 { 1280 {
1325 int stride = 0; 1281 int stride = 0;
1326 1282
1327 o->engine_data = 1283 o->engine_data =
1328 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, 1284 ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1329 o->engine_data, 1285 if (ENFN->image_scale_hint_set)
1330 o->cur->has_alpha); 1286 ENFN->image_scale_hint_set(ENDT, o->engine_data, o->scale_hint);
1331 if (obj->layer->evas->engine.func->image_scale_hint_set) 1287 if (ENFN->image_content_hint_set)
1332 obj->layer->evas->engine.func->image_scale_hint_set 1288 ENFN->image_content_hint_set(ENDT, o->engine_data, o->content_hint);
1333 (obj->layer->evas->engine.data.output, 1289 if (ENFN->image_stride_get)
1334 o->engine_data, o->scale_hint); 1290 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
1335 if (obj->layer->evas->engine.func->image_content_hint_set)
1336 obj->layer->evas->engine.func->image_content_hint_set
1337 (obj->layer->evas->engine.data.output,
1338 o->engine_data, o->content_hint);
1339 if (obj->layer->evas->engine.func->image_stride_get)
1340 obj->layer->evas->engine.func->image_stride_get
1341 (obj->layer->evas->engine.data.output,
1342 o->engine_data, &stride);
1343 else 1291 else
1344 stride = o->cur->image.w * 4; 1292 stride = o->cur->image.w * 4;
1345 1293
1346 if (o->cur->image.stride != stride) 1294 if (o->cur->image.stride != stride)
1347 { 1295 {
@@ -1404,9 +1352,7 @@ _evas_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha)
1404 if ((o->preloading) && (o->engine_data)) 1352 if ((o->preloading) && (o->engine_data))
1405 { 1353 {
1406 o->preloading = EINA_FALSE; 1354 o->preloading = EINA_FALSE;
1407 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 1355 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
1408 o->engine_data,
1409 eo_obj);
1410 } 1356 }
1411 if (((has_alpha) && (o->cur->has_alpha)) || 1357 if (((has_alpha) && (o->cur->has_alpha)) ||
1412 ((!has_alpha) && (!o->cur->has_alpha))) 1358 ((!has_alpha) && (!o->cur->has_alpha)))
@@ -1421,24 +1367,16 @@ _evas_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha)
1421 { 1367 {
1422 int stride = 0; 1368 int stride = 0;
1423 1369
1424 o->engine_data = 1370 o->engine_data = ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1425 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, 1371 if (ENFN->image_scale_hint_set)
1426 o->engine_data, 1372 ENFN->image_scale_hint_set(ENDT, o->engine_data, o->scale_hint);
1427 o->cur->has_alpha); 1373 if (ENFN->image_content_hint_set)
1428 if (obj->layer->evas->engine.func->image_scale_hint_set) 1374 ENFN->image_content_hint_set (ENDT, o->engine_data, o->content_hint);
1429 obj->layer->evas->engine.func->image_scale_hint_set 1375 if (ENFN->image_stride_get)
1430 (obj->layer->evas->engine.data.output, 1376 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
1431 o->engine_data, o->scale_hint);
1432 if (obj->layer->evas->engine.func->image_content_hint_set)
1433 obj->layer->evas->engine.func->image_content_hint_set
1434 (obj->layer->evas->engine.data.output,
1435 o->engine_data, o->content_hint);
1436 if (obj->layer->evas->engine.func->image_stride_get)
1437 obj->layer->evas->engine.func->image_stride_get
1438 (obj->layer->evas->engine.data.output,
1439 o->engine_data, &stride);
1440 else 1377 else
1441 stride = o->cur->image.w * 4; 1378 stride = o->cur->image.w * 4;
1379
1442 if (o->cur->image.stride != stride) 1380 if (o->cur->image.stride != stride)
1443 { 1381 {
1444 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 1382 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
@@ -1488,14 +1426,12 @@ _evas_image_reload(Eo *eo_obj, Evas_Image_Data *o)
1488 if ((o->preloading) && (o->engine_data)) 1426 if ((o->preloading) && (o->engine_data))
1489 { 1427 {
1490 o->preloading = EINA_FALSE; 1428 o->preloading = EINA_FALSE;
1491 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 1429 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
1492 o->engine_data,
1493 eo_obj);
1494 } 1430 }
1495 if ((!o->cur->u.file) || 1431 if ((!o->cur->u.file) ||
1496 (o->pixels_checked_out > 0)) return; 1432 (o->pixels_checked_out > 0)) return;
1497 if (o->engine_data) 1433 if (o->engine_data)
1498 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); 1434 o->engine_data = ENFN->image_dirty_region(ENDT, o->engine_data, 0, 0, o->cur->image.w, o->cur->image.h);
1499 o->written = EINA_FALSE; 1435 o->written = EINA_FALSE;
1500 evas_object_image_unload(eo_obj, 1); 1436 evas_object_image_unload(eo_obj, 1);
1501 evas_object_inform_call_image_unloaded(eo_obj); 1437 evas_object_inform_call_image_unloaded(eo_obj);
@@ -1521,7 +1457,7 @@ _evas_image_efl_file_save(Eo *eo_obj, Evas_Image_Data *o, const char *file, cons
1521 RGBA_Image *im; 1457 RGBA_Image *im;
1522 if (!o->engine_data) return 0; 1458 if (!o->engine_data) return 0;
1523 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1459 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1524 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); 1460 o->engine_data = ENFN->image_data_get(ENDT, o->engine_data, 0, &data, &o->load_error);
1525 if (flags) 1461 if (flags)
1526 { 1462 {
1527 char *p, *pp; 1463 char *p, *pp;
@@ -1565,9 +1501,7 @@ _evas_image_efl_file_save(Eo *eo_obj, Evas_Image_Data *o, const char *file, cons
1565 1501
1566 evas_cache_image_drop(&im->cache_entry); 1502 evas_cache_image_drop(&im->cache_entry);
1567 } 1503 }
1568 o->engine_data = obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, 1504 o->engine_data = ENFN->image_data_put(ENDT, o->engine_data, data);
1569 o->engine_data,
1570 data);
1571 1505
1572 free(encoding); 1506 free(encoding);
1573 return ok; 1507 return ok;
@@ -1591,23 +1525,19 @@ _evas_image_pixels_import(Eo *eo_obj, Evas_Image_Data *o, Evas_Pixel_Import_Sour
1591 DATA32 *image_pixels = NULL; 1525 DATA32 *image_pixels = NULL;
1592 1526
1593 o->engine_data = 1527 o->engine_data =
1594 obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, 1528 ENFN->image_data_get(ENDT,
1595 o->engine_data, 1529 o->engine_data,
1596 1, 1530 1,
1597 &image_pixels, 1531 &image_pixels,
1598 &o->load_error); 1532 &o->load_error);
1599/* FIXME: need to actualyl support this */ 1533/* FIXME: need to actualyl support this */
1600/* memcpy(image_pixels, pixels->rows, o->cur->image.w * o->cur->image.h * 4);*/ 1534/* memcpy(image_pixels, pixels->rows, o->cur->image.w * o->cur->image.h * 4);*/
1601 if (o->engine_data) 1535 if (o->engine_data)
1602 o->engine_data = 1536 o->engine_data =
1603 obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, 1537 ENFN->image_data_put(ENDT, o->engine_data, image_pixels);
1604 o->engine_data, 1538 if (o->engine_data)
1605 image_pixels);
1606 if (o->engine_data)
1607 o->engine_data = 1539 o->engine_data =
1608 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, 1540 ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1609 o->engine_data,
1610 o->cur->has_alpha);
1611 o->changed = EINA_TRUE; 1541 o->changed = EINA_TRUE;
1612 evas_object_change(eo_obj, obj); 1542 evas_object_change(eo_obj, obj);
1613 } 1543 }
@@ -1620,16 +1550,13 @@ _evas_image_pixels_import(Eo *eo_obj, Evas_Image_Data *o, Evas_Pixel_Import_Sour
1620 { 1550 {
1621 DATA32 *image_pixels = NULL; 1551 DATA32 *image_pixels = NULL;
1622 1552
1623 o->engine_data = 1553 o->engine_data = ENFN->image_data_get(ENDT, o->engine_data, 1, &image_pixels,&o->load_error);
1624 obj->layer->evas->engine.func->image_data_get(obj->layer->evas->engine.data.output, o->engine_data, 1, &image_pixels,&o->load_error);
1625 if (image_pixels) 1554 if (image_pixels)
1626 evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur->image.w, o->cur->image.h); 1555 evas_common_convert_yuv_420p_601_rgba((DATA8 **) pixels->rows, (DATA8 *) image_pixels, o->cur->image.w, o->cur->image.h);
1627 if (o->engine_data) 1556 if (o->engine_data)
1628 o->engine_data = 1557 o->engine_data = ENFN->image_data_put(ENDT, o->engine_data, image_pixels);
1629 obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, o->engine_data, image_pixels);
1630 if (o->engine_data) 1558 if (o->engine_data)
1631 o->engine_data = 1559 o->engine_data = ENFN->image_alpha_set(ENDT, o->engine_data, o->cur->has_alpha);
1632 obj->layer->evas->engine.func->image_alpha_set(obj->layer->evas->engine.data.output, o->engine_data, o->cur->has_alpha);
1633 o->changed = EINA_TRUE; 1560 o->changed = EINA_TRUE;
1634 evas_object_change(eo_obj, obj); 1561 evas_object_change(eo_obj, obj);
1635 } 1562 }
@@ -1815,7 +1742,7 @@ _evas_image_colorspace_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace cspac
1815 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); 1742 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
1816 1743
1817 if (o->engine_data) 1744 if (o->engine_data)
1818 obj->layer->evas->engine.func->image_colorspace_set(obj->layer->evas->engine.data.output, o->engine_data, cspace); 1745 ENFN->image_colorspace_set(ENDT, o->engine_data, cspace);
1819} 1746}
1820 1747
1821EOLIAN static Evas_Colorspace 1748EOLIAN static Evas_Colorspace
@@ -1936,23 +1863,21 @@ _evas_image_native_surface_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Native_Surfa
1936 evas_render_rendering_wait(obj->layer->evas); 1863 evas_render_rendering_wait(obj->layer->evas);
1937 1864
1938 _evas_object_image_cleanup(eo_obj, obj, o); 1865 _evas_object_image_cleanup(eo_obj, obj, o);
1939 if (!obj->layer->evas->engine.func->image_native_set) return; 1866 if (!ENFN->image_native_set) return;
1940 if ((surf) && 1867 if ((surf) &&
1941 ((surf->version < 2) || 1868 ((surf->version < 2) ||
1942 (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return; 1869 (surf->version > EVAS_NATIVE_SURFACE_VERSION))) return;
1943 o->engine_data = obj->layer->evas->engine.func->image_native_set(obj->layer->evas->engine.data.output, o->engine_data, surf); 1870 o->engine_data = ENFN->image_native_set(ENDT, o->engine_data, surf);
1944} 1871}
1945 1872
1946EOLIAN static Evas_Native_Surface* 1873EOLIAN static Evas_Native_Surface*
1947_evas_image_native_surface_get(Eo *eo_obj, Evas_Image_Data *o) 1874_evas_image_native_surface_get(Eo *eo_obj, Evas_Image_Data *o)
1948{ 1875{
1949 Evas_Native_Surface *surf; 1876 Evas_Native_Surface *surf = NULL;
1950
1951 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1877 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1952 1878
1953 surf = 1879 if (ENFN->image_native_get)
1954 (!obj->layer->evas->engine.func->image_native_get ? NULL : 1880 surf = ENFN->image_native_get(ENDT, o->engine_data);
1955 obj->layer->evas->engine.func->image_native_get(obj->layer->evas->engine.data.output, o->engine_data));
1956 1881
1957 return surf; 1882 return surf;
1958} 1883}
@@ -1967,16 +1892,12 @@ _evas_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Scale_Hint
1967 { 1892 {
1968 int stride = 0; 1893 int stride = 0;
1969 1894
1970 if (obj->layer->evas->engine.func->image_scale_hint_set) 1895 if (ENFN->image_scale_hint_set)
1971 obj->layer->evas->engine.func->image_scale_hint_set 1896 ENFN->image_scale_hint_set(ENFN->image_native_get, o->engine_data, o->scale_hint);
1972 (obj->layer->evas->engine.data.output, 1897 if (ENFN->image_stride_get)
1973 o->engine_data, o->scale_hint); 1898 ENFN->image_stride_get(ENFN->image_native_get, o->engine_data, &stride);
1974 if (obj->layer->evas->engine.func->image_stride_get)
1975 obj->layer->evas->engine.func->image_stride_get
1976 (obj->layer->evas->engine.data.output,
1977 o->engine_data, &stride);
1978 else 1899 else
1979 stride = o->cur->image.w * 4; 1900 stride = o->cur->image.w * 4;
1980 1901
1981 if (o->cur->image.stride != stride) 1902 if (o->cur->image.stride != stride)
1982 { 1903 {
@@ -2003,16 +1924,12 @@ _evas_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Content_
2003 { 1924 {
2004 int stride = 0; 1925 int stride = 0;
2005 1926
2006 if (obj->layer->evas->engine.func->image_content_hint_set) 1927 if (ENFN->image_content_hint_set)
2007 obj->layer->evas->engine.func->image_content_hint_set 1928 ENFN->image_content_hint_set(ENFN->image_native_get, o->engine_data, o->content_hint);
2008 (obj->layer->evas->engine.data.output, 1929 if (ENFN->image_stride_get)
2009 o->engine_data, o->content_hint); 1930 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
2010 if (obj->layer->evas->engine.func->image_stride_get)
2011 obj->layer->evas->engine.func->image_stride_get
2012 (obj->layer->evas->engine.data.output,
2013 o->engine_data, &stride);
2014 else 1931 else
2015 stride = o->cur->image.w * 4; 1932 stride = o->cur->image.w * 4;
2016 1933
2017 if (o->cur->image.stride != stride) 1934 if (o->cur->image.stride != stride)
2018 { 1935 {
@@ -2049,9 +1966,7 @@ _evas_image_region_support_get(Eo *eo_obj, Evas_Image_Data *o)
2049 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1966 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
2050 1967
2051 Eina_Bool region; 1968 Eina_Bool region;
2052 region = obj->layer->evas->engine.func->image_can_region_get( 1969 region = ENFN->image_can_region_get(ENDT, o->engine_data);
2053 obj->layer->evas->engine.data.output,
2054 o->engine_data);
2055 1970
2056 return region; 1971 return region;
2057} 1972}
@@ -2064,8 +1979,8 @@ _evas_image_efl_image_animated_get(Eo *eo_obj, Evas_Image_Data *o)
2064 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1979 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
2065 1980
2066 animated = 1981 animated =
2067 obj->layer->evas->engine.func->image_animated_get ? 1982 ENFN->image_animated_get ?
2068 obj->layer->evas->engine.func->image_animated_get(obj->layer->evas->engine.data.output, o->engine_data) : 1983 ENFN->image_animated_get(ENDT, o->engine_data) :
2069 EINA_FALSE; 1984 EINA_FALSE;
2070 1985
2071 return animated; 1986 return animated;
@@ -2080,8 +1995,8 @@ _evas_image_animated_frame_count_get(Eo *eo_obj, Evas_Image_Data *o)
2080 if (!evas_object_image_animated_get(eo_obj)) return frame_count; 1995 if (!evas_object_image_animated_get(eo_obj)) return frame_count;
2081 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1996 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
2082 1997
2083 if (obj->layer->evas->engine.func->image_animated_frame_count_get) 1998 if (ENFN->image_animated_frame_count_get)
2084 frame_count = obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data); 1999 frame_count = ENFN->image_animated_frame_count_get(ENDT, o->engine_data);
2085 2000
2086 return frame_count; 2001 return frame_count;
2087} 2002}
@@ -2095,8 +2010,8 @@ _evas_image_animated_loop_type_get(Eo *eo_obj, Evas_Image_Data *o)
2095 hint = EVAS_IMAGE_ANIMATED_HINT_NONE; 2010 hint = EVAS_IMAGE_ANIMATED_HINT_NONE;
2096 if (!evas_object_image_animated_get(eo_obj)) return hint; 2011 if (!evas_object_image_animated_get(eo_obj)) return hint;
2097 2012
2098 if (obj->layer->evas->engine.func->image_animated_loop_type_get) 2013 if (ENFN->image_animated_loop_type_get)
2099 hint = obj->layer->evas->engine.func->image_animated_loop_type_get(obj->layer->evas->engine.data.output, o->engine_data); 2014 hint = ENFN->image_animated_loop_type_get(ENDT, o->engine_data);
2100 2015
2101 return hint; 2016 return hint;
2102} 2017}
@@ -2111,8 +2026,8 @@ _evas_image_animated_loop_count_get(Eo *eo_obj, Evas_Image_Data *o)
2111 if (!evas_object_image_animated_get(eo_obj)) return loop_count; 2026 if (!evas_object_image_animated_get(eo_obj)) return loop_count;
2112 2027
2113 loop_count = 2028 loop_count =
2114 obj->layer->evas->engine.func->image_animated_loop_count_get ? 2029 ENFN->image_animated_loop_count_get ?
2115 obj->layer->evas->engine.func->image_animated_loop_count_get(obj->layer->evas->engine.data.output, o->engine_data) : 2030 ENFN->image_animated_loop_count_get(ENDT, o->engine_data) :
2116 -1; 2031 -1;
2117 2032
2118 return loop_count; 2033 return loop_count;
@@ -2127,13 +2042,13 @@ _evas_image_animated_frame_duration_get(Eo *eo_obj, Evas_Image_Data *o, int star
2127 double frame_duration; 2042 double frame_duration;
2128 frame_duration = -1; 2043 frame_duration = -1;
2129 2044
2130 if (!obj->layer->evas->engine.func->image_animated_frame_count_get) return frame_duration; 2045 if (!ENFN->image_animated_frame_count_get) return frame_duration;
2131 2046
2132 frame_count = obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data); 2047 frame_count = ENFN->image_animated_frame_count_get(ENDT, o->engine_data);
2133 2048
2134 if ((start_frame + frame_num) > frame_count) return frame_duration; 2049 if ((start_frame + frame_num) > frame_count) return frame_duration;
2135 if (obj->layer->evas->engine.func->image_animated_frame_duration_get) 2050 if (ENFN->image_animated_frame_duration_get)
2136 frame_duration = obj->layer->evas->engine.func->image_animated_frame_duration_get(obj->layer->evas->engine.data.output, o->engine_data, start_frame, frame_num); 2051 frame_duration = ENFN->image_animated_frame_duration_get(ENDT, o->engine_data, start_frame, frame_num);
2137 2052
2138 return frame_duration; 2053 return frame_duration;
2139} 2054}
@@ -2155,9 +2070,9 @@ _evas_image_animated_frame_set(Eo *eo_obj, Evas_Image_Data *o, int frame_index)
2155 if ((frame_count > FRAME_MAX) || (frame_count < 0) || (frame_index > frame_count)) 2070 if ((frame_count > FRAME_MAX) || (frame_count < 0) || (frame_index > frame_count))
2156 return; 2071 return;
2157 2072
2158 if (!obj->layer->evas->engine.func->image_animated_frame_set) return; 2073 if (!ENFN->image_animated_frame_set) return;
2159 obj->layer->evas->engine.func->image_animated_frame_set(obj->layer->evas->engine.data.output, o->engine_data, frame_index); 2074 ENFN->image_animated_frame_set(ENDT, o->engine_data, frame_index);
2160// if (!obj->layer->evas->engine.func->image_animated_frame_set(obj->layer->evas->engine.data.output, o->engine_data, frame_index)) return; 2075// if (!ENFN->image_animated_frame_set(ENDT, o->engine_data, frame_index)) return;
2161 2076
2162 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, o->prev, Evas_Object_Image_State, prev_write) 2077 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, o->prev, Evas_Object_Image_State, prev_write)
2163 prev_write->frame = o->cur->frame; 2078 prev_write->frame = o->cur->frame;
@@ -2621,23 +2536,18 @@ evas_object_image_unload(Evas_Object *eo_obj, Eina_Bool dirty)
2621 if (dirty) 2536 if (dirty)
2622 { 2537 {
2623 if (o->engine_data) 2538 if (o->engine_data)
2624 o->engine_data = obj->layer->evas->engine.func->image_dirty_region 2539 o->engine_data = ENFN->image_dirty_region(ENDT, o->engine_data,
2625 (obj->layer->evas->engine.data.output, 2540 0, 0,
2626 o->engine_data, 2541 o->cur->image.w, o->cur->image.h);
2627 0, 0,
2628 o->cur->image.w, o->cur->image.h);
2629 } 2542 }
2630 if (o->engine_data) 2543 if (o->engine_data)
2631 { 2544 {
2632 if (o->preloading) 2545 if (o->preloading)
2633 { 2546 {
2634 o->preloading = EINA_FALSE; 2547 o->preloading = EINA_FALSE;
2635 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 2548 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
2636 o->engine_data,
2637 eo_obj);
2638 } 2549 }
2639 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, 2550 ENFN->image_free(ENDT, o->engine_data);
2640 o->engine_data);
2641 } 2551 }
2642 o->engine_data = NULL; 2552 o->engine_data = NULL;
2643 o->load_error = EVAS_LOAD_ERROR_NONE; 2553 o->load_error = EVAS_LOAD_ERROR_NONE;
@@ -2681,15 +2591,15 @@ evas_object_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eva
2681 lo.orientation = o->load_opts->orientation; 2591 lo.orientation = o->load_opts->orientation;
2682 lo.degree = 0; 2592 lo.degree = 0;
2683 if (o->cur->mmaped_source) 2593 if (o->cur->mmaped_source)
2684 o->engine_data = obj->layer->evas->engine.func->image_mmap 2594 o->engine_data = ENFN->image_mmap
2685 (obj->layer->evas->engine.data.output, 2595 (ENDT,
2686 o->cur->u.f, 2596 o->cur->u.f,
2687 o->cur->key, 2597 o->cur->key,
2688 &o->load_error, 2598 &o->load_error,
2689 &lo); 2599 &lo);
2690 else 2600 else
2691 o->engine_data = obj->layer->evas->engine.func->image_load 2601 o->engine_data = ENFN->image_load
2692 (obj->layer->evas->engine.data.output, 2602 (ENDT,
2693 o->cur->u.file, 2603 o->cur->u.file,
2694 o->cur->key, 2604 o->cur->key,
2695 &o->load_error, 2605 &o->load_error,
@@ -2701,24 +2611,16 @@ evas_object_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Eva
2701 int stride = 0; 2611 int stride = 0;
2702 Eina_Bool resize_call = EINA_FALSE; 2612 Eina_Bool resize_call = EINA_FALSE;
2703 2613
2704 obj->layer->evas->engine.func->image_size_get 2614 ENFN->image_size_get(ENDT, o->engine_data, &w, &h);
2705 (obj->layer->evas->engine.data.output, 2615 if (ENFN->image_stride_get)
2706 o->engine_data, &w, &h); 2616 ENFN->image_stride_get(ENDT, o->engine_data, &stride);
2707 if (obj->layer->evas->engine.func->image_stride_get)
2708 obj->layer->evas->engine.func->image_stride_get
2709 (obj->layer->evas->engine.data.output,
2710 o->engine_data, &stride);
2711 else 2617 else
2712 stride = w * 4; 2618 stride = w * 4;
2713 2619
2714 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 2620 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
2715 { 2621 {
2716 state_write->has_alpha = obj->layer->evas->engine.func->image_alpha_get 2622 state_write->has_alpha = ENFN->image_alpha_get(ENDT, o->engine_data);
2717 (obj->layer->evas->engine.data.output, 2623 state_write->cspace = ENFN->image_colorspace_get(ENDT, o->engine_data);
2718 o->engine_data);
2719 state_write->cspace = obj->layer->evas->engine.func->image_colorspace_get
2720 (obj->layer->evas->engine.data.output,
2721 o->engine_data);
2722 if ((state_write->image.w != w) || (state_write->image.h != h)) 2624 if ((state_write->image.w != w) || (state_write->image.h != h))
2723 resize_call = EINA_TRUE; 2625 resize_call = EINA_TRUE;
2724 state_write->image.w = w; 2626 state_write->image.w = w;
@@ -2839,12 +2741,9 @@ evas_object_image_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
2839 if (o->preloading) 2741 if (o->preloading)
2840 { 2742 {
2841 o->preloading = EINA_FALSE; 2743 o->preloading = EINA_FALSE;
2842 obj->layer->evas->engine.func->image_data_preload_cancel(obj->layer->evas->engine.data.output, 2744 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
2843 o->engine_data,
2844 eo_obj);
2845 } 2745 }
2846 obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, 2746 ENFN->image_free(ENDT, o->engine_data);
2847 o->engine_data);
2848 } 2747 }
2849 if (o->video_surface) 2748 if (o->video_surface)
2850 { 2749 {
@@ -2873,11 +2772,11 @@ _draw_image(Evas_Object_Protected_Data *obj,
2873{ 2772{
2874 Eina_Bool async_unref; 2773 Eina_Bool async_unref;
2875 2774
2876 async_unref = obj->layer->evas->engine.func->image_draw(data, context, surface, 2775 async_unref = ENFN->image_draw(data, context, surface,
2877 image, src_x, src_y, 2776 image, src_x, src_y,
2878 src_w, src_h, dst_x, 2777 src_w, src_h, dst_x,
2879 dst_y, dst_w, dst_h, 2778 dst_y, dst_w, dst_h,
2880 smooth, do_async); 2779 smooth, do_async);
2881 if (do_async && async_unref) 2780 if (do_async && async_unref)
2882 { 2781 {
2883#ifdef EVAS_CSERVE2 2782#ifdef EVAS_CSERVE2
@@ -2899,10 +2798,10 @@ evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
2899{ 2798{
2900 Eina_Bool async_unref; 2799 Eina_Bool async_unref;
2901 2800
2902 async_unref = obj->layer->evas->engine.func->image_map_draw(data, context, 2801 async_unref = ENFN->image_map_draw(data, context,
2903 surface, image, m, 2802 surface, image, m,
2904 smooth, level, 2803 smooth, level,
2905 do_async); 2804 do_async);
2906 if (do_async && async_unref) 2805 if (do_async && async_unref)
2907 { 2806 {
2908#ifdef EVAS_CSERVE2 2807#ifdef EVAS_CSERVE2
@@ -2929,18 +2828,18 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2929 { 2828 {
2930 Evas_Coord x, y, w, h; 2829 Evas_Coord x, y, w, h;
2931 2830
2932 if (obj->layer->evas->engine.func->image_native_get) 2831 if (ENFN->image_native_get)
2933 { 2832 {
2934 Evas_Native_Surface *ns; 2833 Evas_Native_Surface *ns;
2935 ns = obj->layer->evas->engine.func->image_native_get(obj->layer->evas->engine.data.output, o->engine_data); 2834 ns = ENFN->image_native_get(ENDT, o->engine_data);
2936 if ( (ns) && 2835 if ( (ns) &&
2937 (ns->type == EVAS_NATIVE_SURFACE_OPENGL) && 2836 (ns->type == EVAS_NATIVE_SURFACE_OPENGL) &&
2938 (ns->data.opengl.texture_id) && 2837 (ns->data.opengl.texture_id) &&
2939 (!ns->data.opengl.framebuffer_id) ) 2838 (!ns->data.opengl.framebuffer_id) )
2940 { 2839 {
2941 // Check if we can do direct rendering... 2840 // Check if we can do direct rendering...
2942 if (obj->layer->evas->engine.func->gl_direct_override_get) 2841 if (ENFN->gl_direct_override_get)
2943 obj->layer->evas->engine.func->gl_direct_override_get(output, &direct_override, &direct_force_off); 2842 ENFN->gl_direct_override_get(output, &direct_override, &direct_force_off);
2944 if ( (((obj->cur->geometry.w == o->cur->image.w) && 2843 if ( (((obj->cur->geometry.w == o->cur->image.w) &&
2945 (obj->cur->geometry.h == o->cur->image.h) && 2844 (obj->cur->geometry.h == o->cur->image.h) &&
2946 (obj->cur->color.r == 255) && 2845 (obj->cur->color.r == 255) &&
@@ -2952,9 +2851,9 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2952 (!direct_force_off) ) 2851 (!direct_force_off) )
2953 { 2852 {
2954 2853
2955 if (obj->layer->evas->engine.func->gl_get_pixels_set) 2854 if (ENFN->gl_get_pixels_set)
2956 { 2855 {
2957 obj->layer->evas->engine.func->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj); 2856 ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj);
2958 } 2857 }
2959 2858
2960 o->direct_render = EINA_TRUE; 2859 o->direct_render = EINA_TRUE;
@@ -2967,8 +2866,8 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2967 if ( (ns) && 2866 if ( (ns) &&
2968 (ns->type == EVAS_NATIVE_SURFACE_X11)) 2867 (ns->type == EVAS_NATIVE_SURFACE_X11))
2969 { 2868 {
2970 if (obj->layer->evas->engine.func->context_flush) 2869 if (ENFN->context_flush)
2971 obj->layer->evas->engine.func->context_flush(output); 2870 ENFN->context_flush(output);
2972 } 2871 }
2973 } 2872 }
2974 2873
@@ -2986,8 +2885,8 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2986 obj->cur->geometry.h == h)) 2885 obj->cur->geometry.h == h))
2987 CRI("Evas_Image_Data geometry did change during pixels get callback !"); 2886 CRI("Evas_Image_Data geometry did change during pixels get callback !");
2988 2887
2989 o->engine_data = obj->layer->evas->engine.func->image_dirty_region 2888 o->engine_data = ENFN->image_dirty_region
2990 (obj->layer->evas->engine.data.output, o->engine_data, 2889 (ENDT, o->engine_data,
2991 0, 0, o->cur->image.w, o->cur->image.h); 2890 0, 0, o->cur->image.w, o->cur->image.h);
2992 if (o->engine_data != pixels) 2891 if (o->engine_data != pixels)
2993 pixels = o->engine_data; 2892 pixels = o->engine_data;
@@ -2999,7 +2898,7 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
2999 // Check if the it's not dirty but it has direct rendering 2898 // Check if the it's not dirty but it has direct rendering
3000 if (o->direct_render) 2899 if (o->direct_render)
3001 { 2900 {
3002 obj->layer->evas->engine.func->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj); 2901 ENFN->gl_get_pixels_set(output, o->pixels->func.get_pixels, o->pixels->func.get_pixels_data, eo_obj);
3003 } 2902 }
3004 } 2903 }
3005 2904
@@ -3059,52 +2958,39 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3059 if (o->video_visible) 2958 if (o->video_visible)
3060 { 2959 {
3061 /* Create a transparent rectangle */ 2960 /* Create a transparent rectangle */
3062 obj->layer->evas->engine.func->context_color_set(output, 2961 ENFN->context_color_set(output, context, 0, 0, 0, 0);
3063 context, 2962 ENFN->context_multiplier_unset(output, context);
3064 0, 0, 0, 0); 2963 ENFN->context_render_op_set(output, context, EVAS_RENDER_COPY);
3065 obj->layer->evas->engine.func->context_multiplier_unset(output, 2964 ENFN->rectangle_draw(output, context, surface,
3066 context); 2965 obj->cur->geometry.x + x, obj->cur->geometry.y + y,
3067 obj->layer->evas->engine.func->context_render_op_set(output, context, 2966 obj->cur->geometry.w, obj->cur->geometry.h,
3068 EVAS_RENDER_COPY); 2967 do_async);
3069 obj->layer->evas->engine.func->rectangle_draw(output,
3070 context,
3071 surface,
3072 obj->cur->geometry.x + x,
3073 obj->cur->geometry.y + y,
3074 obj->cur->geometry.w,
3075 obj->cur->geometry.h,
3076 do_async);
3077 2968
3078 return; 2969 return;
3079 } 2970 }
3080 2971
3081 obj->layer->evas->engine.func->context_color_set(output, 2972 ENFN->context_color_set(output, context, 255, 255, 255, 255);
3082 context,
3083 255, 255, 255, 255);
3084 2973
3085 if ((obj->cur->cache.clip.r == 255) && 2974 if ((obj->cur->cache.clip.r == 255) &&
3086 (obj->cur->cache.clip.g == 255) && 2975 (obj->cur->cache.clip.g == 255) &&
3087 (obj->cur->cache.clip.b == 255) && 2976 (obj->cur->cache.clip.b == 255) &&
3088 (obj->cur->cache.clip.a == 255)) 2977 (obj->cur->cache.clip.a == 255))
3089 { 2978 {
3090 obj->layer->evas->engine.func->context_multiplier_unset(output, 2979 ENFN->context_multiplier_unset(output, context);
3091 context);
3092 } 2980 }
3093 else 2981 else
3094 obj->layer->evas->engine.func->context_multiplier_set(output, 2982 ENFN->context_multiplier_set(output, context,
3095 context, 2983 obj->cur->cache.clip.r,
3096 obj->cur->cache.clip.r, 2984 obj->cur->cache.clip.g,
3097 obj->cur->cache.clip.g, 2985 obj->cur->cache.clip.b,
3098 obj->cur->cache.clip.b, 2986 obj->cur->cache.clip.a);
3099 obj->cur->cache.clip.a);
3100 2987
3101 obj->layer->evas->engine.func->context_render_op_set(output, context, 2988 ENFN->context_render_op_set(output, context, obj->cur->render_op);
3102 obj->cur->render_op);
3103 2989
3104 // Clear out the pixel get stuff.. 2990 // Clear out the pixel get stuff..
3105 if (obj->layer->evas->engine.func->gl_get_pixels_set) 2991 if (ENFN->gl_get_pixels_set)
3106 { 2992 {
3107 obj->layer->evas->engine.func->gl_get_pixels_set(output, NULL, NULL, NULL); 2993 ENFN->gl_get_pixels_set(output, NULL, NULL, NULL);
3108 } 2994 }
3109 2995
3110 Evas_Object_Protected_Data *source = 2996 Evas_Object_Protected_Data *source =
@@ -3186,15 +3072,13 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
3186 int W, H, offx, offy; 3072 int W, H, offx, offy;
3187 3073
3188start_draw: 3074start_draw:
3189 obj->layer->evas->engine.func->image_scale_hint_set(output, 3075 ENFN->image_scale_hint_set(output, pixels, o->scale_hint);
3190 pixels,
3191 o->scale_hint);
3192 /* This is technically a bug here: If the value is recreated 3076 /* This is technically a bug here: If the value is recreated
3193 * (which is returned)it may be a new object, however exactly 0 3077 * (which is returned)it may be a new object, however exactly 0
3194 * of all the evas engines do this. */ 3078 * of all the evas engines do this. */
3195 obj->layer->evas->engine.func->image_border_set(output, pixels, 3079 ENFN->image_border_set(output, pixels,
3196 o->cur->border.l, o->cur->border.r, 3080 o->cur->border.l, o->cur->border.r,
3197 o->cur->border.t, o->cur->border.b); 3081 o->cur->border.t, o->cur->border.b);
3198 idx = evas_object_image_figure_x_fill(eo_obj, obj, o->cur->fill.x, o->cur->fill.w, &idw); 3082 idx = evas_object_image_figure_x_fill(eo_obj, obj, o->cur->fill.x, o->cur->fill.w, &idw);
3199 idy = evas_object_image_figure_y_fill(eo_obj, obj, o->cur->fill.y, o->cur->fill.h, &idh); 3083 idy = evas_object_image_figure_y_fill(eo_obj, obj, o->cur->fill.y, o->cur->fill.h, &idh);
3200 if (idw < 1) idw = 1; 3084 if (idw < 1) idw = 1;
@@ -3256,7 +3140,7 @@ start_draw:
3256 if (!redraw) 3140 if (!redraw)
3257 { 3141 {
3258 // Render this image only 3142 // Render this image only
3259 obj->layer->evas->engine.func->image_draw(output, context, 3143 ENFN->image_draw(output, context,
3260 surface, o->cur->filter->output, 3144 surface, o->cur->filter->output,
3261 0, 0, W, H, 3145 0, 0, W, H,
3262 offx, offy, W, H, 3146 offx, offy, W, H,
@@ -3282,10 +3166,10 @@ start_draw:
3282 ok = evas_filter_context_buffers_allocate_all(filter, W, H); 3166 ok = evas_filter_context_buffers_allocate_all(filter, W, H);
3283 if (!ok) goto state_write; 3167 if (!ok) goto state_write;
3284 3168
3285 if (obj->layer->evas->engine.func->gl_surface_read_pixels) 3169 if (ENFN->gl_surface_read_pixels)
3286 { 3170 {
3287 // GL case: Create new surface, draw to it (OpenGL) and call glReadPixels 3171 // GL case: Create new surface, draw to it (OpenGL) and call glReadPixels
3288 surface = obj->layer->evas->engine.func->image_map_surface_new(output, W, H, EINA_TRUE); 3172 surface = ENFN->image_map_surface_new(output, W, H, EINA_TRUE);
3289 input_stolen = EINA_FALSE; 3173 input_stolen = EINA_FALSE;
3290 } 3174 }
3291 else 3175 else
@@ -3306,7 +3190,7 @@ state_write:
3306 { 3190 {
3307 if (ok) 3191 if (ok)
3308 { 3192 {
3309 context = obj->layer->evas->engine.func->context_new(output); 3193 context = ENFN->context_new(output);
3310 clear = EINA_TRUE; 3194 clear = EINA_TRUE;
3311 EINA_COW_IMAGE_FILTER_WRITE_BEGIN(state_write, fcow) 3195 EINA_COW_IMAGE_FILTER_WRITE_BEGIN(state_write, fcow)
3312 fcow->chain = pgm; 3196 fcow->chain = pgm;
@@ -3339,11 +3223,11 @@ state_write:
3339 3223
3340 if (clear) 3224 if (clear)
3341 { 3225 {
3342 obj->layer->evas->engine.func->context_color_set(output, context, 0, 0, 0, 0); 3226 ENFN->context_color_set(output, context, 0, 0, 0, 0);
3343 obj->layer->evas->engine.func->context_render_op_set(output, context, EVAS_RENDER_COPY); 3227 ENFN->context_render_op_set(output, context, EVAS_RENDER_COPY);
3344 obj->layer->evas->engine.func->rectangle_draw(output, context, surface, 0, 0, W, H, EINA_FALSE); 3228 ENFN->rectangle_draw(output, context, surface, 0, 0, W, H, EINA_FALSE);
3345 obj->layer->evas->engine.func->context_color_set(output, context, 255, 255, 255, 255); 3229 ENFN->context_color_set(output, context, 255, 255, 255, 255);
3346 obj->layer->evas->engine.func->context_render_op_set(output, context, EVAS_RENDER_BLEND); 3230 ENFN->context_render_op_set(output, context, EVAS_RENDER_BLEND);
3347 } 3231 }
3348 } 3232 }
3349 3233
@@ -3523,11 +3407,9 @@ state_write:
3523 (obj->cur->cache.clip.a == 255) && 3407 (obj->cur->cache.clip.a == 255) &&
3524 (obj->cur->render_op == EVAS_RENDER_BLEND)) 3408 (obj->cur->render_op == EVAS_RENDER_BLEND))
3525 { 3409 {
3526 obj->layer->evas->engine.func->context_render_op_set(output, context, 3410 ENFN->context_render_op_set(output, context, EVAS_RENDER_COPY);
3527 EVAS_RENDER_COPY);
3528 _draw_image(obj, output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur->smooth_scale, do_async); 3411 _draw_image(obj, output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur->smooth_scale, do_async);
3529 obj->layer->evas->engine.func->context_render_op_set(output, context, 3412 ENFN->context_render_op_set(output, context, obj->cur->render_op);
3530 obj->cur->render_op);
3531 } 3413 }
3532 else 3414 else
3533 _draw_image(obj, output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur->smooth_scale, do_async); 3415 _draw_image(obj, output, context, surface, pixels, inx, iny, inw, inh, outx, outy, outw, outh, o->cur->smooth_scale, do_async);
@@ -3599,8 +3481,8 @@ state_write:
3599 ok = evas_filter_run(filter); 3481 ok = evas_filter_run(filter);
3600 3482
3601 if (!input_stolen) 3483 if (!input_stolen)
3602 obj->layer->evas->engine.func->image_map_surface_free(output, surface); 3484 ENFN->image_map_surface_free(output, surface);
3603 obj->layer->evas->engine.func->context_free(output, context); 3485 ENFN->context_free(output, context);
3604 3486
3605 if (!ok) 3487 if (!ok)
3606 { 3488 {
@@ -4177,7 +4059,7 @@ evas_object_image_is_inside(Evas_Object *eo_obj,
4177 Evas_Image_Data *o = type_private_data; 4059 Evas_Image_Data *o = type_private_data;
4178 int imagew, imageh, uvw, uvh; 4060 int imagew, imageh, uvw, uvh;
4179 void *pixels; 4061 void *pixels;
4180 Evas_Func *eng = obj->layer->evas->engine.func; 4062 Evas_Func *eng = ENFN;
4181 int is_inside = 0; 4063 int is_inside = 0;
4182 4064
4183 /* the following code is similar to evas_object_image_render(), but doesn't 4065 /* the following code is similar to evas_object_image_render(), but doesn't
@@ -4266,8 +4148,7 @@ evas_object_image_is_inside(Evas_Object *eo_obj,
4266 DATA32 *data = NULL; 4148 DATA32 *data = NULL;
4267 int err = 0; 4149 int err = 0;
4268 4150
4269 im = obj->layer->evas->engine.func->image_data_get 4151 im = ENFN->image_data_get(ENDT, pixels, 0, &data, &err);
4270 (obj->layer->evas->engine.data.output, pixels, 0, &data, &err);
4271 if ((!im) || (!data) || (err)) 4152 if ((!im) || (!data) || (err))
4272 { 4153 {
4273 ERR("Couldn't get image pixels %p: im=%p, data=%p, err=%d", 4154 ERR("Couldn't get image pixels %p: im=%p, data=%p, err=%d",
@@ -4682,9 +4563,8 @@ _evas_object_image_preloading_check(Evas_Object *eo_obj)
4682{ 4563{
4683 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 4564 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
4684 Evas_Image_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); 4565 Evas_Image_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
4685 if (obj->layer->evas->engine.func->image_load_error_get) 4566 if (ENFN->image_load_error_get)
4686 o->load_error = obj->layer->evas->engine.func->image_load_error_get 4567 o->load_error = ENFN->image_load_error_get(ENDT, o->engine_data);
4687 (obj->layer->evas->engine.data.output, o->engine_data);
4688} 4568}
4689 4569
4690Evas_Object * 4570Evas_Object *