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
This commit is contained in:
Shinwoo Kim 2020-11-20 11:22:54 +09:00 committed by Hermet Park
parent f56004db6e
commit 5f8e4dabea
1 changed files with 24 additions and 0 deletions

View File

@ -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);