diff options
author | Shinwoo Kim <cinoo.kim@samsung.com> | 2020-11-20 11:22:54 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-11-20 11:22:55 +0900 |
commit | 5f8e4dabeae5a04ceadba458a4a87111ef0c2d19 (patch) | |
tree | a4c2559dbded800d704be7fd06ebaccddad649ca /src/modules/evas | |
parent | f56004db6ead55df47ac7355651ed911c88114c0 (diff) | |
download | efl-5f8e4dabeae5a04ceadba458a4a87111ef0c2d19.tar.gz |
evas gl: make 9 patch work
Summary:
The 9 patch is using image_stretch_region_get, but GL did not override it.
So the 9 patch did not work for GL engine at all.
Test Plan:
Evas_Object*img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.9.png", 0);
evas_object_show(img);
Reviewers: Hermet, jsuya, herb, cedric
Reviewed By: Hermet
Subscribers: #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D12192
Diffstat (limited to 'src/modules/evas')
-rw-r--r-- | src/modules/evas/engines/gl_generic/evas_engine.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index b413436efd..46f927e28e 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -2199,6 +2199,29 @@ eng_image_can_region_get(void *engine EINA_UNUSED, void *image) return ((Evas_Image_Load_Func*) im->info.loader)->do_region; } +static Eina_Bool +eng_image_stretch_region_get(void *engine EINA_UNUSED, void *image, + uint8_t **horizontal, uint8_t **vertical) +{ + Evas_GL_Image *gim = image; + RGBA_Image *im; + + if (!gim || !gim->im) return EINA_FALSE; + + im = (RGBA_Image *)gim->im; + + if (!im->cache_entry.need_data) return EINA_FALSE; + + if (!im->image.data) evas_cache_image_load_data(&im->cache_entry); + + if (!im->cache_entry.stretch.horizontal.region || + !im->cache_entry.stretch.vertical.region) + return EINA_FALSE; + + *horizontal = im->cache_entry.stretch.horizontal.region; + *vertical = im->cache_entry.stretch.vertical.region; + return EINA_TRUE; +} static void eng_image_max_size_get(void *engine, int *maxw, int *maxh) @@ -3122,6 +3145,7 @@ module_open(Evas_Module *em) ORD(image_colorspace_get); ORD(image_file_colorspace_get); ORD(image_can_region_get); + ORD(image_stretch_region_get); ORD(image_native_init); ORD(image_native_shutdown); ORD(image_native_set); |