Summary:
if device support sec_tbm_surface, but doesn't support the EGL_NATIVE_SURFACE_TIZEN
then below api called cause crash!
evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
evas_object_image_alpha_set(o, 0);
1. evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
[evas_gl_image.c]
if (im->im)
{
if (evas_cache2_image_cached(&im->im->cache_entry))
evas_cache2_image_close(&im->im->cache_entry);
else
evas_cache_image_drop(&im->im->cache_entry);
im->im = NULL; // im->im now NULL!!!
}
im->tex = evas_gl_common_texture_dynamic_new(im->gc, im); // im->tex also NULL!!
im->text also NULL!! because If driver does not support the EGL_NATIVE_SURFACE_TIZEN
then below code return NULL at _pool_tex_dynamic_new();
pt->dyn.img = secsym_eglCreateImage(egldisplay,
EGL_NO_CONTEXT,
EGL_NATIVE_SURFACE_TIZEN,
pt->dyn.buffer, attr);
2. evas_object_image_alpha_set(o, 0);
[gl_generic/evas_engine.c]
static void * eng_image_alpha_set()
{
now im->im and im->tex are null so crash happend at eng_image_alpha_set()
}
bug fixed in case of the tbm surface create fails so device cannot support the dynamic hit set,
Test Plan: experdite
Reviewers: jpeg, cedric, spacegrapher
Subscribers: dkdk, scholb.kim, wonsik
Differential Revision: https://phab.enlightenment.org/D3318
}
if (im->content_hint == EVAS_IMAGE_CONTENT_HINT_DYNAMIC)
{
+ Evas_GL_Texture *tex;
+ tex = evas_gl_common_texture_dynamic_new(im->gc, im);
+ if (!tex) return;
+
if (im->cs.data)
{
if (!im->cs.no_free) free(im->cs.data);
evas_gl_common_texture_free(im->tex, EINA_TRUE);
im->tex = NULL;
}
- im->tex = evas_gl_common_texture_dynamic_new(im->gc, im);
+ im->tex = tex;
im->tex_only = 1;
}
else