forked from enlightenment/efl
Evas: Replace image_map_surface_free by common image_free
Those two functions were doing exactly the same thing[1], which is free an image, so this commit only attempts to simplify the code a little bit. [1] Actually image_map_surface_free() might even not have worked properly with cserve2 sw (calling unload instead of close).
This commit is contained in:
parent
681c8b0ec2
commit
b5c9350805
|
@ -31,8 +31,7 @@ _texture_proxy_unset(Evas_Canvas3D_Texture_Data *texture)
|
|||
proxy_src->surface != NULL)
|
||||
{
|
||||
Evas_Public_Data *e = src->layer->evas;
|
||||
e->engine.func->image_map_surface_free(e->engine.data.output,
|
||||
proxy_src->surface);
|
||||
e->engine.func->image_free(e->engine.data.output, proxy_src->surface);
|
||||
proxy_src->surface = NULL;
|
||||
}
|
||||
|
||||
|
@ -91,8 +90,7 @@ _texture_proxy_subrender(Evas_Canvas3D_Texture *obj)
|
|||
if ((proxy_write->surface) &&
|
||||
((proxy_write->w != w) || (proxy_write->h != h)))
|
||||
{
|
||||
e->engine.func->image_map_surface_free(e->engine.data.output,
|
||||
proxy_write->surface);
|
||||
e->engine.func->image_free(e->engine.data.output, proxy_write->surface);
|
||||
proxy_write->surface = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -201,8 +201,7 @@ _evas_object_clip_mask_unset(Evas_Object_Protected_Data *obj)
|
|||
mask->is_alpha = EINA_FALSE;
|
||||
if (mask->surface)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
(obj->layer->evas->engine.data.output, mask->surface);
|
||||
obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, mask->surface);
|
||||
mask->surface = NULL;
|
||||
}
|
||||
mask->w = 0;
|
||||
|
|
|
@ -494,7 +494,7 @@ _evas_object_map_enable_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bo
|
|||
{
|
||||
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output,
|
||||
map_write->surface);
|
||||
map_write->surface = NULL;
|
||||
|
@ -548,7 +548,7 @@ _evas_object_map_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, const Evas_Map
|
|||
{
|
||||
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output,
|
||||
map_write->surface);
|
||||
map_write->surface = NULL;
|
||||
|
|
|
@ -2427,8 +2427,8 @@ _proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *cur_proxy, Evas_Ima
|
|||
if (eina_list_count(proxy_source_write->proxies) == 0)
|
||||
{
|
||||
if (proxy_source_write->surface)
|
||||
cur_proxy->layer->evas->engine.func->image_map_surface_free(cur_proxy->layer->evas->engine.data.output,
|
||||
proxy_source_write->surface);
|
||||
cur_proxy->layer->evas->engine.func->image_free(cur_proxy->layer->evas->engine.data.output,
|
||||
proxy_source_write->surface);
|
||||
proxy_source_write->surface = NULL;
|
||||
proxy_source_write->redraw = EINA_FALSE;
|
||||
}
|
||||
|
@ -3172,7 +3172,7 @@ _evas_image_evas_filter_input_render(Eo *eo_obj, Evas_Image_Data *o,
|
|||
if (!input_stolen)
|
||||
{
|
||||
evas_filter_image_draw(filter, context, EVAS_FILTER_BUFFER_INPUT_ID, surface, do_async);
|
||||
ENFN->image_map_surface_free(output, surface);
|
||||
ENFN->image_free(output, surface);
|
||||
}
|
||||
else
|
||||
evas_filter_buffer_backing_release(filter, surface);
|
||||
|
|
|
@ -179,7 +179,7 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
|||
{
|
||||
if (obj->layer)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output,
|
||||
obj->map->surface);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
|||
mask->w = mask->h = 0;
|
||||
if (mask->surface)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output, mask->surface);
|
||||
mask->surface = NULL;
|
||||
}
|
||||
|
@ -308,7 +308,7 @@ evas_object_content_change(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
EINA_COW_WRITE_BEGIN(evas_object_map_cow,
|
||||
obj->map, Evas_Object_Map_Data, map_write)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output, map_write->surface);
|
||||
map_write->surface = NULL;
|
||||
}
|
||||
|
@ -1323,7 +1323,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
mask->w = mask->h = 0;
|
||||
if (mask->surface)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output, mask->surface);
|
||||
mask->surface = NULL;
|
||||
}
|
||||
|
|
|
@ -1317,7 +1317,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|||
RD(level, " new surf: %ix%i\n", sw, sh);
|
||||
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(e->engine.data.output, map_write->surface);
|
||||
map_write->surface = NULL;
|
||||
}
|
||||
|
@ -1518,7 +1518,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|||
|
||||
// FIXME: needs to cache these maps and
|
||||
// keep them only rendering updates
|
||||
// obj->layer->evas->engine.func->image_map_surface_free
|
||||
// obj->layer->evas->engine.func->image_free
|
||||
// (e->engine.data.output, obj->map->surface);
|
||||
// obj->map->surface = NULL;
|
||||
}
|
||||
|
@ -1721,7 +1721,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
|
|||
if ((proxy_write->surface) &&
|
||||
((proxy_write->w != w) || (proxy_write->h != h)))
|
||||
{
|
||||
ENFN->image_map_surface_free(ENDT, proxy_write->surface);
|
||||
ENFN->image_free(ENDT, proxy_write->surface);
|
||||
proxy_write->surface = NULL;
|
||||
}
|
||||
|
||||
|
@ -1879,7 +1879,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
|
|||
* (we don't know how to render objects to alpha) */
|
||||
if (mdata->surface && ((w != mdata->w) || (h != mdata->h) || mdata->is_alpha || mdata->is_scaled))
|
||||
{
|
||||
ENFN->image_map_surface_free(ENDT, mdata->surface);
|
||||
ENFN->image_free(ENDT, mdata->surface);
|
||||
mdata->surface = NULL;
|
||||
}
|
||||
|
||||
|
@ -1942,7 +1942,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
|
|||
*alpha = (DATA8) A_VAL(rgba);
|
||||
|
||||
/* Now we can drop the original surface */
|
||||
ENFN->image_map_surface_free(ENDT, mdata->surface);
|
||||
ENFN->image_free(ENDT, mdata->surface);
|
||||
mdata->surface = alpha_surface;
|
||||
mdata->is_alpha = EINA_TRUE;
|
||||
}
|
||||
|
@ -2953,7 +2953,7 @@ _evas_render_dump_map_surfaces(Evas_Object *eo_obj)
|
|||
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
|
||||
if ((obj->map->cur.map) && obj->map->surface)
|
||||
{
|
||||
obj->layer->evas->engine.func->image_map_surface_free
|
||||
obj->layer->evas->engine.func->image_free
|
||||
(obj->layer->evas->engine.data.output, obj->map->surface);
|
||||
EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
|
||||
map_write->surface = NULL;
|
||||
|
@ -2992,7 +2992,7 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *e)
|
|||
{
|
||||
EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, Evas_Object_Proxy_Data, proxy_write)
|
||||
{
|
||||
e->engine.func->image_map_surface_free(e->engine.data.output, proxy_write->surface);
|
||||
e->engine.func->image_free(e->engine.data.output, proxy_write->surface);
|
||||
proxy_write->surface = NULL;
|
||||
}
|
||||
EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_write);
|
||||
|
@ -3001,7 +3001,7 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *e)
|
|||
{
|
||||
EINA_COW_WRITE_BEGIN(evas_object_mask_cow, obj->mask, Evas_Object_Mask_Data, mdata)
|
||||
{
|
||||
e->engine.func->image_map_surface_free(e->engine.data.output, mdata->surface);
|
||||
e->engine.func->image_free(e->engine.data.output, mdata->surface);
|
||||
mdata->surface = NULL;
|
||||
}
|
||||
EINA_COW_WRITE_END(evas_object_mask_cow, obj->mask, mdata);
|
||||
|
|
|
@ -1357,7 +1357,6 @@ struct _Evas_Func
|
|||
|
||||
Eina_Bool (*image_map_draw) (void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async);
|
||||
void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
|
||||
void (*image_map_surface_free) (void *data, void *surface);
|
||||
void (*image_map_clean) (void *data, RGBA_Map *m);
|
||||
void *(*image_scaled_update) (void *data, void *scaled, void *image, int dst_w, int dst_h, Eina_Bool smooth, Eina_Bool alpha, Evas_Colorspace cspace);
|
||||
|
||||
|
|
|
@ -810,12 +810,6 @@ eng_image_map_surface_new(void *data EINA_UNUSED, int w, int h, int alpha)
|
|||
return evas_gl_common_image_surface_new(re->win->gl_context, w, h, alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_image_map_surface_free(void *data EINA_UNUSED, void *surface)
|
||||
{
|
||||
evas_gl_common_image_free(surface);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_image_content_hint_set(void *data, void *image, int hint)
|
||||
{
|
||||
|
@ -1263,7 +1257,6 @@ module_open(Evas_Module *em)
|
|||
|
||||
ORD(image_map_draw);
|
||||
ORD(image_map_surface_new);
|
||||
ORD(image_map_surface_free);
|
||||
|
||||
ORD(image_content_hint_set);
|
||||
ORD(image_content_hint_get);
|
||||
|
|
|
@ -1173,15 +1173,6 @@ eng_image_map_surface_new(void *data, int w, int h, int alpha)
|
|||
return evas_gl_common_image_surface_new(gl_context, w, h, alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_image_map_surface_free(void *data, void *surface)
|
||||
{
|
||||
Render_Engine_GL_Generic *re = data;
|
||||
|
||||
re->window_use(re->software.ob);
|
||||
evas_gl_common_image_free(surface);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_image_scaled_update(void *data EINA_UNUSED, void *scaled, void *image,
|
||||
int dst_w, int dst_h,
|
||||
|
@ -2550,7 +2541,6 @@ module_open(Evas_Module *em)
|
|||
|
||||
ORD(image_map_draw);
|
||||
ORD(image_map_surface_new);
|
||||
ORD(image_map_surface_free);
|
||||
ORD(image_map_clean);
|
||||
ORD(image_scaled_update);
|
||||
|
||||
|
|
|
@ -2256,19 +2256,6 @@ eng_image_map_surface_new(void *data EINA_UNUSED, int w, int h, int alpha)
|
|||
return surface;
|
||||
}
|
||||
|
||||
static void
|
||||
eng_image_map_surface_free(void *data EINA_UNUSED, void *surface)
|
||||
{
|
||||
#ifdef EVAS_CSERVE2
|
||||
if (evas_cserve2_use_get())
|
||||
{
|
||||
evas_cache2_image_unload_data(surface);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
evas_cache_image_drop(surface);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_image_scale_hint_set(void *data EINA_UNUSED, void *image, int hint)
|
||||
{
|
||||
|
@ -3872,7 +3859,6 @@ static Evas_Func func =
|
|||
eng_font_last_up_to_pos,
|
||||
eng_image_map_draw,
|
||||
eng_image_map_surface_new,
|
||||
eng_image_map_surface_free,
|
||||
eng_image_map_clean,
|
||||
NULL, // eng_image_scaled_get - used for live scaling in GL only (fastpath)
|
||||
NULL, // eng_image_content_hint_set - software doesn't use it
|
||||
|
|
Loading…
Reference in New Issue