summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/software_generic/evas_engine.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-06-13 15:34:09 -0700
committerCedric BAIL <cedric.bail@free.fr>2019-07-12 09:54:16 -0700
commit6a93e2ef3da17c8548d149535f2f39faf18fa46c (patch)
treeabff64113d4f79fe872fc5526c70217ec1b6298e /src/modules/evas/engines/software_generic/evas_engine.c
parentce076d1323ef89cad5d9b4fe185d14101e8d5d3e (diff)
evas: add infrastructure to feed 9 patch information from file loader to image object.
This is just the plumbing that feed data provided along android 9 patch image for example into Evas object image new stretch and content region infrastructure for rendering them properly. Reviewed-by: Hermet Park <hermetpark@gmail.com> Differential Revision: https://phab.enlightenment.org/D9102
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 6ae8224e47..59391c4f6e 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1051,6 +1051,48 @@ eng_image_file_colorspace_get(void *data EINA_UNUSED, void *image)
1051} 1051}
1052 1052
1053static Eina_Bool 1053static Eina_Bool
1054eng_image_content_region_get(void *engine EINA_UNUSED, void *image, Eina_Rectangle *content)
1055{
1056 RGBA_Image *im = image;
1057
1058 if (!im) return EINA_FALSE;
1059
1060 if (!im->cache_entry.need_data) return EINA_FALSE;
1061
1062 if (!im->image.data) evas_cache_image_load_data(&im->cache_entry);
1063
1064 if (!im->cache_entry.content.w ||
1065 !im->cache_entry.content.h)
1066 return EINA_FALSE;
1067
1068 if (!content) return EINA_FALSE;
1069
1070 memcpy(content, &im->cache_entry.content, sizeof (Eina_Rectangle));
1071 return EINA_TRUE;
1072}
1073
1074static Eina_Bool
1075eng_image_stretch_region_get(void *engine EINA_UNUSED, void *image,
1076 uint8_t **horizontal, uint8_t **vertical)
1077{
1078 RGBA_Image *im = image;
1079
1080 if (!im) return EINA_FALSE;
1081
1082 if (!im->cache_entry.need_data) return EINA_FALSE;
1083
1084 if (!im->image.data) evas_cache_image_load_data(&im->cache_entry);
1085
1086 if (!im->cache_entry.stretch.horizontal.region ||
1087 !im->cache_entry.stretch.vertical.region)
1088 return EINA_FALSE;
1089
1090 *horizontal = im->cache_entry.stretch.horizontal.region;
1091 *vertical = im->cache_entry.stretch.vertical.region;
1092 return EINA_TRUE;
1093}
1094
1095static Eina_Bool
1054eng_image_data_direct_get(void *data EINA_UNUSED, void *image, int plane, 1096eng_image_data_direct_get(void *data EINA_UNUSED, void *image, int plane,
1055 Eina_Slice *slice, Evas_Colorspace *cspace, 1097 Eina_Slice *slice, Evas_Colorspace *cspace,
1056 Eina_Bool load, Eina_Bool *tofree) 1098 Eina_Bool load, Eina_Bool *tofree)
@@ -4611,6 +4653,8 @@ static Evas_Func func =
4611 eng_image_data_map, 4653 eng_image_data_map,
4612 eng_image_data_unmap, 4654 eng_image_data_unmap,
4613 eng_image_data_maps_get, 4655 eng_image_data_maps_get,
4656 eng_image_content_region_get,
4657 eng_image_stretch_region_get,
4614 eng_image_data_slice_add, 4658 eng_image_data_slice_add,
4615 eng_image_prepare, 4659 eng_image_prepare,
4616 eng_image_surface_noscale_new, 4660 eng_image_surface_noscale_new,