forked from enlightenment/efl
efl: cleanup Evas_Object_Protected_Data.
SVN revision: 83028
This commit is contained in:
parent
01739d4cc1
commit
380aea9e91
|
@ -58,8 +58,8 @@ _evas_map_calc_map_geometry(Evas_Object *eo_obj)
|
||||||
ch = EINA_TRUE;
|
ch = EINA_TRUE;
|
||||||
if (!ch)
|
if (!ch)
|
||||||
{
|
{
|
||||||
if (obj->cache_map) evas_map_free(obj->cache_map);
|
if (obj->map.cache_map) evas_map_free(obj->map.cache_map);
|
||||||
obj->cache_map = obj->cur.map;
|
obj->map.cache_map = obj->cur.map;
|
||||||
obj->cur.map = obj->prev.map;
|
obj->cur.map = obj->prev.map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,11 +170,11 @@ _evas_map_free(Evas_Object *eo_obj, Evas_Map *m)
|
||||||
if (eo_obj)
|
if (eo_obj)
|
||||||
{
|
{
|
||||||
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
|
||||||
if ((obj) && (obj->spans))
|
if ((obj) && (obj->map.spans))
|
||||||
{
|
{
|
||||||
obj->layer->evas->engine.func->image_map_clean(obj->layer->evas->engine.data.output, obj->spans);
|
obj->layer->evas->engine.func->image_map_clean(obj->layer->evas->engine.data.output, obj->map.spans);
|
||||||
free(obj->spans);
|
free(obj->map.spans);
|
||||||
obj->spans = NULL;
|
obj->map.spans = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m->magic = 0;
|
m->magic = 0;
|
||||||
|
@ -537,9 +537,9 @@ _map_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
|
|
||||||
if (obj->prev.map == obj->cur.map)
|
if (obj->prev.map == obj->cur.map)
|
||||||
obj->cur.map = NULL;
|
obj->cur.map = NULL;
|
||||||
else if (!obj->cache_map)
|
else if (!obj->map.cache_map)
|
||||||
{
|
{
|
||||||
obj->cache_map = obj->cur.map;
|
obj->map.cache_map = obj->cur.map;
|
||||||
obj->cur.map = NULL;
|
obj->cur.map = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -567,8 +567,8 @@ _map_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
|
|
||||||
if (!obj->cur.map)
|
if (!obj->cur.map)
|
||||||
{
|
{
|
||||||
obj->cur.map = obj->cache_map;
|
obj->cur.map = obj->map.cache_map;
|
||||||
obj->cache_map = NULL;
|
obj->map.cache_map = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We do have the same exact count of point in this map, so just copy it
|
// We do have the same exact count of point in this map, so just copy it
|
||||||
|
@ -1184,11 +1184,11 @@ evas_object_map_update(Evas_Object *eo_obj,
|
||||||
RGBA_Map_Point *pts, *pt;
|
RGBA_Map_Point *pts, *pt;
|
||||||
|
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
if (obj->spans)
|
if (obj->map.spans)
|
||||||
{
|
{
|
||||||
if (obj->spans->x != x || obj->spans->y != y ||
|
if (obj->map.spans->x != x || obj->map.spans->y != y ||
|
||||||
obj->spans->image.w != imagew || obj->spans->image.h != imageh ||
|
obj->map.spans->image.w != imagew || obj->map.spans->image.h != imageh ||
|
||||||
obj->spans->uv.w != uvw || obj->spans->uv.h != uvh)
|
obj->map.spans->uv.w != uvw || obj->map.spans->uv.h != uvh)
|
||||||
obj->changed_map = EINA_TRUE;
|
obj->changed_map = EINA_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1198,31 +1198,31 @@ evas_object_map_update(Evas_Object *eo_obj,
|
||||||
|
|
||||||
if (!obj->changed_map) return ;
|
if (!obj->changed_map) return ;
|
||||||
|
|
||||||
if (obj->cur.map && obj->spans && obj->cur.map->count != obj->spans->count)
|
if (obj->cur.map && obj->map.spans && obj->cur.map->count != obj->map.spans->count)
|
||||||
{
|
{
|
||||||
if (obj->spans)
|
if (obj->map.spans)
|
||||||
{
|
{
|
||||||
// Destroy engine side spans
|
// Destroy engine side spans
|
||||||
free(obj->spans);
|
free(obj->map.spans);
|
||||||
}
|
}
|
||||||
obj->spans = NULL;
|
obj->map.spans = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj->spans)
|
if (!obj->map.spans)
|
||||||
obj->spans = calloc(1, sizeof (RGBA_Map) +
|
obj->map.spans = calloc(1, sizeof (RGBA_Map) +
|
||||||
sizeof (RGBA_Map_Point) * (obj->cur.map->count - 1));
|
sizeof (RGBA_Map_Point) * (obj->cur.map->count - 1));
|
||||||
|
|
||||||
if (!obj->spans) return ;
|
if (!obj->map.spans) return ;
|
||||||
|
|
||||||
obj->spans->count = obj->cur.map->count;
|
obj->map.spans->count = obj->cur.map->count;
|
||||||
obj->spans->x = x;
|
obj->map.spans->x = x;
|
||||||
obj->spans->y = y;
|
obj->map.spans->y = y;
|
||||||
obj->spans->uv.w = uvw;
|
obj->map.spans->uv.w = uvw;
|
||||||
obj->spans->uv.h = uvh;
|
obj->map.spans->uv.h = uvh;
|
||||||
obj->spans->image.w = imagew;
|
obj->map.spans->image.w = imagew;
|
||||||
obj->spans->image.h = imageh;
|
obj->map.spans->image.h = imageh;
|
||||||
|
|
||||||
pts = obj->spans->pts;
|
pts = obj->map.spans->pts;
|
||||||
|
|
||||||
p = obj->cur.map->points;
|
p = obj->cur.map->points;
|
||||||
p_end = p + obj->cur.map->count;
|
p_end = p + obj->cur.map->count;
|
||||||
|
|
|
@ -3374,7 +3374,7 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
|
||||||
evas_object_map_update(eo_obj, x, y, imagew, imageh, uvw, uvh);
|
evas_object_map_update(eo_obj, x, y, imagew, imageh, uvw, uvh);
|
||||||
|
|
||||||
evas_draw_image_map_async_check(
|
evas_draw_image_map_async_check(
|
||||||
obj, output, context, surface, pixels, obj->spans,
|
obj, output, context, surface, pixels, obj->map.spans,
|
||||||
o->cur.smooth_scale | obj->cur.map->smooth, 0, do_async);
|
o->cur.smooth_scale | obj->cur.map->smooth, 0, do_async);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -83,15 +83,15 @@ evas_object_cur_prev(Evas_Object *eo_obj)
|
||||||
{
|
{
|
||||||
if (obj->prev.map != obj->cur.map)
|
if (obj->prev.map != obj->cur.map)
|
||||||
evas_map_free(obj->prev.map);
|
evas_map_free(obj->prev.map);
|
||||||
if (obj->cache_map == obj->prev.map)
|
if (obj->map.cache_map == obj->prev.map)
|
||||||
obj->cache_map = NULL;
|
obj->map.cache_map = NULL;
|
||||||
obj->prev.map = NULL;
|
obj->prev.map = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj->cur.map != obj->prev.map)
|
if (obj->cur.map != obj->prev.map)
|
||||||
{
|
{
|
||||||
if (obj->cache_map) evas_map_free(obj->cache_map);
|
if (obj->map.cache_map) evas_map_free(obj->map.cache_map);
|
||||||
obj->cache_map = obj->prev.map;
|
obj->map.cache_map = obj->prev.map;
|
||||||
}
|
}
|
||||||
obj->prev = obj->cur;
|
obj->prev = obj->cur;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
||||||
if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(eo_obj, NULL);
|
if (!strcmp(obj->type, "image")) evas_object_image_video_surface_set(eo_obj, NULL);
|
||||||
evas_object_map_set(eo_obj, NULL);
|
evas_object_map_set(eo_obj, NULL);
|
||||||
if (obj->prev.map) evas_map_free(obj->prev.map);
|
if (obj->prev.map) evas_map_free(obj->prev.map);
|
||||||
if (obj->cache_map) evas_map_free(obj->cache_map);
|
if (obj->map.cache_map) evas_map_free(obj->map.cache_map);
|
||||||
if (obj->map.surface)
|
if (obj->map.surface)
|
||||||
{
|
{
|
||||||
if (obj->layer)
|
if (obj->layer)
|
||||||
|
@ -133,18 +133,10 @@ evas_object_free(Evas_Object *eo_obj, int clean_layer)
|
||||||
evas_object_clip_changes_clean(eo_obj);
|
evas_object_clip_changes_clean(eo_obj);
|
||||||
evas_object_event_callback_all_del(eo_obj);
|
evas_object_event_callback_all_del(eo_obj);
|
||||||
evas_object_event_callback_cleanup(eo_obj);
|
evas_object_event_callback_cleanup(eo_obj);
|
||||||
if (obj->spans)
|
if (obj->map.spans)
|
||||||
{
|
{
|
||||||
free(obj->spans);
|
free(obj->map.spans);
|
||||||
obj->spans = NULL;
|
obj->map.spans = NULL;
|
||||||
}
|
|
||||||
while (obj->data.elements)
|
|
||||||
{
|
|
||||||
Evas_Data_Node *node;
|
|
||||||
|
|
||||||
node = obj->data.elements->data;
|
|
||||||
obj->data.elements = eina_list_remove(obj->data.elements, node);
|
|
||||||
free(node);
|
|
||||||
}
|
}
|
||||||
if (obj->size_hints)
|
if (obj->size_hints)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1180,7 +1180,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
||||||
(e->engine.data.output, context);
|
(e->engine.data.output, context);
|
||||||
evas_draw_image_map_async_check
|
evas_draw_image_map_async_check
|
||||||
(obj, e->engine.data.output, context, surface,
|
(obj, e->engine.data.output, context, surface,
|
||||||
obj->map.surface, obj->spans,
|
obj->map.surface, obj->map.spans,
|
||||||
obj->cur.map->smooth, 0, do_async);
|
obj->cur.map->smooth, 0, do_async);
|
||||||
}
|
}
|
||||||
// FIXME: needs to cache these maps and
|
// FIXME: needs to cache these maps and
|
||||||
|
|
|
@ -555,17 +555,15 @@ struct _Evas_Object_Protected_Data
|
||||||
struct {
|
struct {
|
||||||
void *surface; // surface holding map if needed
|
void *surface; // surface holding map if needed
|
||||||
int surface_w, surface_h; // current surface w & h alloc
|
int surface_w, surface_h; // current surface w & h alloc
|
||||||
|
|
||||||
|
Evas_Map *cache_map;
|
||||||
|
RGBA_Map *spans;
|
||||||
} map;
|
} map;
|
||||||
|
|
||||||
Evas_Map *cache_map;
|
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
Evas_Intercept_Func *interceptors;
|
Evas_Intercept_Func *interceptors;
|
||||||
|
|
||||||
struct {
|
|
||||||
Eina_List *elements;
|
|
||||||
} data;
|
|
||||||
|
|
||||||
Eina_List *grabs;
|
Eina_List *grabs;
|
||||||
|
|
||||||
Evas_Callbacks *callbacks;
|
Evas_Callbacks *callbacks;
|
||||||
|
@ -589,8 +587,6 @@ struct _Evas_Object_Protected_Data
|
||||||
|
|
||||||
Evas_Size_Hints *size_hints;
|
Evas_Size_Hints *size_hints;
|
||||||
|
|
||||||
RGBA_Map *spans;
|
|
||||||
|
|
||||||
int last_mouse_down_counter;
|
int last_mouse_down_counter;
|
||||||
int last_mouse_up_counter;
|
int last_mouse_up_counter;
|
||||||
int mouse_grabbed;
|
int mouse_grabbed;
|
||||||
|
|
Loading…
Reference in New Issue