From 3e7e37630f13c57e24d96f4af00cf5e1f52a64a4 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 21 Jan 2013 09:36:19 +0000 Subject: [PATCH] efl: group more map stuff in the same sub structure. SVN revision: 83034 --- src/lib/evas/canvas/evas_clip.c | 22 ++-- src/lib/evas/canvas/evas_events.c | 28 ++--- src/lib/evas/canvas/evas_map.c | 118 ++++++++++---------- src/lib/evas/canvas/evas_object_image.c | 20 ++-- src/lib/evas/canvas/evas_object_main.c | 21 ++-- src/lib/evas/canvas/evas_object_rectangle.c | 2 +- src/lib/evas/canvas/evas_render.c | 40 +++---- src/lib/evas/include/evas_inline.x | 18 +-- src/lib/evas/include/evas_private.h | 16 ++- 9 files changed, 145 insertions(+), 140 deletions(-) diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index e56a10bfcc..cee21788b8 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -88,9 +88,9 @@ static void evas_object_child_map_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *map_obj, Eina_Bool force) { #ifdef MAP_ACROSS - if ((obj->cur.map_parent != map_obj) || force) + if ((obj->map.cur.map_parent != map_obj) || force) { - obj->cur.map_parent = map_obj; + obj->map.cur.map_parent = map_obj; obj->cur.cache.clip.dirty = 1; evas_object_clip_recalc(eo_obj, obj); if (obj->is_smart) @@ -100,7 +100,7 @@ evas_object_child_map_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Dat EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj2) { // if obj has its own map - skip it. already done - if ((obj2->cur.map) && (obj2->cur.usemap)) continue; + if ((obj2->map.cur.map) && (obj2->map.cur.usemap)) continue; Evas_Object *eo_obj2 = obj2->object; evas_object_child_map_across_mark(eo_obj2, obj2, map_obj, force); } @@ -125,8 +125,8 @@ evas_object_clip_across_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *o { #ifdef MAP_ACROSS if (!obj->cur.clipper) return; - if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent) - evas_object_child_map_across_mark(eo_obj, obj, obj->cur.map_parent, 1); + if (obj->cur.clipper->map.cur.map_parent != obj->map.cur.map_parent) + evas_object_child_map_across_mark(eo_obj, obj, obj->map.cur.map_parent, 1); #endif } @@ -139,9 +139,9 @@ evas_object_clip_across_clippees_check(Evas_Object *eo_obj, Evas_Object_Protecte if (!obj->clip.clipees) return; // schloooooooooooow: -// evas_object_child_map_across_mark(eo_obj, obj->cur.map_parent, 1); +// evas_object_child_map_across_mark(eo_obj, obj->map.cur.map_parent, 1); // buggy: - evas_object_child_map_across_mark(eo_obj, obj, obj->cur.map_parent, 0); + evas_object_child_map_across_mark(eo_obj, obj, obj->map.cur.map_parent, 0); if (obj->cur.cache.clip.dirty) { EINA_LIST_FOREACH(obj->clip.clipees, l, eo_obj2) @@ -161,7 +161,7 @@ void evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { #ifdef MAP_ACROSS - if ((obj->cur.map) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.usemap)) evas_object_child_map_across_mark(eo_obj, obj, eo_obj, 0); else { @@ -170,7 +170,7 @@ evas_object_mapped_clip_across_mark(Evas_Object *eo_obj, Evas_Object_Protected_D Evas_Object_Protected_Data *smart_parent_obj = eo_data_get(obj->smart.parent, EVAS_OBJ_CLASS); evas_object_child_map_across_mark - (eo_obj, obj, smart_parent_obj->cur.map_parent, 0); + (eo_obj, obj, smart_parent_obj->map.cur.map_parent, 0); } else evas_object_child_map_across_mark(eo_obj, obj, NULL, 0); @@ -300,7 +300,7 @@ _clip_set(Eo *eo_obj, void *_pd, va_list *list) evas_object_clip_dirty(eo_obj, obj); evas_object_recalc_clippees(eo_obj, obj); if ((!obj->is_smart) && - (!((obj->cur.map) && (obj->cur.usemap)))) + (!((obj->map.cur.map) && (obj->map.cur.usemap)))) { if (evas_object_is_in_output_rect(eo_obj, obj, obj->layer->evas->pointer.x, @@ -375,7 +375,7 @@ _clip_unset(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) evas_object_clip_dirty(eo_obj, obj); evas_object_recalc_clippees(eo_obj, obj); if ((!obj->is_smart) && - (!((obj->cur.map) && (obj->cur.usemap)))) + (!((obj->map.cur.map) && (obj->map.cur.usemap)))) { if (evas_object_is_in_output_rect(eo_obj, obj, obj->layer->evas->pointer.x, diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index cd4da4c339..a2a3954c5c 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -19,12 +19,12 @@ _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protecte _evas_event_havemap_adjust(obj->smart.parent, smart_parent_obj, x, y, mouse_grabbed); } - if ((!obj->cur.usemap) || (!obj->cur.map) || (!obj->cur.map->count == 4)) + if ((!obj->map.cur.usemap) || (!obj->map.cur.map) || (!obj->map.cur.map->count == 4)) return; //FIXME: Unless map_coords_get() supports grab mode and extrapolate coords //outside map, this should check the return value for outside case. - if (evas_map_coords_get(obj->cur.map, *x, *y, x, y, mouse_grabbed)) + if (evas_map_coords_get(obj->map.cur.map, *x, *y, x, y, mouse_grabbed)) { *x += obj->cur.geometry.x; *y += obj->cur.geometry.y; @@ -80,15 +80,15 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, { int norep = 0; - if ((obj->cur.usemap) && (obj->cur.map) && - (obj->cur.map->count == 4)) + if ((obj->map.cur.usemap) && (obj->map.cur.map) && + (obj->map.cur.map->count == 4)) { inside = evas_object_is_in_output_rect(eo_obj, obj, x, y, 1, 1); if (inside) { - if (!evas_map_coords_get(obj->cur.map, x, y, - &(obj->cur.map->mx), - &(obj->cur.map->my), 0)) + if (!evas_map_coords_get(obj->map.cur.map, x, y, + &(obj->map.cur.map->mx), + &(obj->map.cur.map->my), 0)) { inside = 0; } @@ -98,8 +98,8 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, (eo_e, in, evas_object_smart_members_get_direct(eo_obj), stop, - obj->cur.geometry.x + obj->cur.map->mx, - obj->cur.geometry.y + obj->cur.map->my, + obj->cur.geometry.x + obj->map.cur.map->mx, + obj->cur.geometry.y + obj->map.cur.map->my, &norep, source); } } @@ -136,12 +136,12 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, if (inside) { - if ((obj->cur.usemap) && (obj->cur.map) && - (obj->cur.map->count == 4)) + if ((obj->map.cur.usemap) && (obj->map.cur.map) && + (obj->map.cur.map->count == 4)) { - if (!evas_map_coords_get(obj->cur.map, x, y, - &(obj->cur.map->mx), - &(obj->cur.map->my), 0)) + if (!evas_map_coords_get(obj->map.cur.map, x, y, + &(obj->map.cur.map->mx), + &(obj->map.cur.map->my), 0)) { inside = 0; } diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c index b921907ebd..71a59ab85a 100644 --- a/src/lib/evas/canvas/evas_map.c +++ b/src/lib/evas/canvas/evas_map.c @@ -39,28 +39,28 @@ _evas_map_calc_map_geometry(Evas_Object *eo_obj) Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); if (!obj) return; - if (!obj->cur.map) return; + if (!obj->map.cur.map) return; // WARN: Do not merge below code to SLP until it is fixed. // It has an infinite loop bug. - if (obj->prev.map) + if (obj->map.prev.map) { - if (obj->prev.map != obj->cur.map) + if (obj->map.prev.map != obj->map.cur.map) { // FIXME: this causes an infinite loop somewhere... hard to debug - if (obj->prev.map->count == obj->cur.map->count) + if (obj->map.prev.map->count == obj->map.cur.map->count) { const Evas_Map_Point *p2; - p = obj->cur.map->points; - p2 = obj->prev.map->points; + p = obj->map.cur.map->points; + p2 = obj->map.prev.map->points; if (memcmp(p, p2, sizeof(Evas_Map_Point) * - obj->prev.map->count) != 0) + obj->map.prev.map->count) != 0) ch = EINA_TRUE; if (!ch) { if (obj->map.cache_map) evas_map_free(obj->map.cache_map); - obj->map.cache_map = obj->cur.map; - obj->cur.map = obj->prev.map; + obj->map.cache_map = obj->map.cur.map; + obj->map.cur.map = obj->map.prev.map; } } else @@ -70,8 +70,8 @@ _evas_map_calc_map_geometry(Evas_Object *eo_obj) else ch = EINA_TRUE; - p = obj->cur.map->points; - p_end = p + obj->cur.map->count; + p = obj->map.cur.map->points; + p_end = p + obj->map.cur.map->count; x1 = x2 = lround(p->x); yy1 = yy2 = lround(p->y); p++; @@ -90,14 +90,14 @@ _evas_map_calc_map_geometry(Evas_Object *eo_obj) // // add 1 pixel of fuzz around the map region to ensure updates are correct // x1 -= 1; yy1 -= 1; // x2 += 1; yy2 += 1; - if (obj->cur.map->normal_geometry.x != x1) ch = 1; - if (obj->cur.map->normal_geometry.y != yy1) ch = 1; - if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1; - if (obj->cur.map->normal_geometry.h != (yy2 - yy1)) ch = 1; - obj->cur.map->normal_geometry.x = x1; - obj->cur.map->normal_geometry.y = yy1; - obj->cur.map->normal_geometry.w = (x2 - x1); - obj->cur.map->normal_geometry.h = (yy2 - yy1); + if (obj->map.cur.map->normal_geometry.x != x1) ch = 1; + if (obj->map.cur.map->normal_geometry.y != yy1) ch = 1; + if (obj->map.cur.map->normal_geometry.w != (x2 - x1)) ch = 1; + if (obj->map.cur.map->normal_geometry.h != (yy2 - yy1)) ch = 1; + obj->map.cur.map->normal_geometry.x = x1; + obj->map.cur.map->normal_geometry.y = yy1; + obj->map.cur.map->normal_geometry.w = (x2 - x1); + obj->map.cur.map->normal_geometry.h = (yy2 - yy1); obj->changed_map = ch; // This shouldn't really be needed, but without it we do have case // where the clip is wrong when a map doesn't change, so always forcing @@ -412,7 +412,7 @@ _evas_object_map_parent_check(Evas_Object *eo_parent) if (!parent) return EINA_FALSE; list = evas_object_smart_members_get_direct(parent->smart.parent); EINA_INLIST_FOREACH(list, o) - if (o->cur.usemap) break ; + if (o->map.cur.usemap) break ; if (o) return EINA_FALSE; /* Still some child have a map enable */ parent->child_has_map = EINA_FALSE; _evas_object_map_parent_check(parent->smart.parent); @@ -437,15 +437,15 @@ _map_enable_set(Eo *eo_obj, void *_pd, va_list *list) Eina_Bool pchange = EINA_FALSE; enabled = !!enabled; - if (obj->cur.usemap == enabled) return; + if (obj->map.cur.usemap == enabled) return; pchange = obj->changed; - obj->cur.usemap = enabled; + obj->map.cur.usemap = enabled; if (enabled) { - if (!obj->cur.map) - obj->cur.map = _evas_map_new(4); + if (!obj->map.cur.map) + obj->map.cur.map = _evas_map_new(4); evas_object_mapped_clip_across_mark(eo_obj, obj); -// obj->cur.map->normal_geometry = obj->cur.geometry; +// obj->map.cur.map->normal_geometry = obj->cur.geometry; } else { @@ -456,7 +456,7 @@ _map_enable_set(Eo *eo_obj, void *_pd, va_list *list) obj->map.surface); obj->map.surface = NULL; } - if (obj->cur.map) + if (obj->map.cur.map) { _evas_map_calc_geom_change(eo_obj); evas_object_mapped_clip_across_mark(eo_obj, obj); @@ -503,7 +503,7 @@ _map_enable_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) { Eina_Bool *enabled = va_arg(*list, Eina_Bool *); const Evas_Object_Protected_Data *obj = _pd; - *enabled = obj->cur.usemap; + *enabled = obj->map.cur.usemap; } EAPI void @@ -530,55 +530,55 @@ _map_set(Eo *eo_obj, void *_pd, va_list *list) obj->map.surface); obj->map.surface = NULL; } - if (obj->cur.map) + if (obj->map.cur.map) { obj->changed_map = EINA_TRUE; - obj->prev.geometry = obj->cur.map->normal_geometry; + obj->prev.geometry = obj->map.cur.map->normal_geometry; - if (obj->prev.map == obj->cur.map) - obj->cur.map = NULL; + if (obj->map.prev.map == obj->map.cur.map) + obj->map.cur.map = NULL; else if (!obj->map.cache_map) { - obj->map.cache_map = obj->cur.map; - obj->cur.map = NULL; + obj->map.cache_map = obj->map.cur.map; + obj->map.cur.map = NULL; } else { - _evas_map_free(eo_obj, obj->cur.map); - obj->cur.map = NULL; + _evas_map_free(eo_obj, obj->map.cur.map); + obj->map.cur.map = NULL; } - if (!obj->prev.map) + if (!obj->map.prev.map) { evas_object_mapped_clip_across_mark(eo_obj, obj); return; } - if (!obj->cur.usemap) _evas_map_calc_geom_change(eo_obj); + if (!obj->map.cur.usemap) _evas_map_calc_geom_change(eo_obj); else _evas_map_calc_map_geometry(eo_obj); - if (obj->cur.usemap) + if (obj->map.cur.usemap) evas_object_mapped_clip_across_mark(eo_obj, obj); } return; } - if (obj->prev.map == obj->cur.map) - obj->cur.map = NULL; + if (obj->map.prev.map == obj->map.cur.map) + obj->map.cur.map = NULL; - if (!obj->cur.map) + if (!obj->map.cur.map) { - obj->cur.map = obj->map.cache_map; + obj->map.cur.map = obj->map.cache_map; obj->map.cache_map = NULL; } // We do have the same exact count of point in this map, so just copy it - if ((obj->cur.map) && (obj->cur.map->count == map->count)) - _evas_map_copy(obj->cur.map, map); + if ((obj->map.cur.map) && (obj->map.cur.map->count == map->count)) + _evas_map_copy(obj->map.cur.map, map); else { - if (obj->cur.map) _evas_map_free(eo_obj, obj->cur.map); - obj->cur.map = _evas_map_dup(map); - if (obj->cur.usemap) + if (obj->map.cur.map) _evas_map_free(eo_obj, obj->map.cur.map); + obj->map.cur.map = _evas_map_dup(map); + if (obj->map.cur.usemap) evas_object_mapped_clip_across_mark(eo_obj, obj); } @@ -602,7 +602,7 @@ _map_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) const Evas_Map **map = va_arg(*list, const Evas_Map **); const Evas_Object_Protected_Data *obj = _pd; - *map = obj->cur.map; + *map = obj->map.cur.map; } EAPI Evas_Map * @@ -1198,7 +1198,7 @@ evas_object_map_update(Evas_Object *eo_obj, if (!obj->changed_map) return ; - if (obj->cur.map && obj->map.spans && obj->cur.map->count != obj->map.spans->count) + if (obj->map.cur.map && obj->map.spans && obj->map.cur.map->count != obj->map.spans->count) { if (obj->map.spans) { @@ -1210,11 +1210,11 @@ evas_object_map_update(Evas_Object *eo_obj, if (!obj->map.spans) obj->map.spans = calloc(1, sizeof (RGBA_Map) + - sizeof (RGBA_Map_Point) * (obj->cur.map->count - 1)); + sizeof (RGBA_Map_Point) * (obj->map.cur.map->count - 1)); if (!obj->map.spans) return ; - obj->map.spans->count = obj->cur.map->count; + obj->map.spans->count = obj->map.cur.map->count; obj->map.spans->x = x; obj->map.spans->y = y; obj->map.spans->uv.w = uvw; @@ -1224,14 +1224,14 @@ evas_object_map_update(Evas_Object *eo_obj, pts = obj->map.spans->pts; - p = obj->cur.map->points; - p_end = p + obj->cur.map->count; + p = obj->map.cur.map->points; + p_end = p + obj->map.cur.map->count; pt = pts; - pts[0].px = obj->cur.map->persp.px << FP; - pts[0].py = obj->cur.map->persp.py << FP; - pts[0].foc = obj->cur.map->persp.foc << FP; - pts[0].z0 = obj->cur.map->persp.z0 << FP; + pts[0].px = obj->map.cur.map->persp.px << FP; + pts[0].py = obj->map.cur.map->persp.py << FP; + pts[0].foc = obj->map.cur.map->persp.foc << FP; + pts[0].z0 = obj->map.cur.map->persp.z0 << FP; // draw geom +x +y for (; p < p_end; p++, pt++) { @@ -1251,9 +1251,9 @@ evas_object_map_update(Evas_Object *eo_obj, else if (pt->v > (imageh * FP1)) pt->v = (imageh * FP1); pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b); } - if (obj->cur.map->count & 0x1) + if (obj->map.cur.map->count & 0x1) { - pts[obj->cur.map->count] = pts[obj->cur.map->count -1]; + pts[obj->map.cur.map->count] = pts[obj->map.cur.map->count -1]; } // Request engine to update it's point diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 14cd743d7b..4b50d64727 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -3351,7 +3351,7 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v (obj->cur.color.g == 255) && (obj->cur.color.b == 255) && (obj->cur.color.a == 255) && - (!obj->cur.map) ) + (!obj->map.cur.map) ) { if (obj->layer->evas->engine.func->gl_img_obj_set) { @@ -3369,13 +3369,13 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v } o->dirty_pixels = EINA_FALSE; } - if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.map->count > 3) && (obj->map.cur.usemap)) { evas_object_map_update(eo_obj, x, y, imagew, imageh, uvw, uvh); evas_draw_image_map_async_check( obj, output, context, surface, pixels, obj->map.spans, - o->cur.smooth_scale | obj->cur.map->smooth, 0, do_async); + o->cur.smooth_scale | obj->map.cur.map->smooth, 0, do_async); } else { @@ -3798,7 +3798,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob (o->cur.border.b == 0) && (o->cur.image.w > 0) && (o->cur.image.h > 0) && - (!((obj->cur.map) && (obj->cur.usemap)))) + (!((obj->map.cur.map) && (obj->map.cur.usemap)))) { Eina_Rectangle *rr; @@ -3969,9 +3969,9 @@ evas_object_image_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj obj->cur.opaque = 1; } - if ((obj->cur.map) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.usemap)) { - Evas_Map *m = obj->cur.map; + Evas_Map *m = obj->map.cur.map; if ((m->points[0].a == 255) && (m->points[1].a == 255) && @@ -4042,9 +4042,9 @@ evas_object_image_was_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob obj->prev.opaque = 1; } - if (obj->prev.usemap) + if (obj->map.prev.usemap) { - Evas_Map *m = obj->prev.map; + Evas_Map *m = obj->map.prev.map; if ((m->points[0].a == 255) && (m->points[1].a == 255) && @@ -4229,7 +4229,7 @@ evas_object_image_is_inside(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj } /* TODO: not handling map, need to apply map to point */ - if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.map->count > 3) && (obj->map.cur.usemap)) { evas_object_map_update(eo_obj, 0, 0, imagew, imageh, uvw, uvh); @@ -4489,7 +4489,7 @@ evas_object_image_has_opaque_rect(Evas_Object *eo_obj, Evas_Object_Protected_Dat { Evas_Object_Image *o = eo_data_get(eo_obj, MY_CLASS); - if ((obj->cur.map) && (obj->cur.usemap)) return 0; + if ((obj->map.cur.map) && (obj->map.cur.usemap)) return 0; if (((o->cur.border.l | o->cur.border.r | o->cur.border.t | o->cur.border.b) != 0) && (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) && (obj->cur.render_op == EVAS_RENDER_BLEND) && diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 6876085c40..fa105a501a 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -79,20 +79,21 @@ evas_object_cur_prev(Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, MY_CLASS); if (!obj) return; - if (!obj->prev.valid_map) + if (!obj->map.prev.valid_map) { - if (obj->prev.map != obj->cur.map) - evas_map_free(obj->prev.map); - if (obj->map.cache_map == obj->prev.map) + if (obj->map.prev.map != obj->map.cur.map) + evas_map_free(obj->map.prev.map); + if (obj->map.cache_map == obj->map.prev.map) obj->map.cache_map = NULL; - obj->prev.map = NULL; + obj->map.prev.map = NULL; } - if (obj->cur.map != obj->prev.map) + if (obj->map.cur.map != obj->map.prev.map) { if (obj->map.cache_map) evas_map_free(obj->map.cache_map); - obj->map.cache_map = obj->prev.map; + obj->map.cache_map = obj->map.prev.map; } + obj->map.prev = obj->map.cur; obj->prev = obj->cur; } @@ -107,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); evas_object_map_set(eo_obj, NULL); - if (obj->prev.map) evas_map_free(obj->prev.map); + if (obj->map.prev.map) evas_map_free(obj->map.prev.map); if (obj->map.cache_map) evas_map_free(obj->map.cache_map); if (obj->map.surface) { @@ -418,7 +419,7 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *eo_obj, in int evas_object_was_in_output_rect(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, int x, int y, int w, int h) { - if (obj->is_smart && !obj->prev.map && !obj->prev.usemap) return 0; + if (obj->is_smart && !obj->map.prev.map && !obj->map.prev.usemap) return 0; /* assumes coords have been recalced */ if ((RECTS_INTERSECT(x, y, w, h, obj->prev.cache.clip.x, @@ -1487,7 +1488,7 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) (!evas_object_is_source_invisible(eo_obj, obj))) { if ((!obj->is_smart) || - ((obj->cur.map) && (obj->cur.map->count == 4) && (obj->cur.usemap))) + ((obj->map.cur.map) && (obj->map.cur.map->count == 4) && (obj->map.cur.usemap))) { if (!obj->mouse_grabbed) { diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c index c1667bd1f9..1b5dfbf186 100644 --- a/src/lib/evas/canvas/evas_object_rectangle.c +++ b/src/lib/evas/canvas/evas_object_rectangle.c @@ -271,7 +271,7 @@ evas_object_rectangle_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro { /* this returns 1 if the internal object data implies that the object is */ /* currently fully opaque over the entire rectangle it occupies */ - if ((obj->cur.map) && (obj->cur.usemap)) return 0; + if ((obj->map.cur.map) && (obj->map.cur.usemap)) return 0; if (obj->cur.render_op == EVAS_RENDER_COPY) return 1; if (obj->cur.render_op != EVAS_RENDER_BLEND) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index d6ce8f29ed..be8201fc7e 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -198,8 +198,8 @@ _evas_clip_changes_free(const void *container EINA_UNUSED, void *data, void *fda static Eina_Bool _evas_render_had_map(Evas_Object_Protected_Data *obj) { - return ((obj->prev.map) && (obj->prev.usemap)); - // return ((!obj->cur.map) && (obj->prev.usemap)); + return ((obj->map.prev.map) && (obj->map.prev.usemap)); + // return ((!obj->map.cur.map) && (obj->prev.usemap)); } static Eina_Bool @@ -317,8 +317,8 @@ _evas_render_phase1_direct(Evas_Public_Data *e, RD(" pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n", obj->smart.smart, evas_object_smart_members_get_direct(eo_obj), - obj->cur.map, obj->cur.usemap, - obj->prev.map, obj->prev.usemap, + obj->map.cur.map, obj->map.cur.usemap, + obj->map.prev.map, obj->prev.usemap, _evas_render_has_map(eo_obj, obj), _evas_render_had_map(obj)); if ((obj->is_smart) && @@ -460,7 +460,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj, { if (!map) { - if ((obj->cur.map) && (obj->cur.usemap)) map = EINA_TRUE; + if ((obj->map.cur.map) && (obj->map.cur.usemap)) map = EINA_TRUE; } if (map != hmap) { @@ -978,7 +978,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, obj->pre_render_done = EINA_TRUE; RD(" Hasmap: %p (%d) %p %d -> %d\n",obj->func->can_map, obj->func->can_map ? obj->func->can_map(eo_obj): -1, - obj->cur.map, obj->cur.usemap, + obj->map.cur.map, obj->map.cur.usemap, _evas_render_has_map(eo_obj, obj)); if (_evas_render_has_map(eo_obj, obj)) { @@ -1020,7 +1020,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, obj->layer->evas->engine.func->image_map_surface_new (e->engine.data.output, obj->map.surface_w, obj->map.surface_h, - obj->cur.map->alpha); + obj->map.cur.map->alpha); RDI(level); RD(" fisrt surf: %ix%i\n", sw, sh); changed = EINA_TRUE; @@ -1055,8 +1055,8 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, /* mark the old map as invalid, so later we don't reuse it as a * cache. */ - if (changed && obj->prev.map) - obj->prev.valid_map = EINA_FALSE; + if (changed && obj->map.prev.map) + obj->map.prev.valid_map = EINA_FALSE; // clear surface before re-render if ((changed) && (obj->map.surface)) @@ -1067,7 +1067,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, RD(" children redraw\n"); // FIXME: calculate "changes" within map surface and only clear // and re-render those - if (obj->cur.map->alpha) + if (obj->map.cur.map->alpha) { ctx = e->engine.func->context_new(e->engine.data.output); e->engine.func->context_color_set @@ -1133,7 +1133,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, obj->map.surface = e->engine.func->image_dirty_region (e->engine.data.output, obj->map.surface, 0, 0, obj->map.surface_w, obj->map.surface_h); - obj->cur.valid_map = EINA_TRUE; + obj->map.cur.valid_map = EINA_TRUE; } e->engine.func->context_clip_unset(e->engine.data.output, context); @@ -1154,9 +1154,9 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, Evas_Object *tobj; obj->cur.cache.clip.dirty = EINA_TRUE; - tobj = obj->cur.map_parent; - obj->cur.map_parent = obj->cur.clipper->cur.map_parent; - obj->cur.map_parent = tobj; + tobj = obj->map.cur.map_parent; + obj->map.cur.map_parent = obj->cur.clipper->map.cur.map_parent; + obj->map.cur.map_parent = tobj; } RECTS_CLIP_TO_RECT(x, y, w, h, @@ -1181,7 +1181,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj, evas_draw_image_map_async_check (obj, e->engine.data.output, context, surface, obj->map.surface, obj->map.spans, - obj->cur.map->smooth, 0, do_async); + obj->map.cur.map->smooth, 0, do_async); } // FIXME: needs to cache these maps and // keep them only rendering updates @@ -1315,7 +1315,7 @@ _evas_render_cutout_add(Evas *eo_e, Evas_Object *eo_obj, int off_x, int off_y) coy = obj->cur.cache.clip.y; cow = obj->cur.cache.clip.w; coh = obj->cur.cache.clip.h; - if ((obj->cur.map) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.usemap)) { Evas_Object *eo_oo; Evas_Object_Protected_Data *oo; @@ -1324,9 +1324,9 @@ _evas_render_cutout_add(Evas *eo_e, Evas_Object *eo_obj, int off_x, int off_y) oo = eo_data_get(eo_oo, EVAS_OBJ_CLASS); while (oo->cur.clipper) { - if ((oo->cur.clipper->cur.map_parent - != oo->cur.map_parent) && - (!((oo->cur.map) && (oo->cur.usemap)))) + if ((oo->cur.clipper->map.cur.map_parent + != oo->map.cur.map_parent) && + (!((oo->map.cur.map) && (oo->map.cur.usemap)))) break; RECTS_CLIP_TO_RECT(cox, coy, cow, coh, oo->cur.geometry.x, @@ -2171,7 +2171,7 @@ void _evas_render_dump_map_surfaces(Evas_Object *eo_obj) { Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS); - if ((obj->cur.map) && obj->map.surface) + if ((obj->map.cur.map) && obj->map.surface) { obj->layer->evas->engine.func->image_map_surface_free (obj->layer->evas->engine.data.output, obj->map.surface); diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 5cd90c631f..b7396b3148 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -5,8 +5,8 @@ static inline Eina_Bool _evas_render_has_map(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { return ((!((obj->func->can_map) && (obj->func->can_map(eo_obj)))) && - ((obj->cur.map) && (obj->cur.usemap))); - // return ((obj->cur.map) && (obj->cur.usemap)); + ((obj->map.cur.map) && (obj->map.cur.usemap))); + // return ((obj->map.cur.map) && (obj->map.cur.usemap)); } static inline void @@ -171,7 +171,7 @@ evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) if (obj->is_smart) { int mapsmt = 0; - if (obj->cur.map && obj->cur.usemap) mapsmt = 1; + if (obj->map.cur.map && obj->map.cur.usemap) mapsmt = 1; if (!mapsmt) return 1; if (evas_object_is_in_output_rect(eo_obj, obj, 0, 0, obj->layer->evas->output.w, obj->layer->evas->output.h) || @@ -231,12 +231,12 @@ evas_object_clip_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) evas_object_coords_recalc(eo_obj, obj); - if ((obj->cur.map) && (obj->cur.usemap)) + if ((obj->map.cur.map) && (obj->map.cur.usemap)) { - cx = obj->cur.map->normal_geometry.x; - cy = obj->cur.map->normal_geometry.y; - cw = obj->cur.map->normal_geometry.w; - ch = obj->cur.map->normal_geometry.h; + cx = obj->map.cur.map->normal_geometry.x; + cy = obj->map.cur.map->normal_geometry.y; + cw = obj->map.cur.map->normal_geometry.w; + ch = obj->map.cur.map->normal_geometry.h; } else { @@ -262,7 +262,7 @@ evas_object_clip_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) // I don't know why this test was here in the first place. As I have // no issue showing up due to this, I keep it and move color out of it. // breaks cliping of mapped images!!! - if (clipper->cur.map_parent == obj->cur.map_parent) + if (clipper->map.cur.map_parent == obj->map.cur.map_parent) { nx = clipper->cur.cache.clip.x; ny = clipper->cur.cache.clip.y; diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index bcabc8a344..3dcda99edd 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -519,10 +519,8 @@ struct _Evas_Object_Protected_Data Evas_Layer *layer; struct { - Evas_Map *map; Evas_Object_Protected_Data *clipper; Evas_Object *eo_clipper; - Evas_Object *map_parent; double scale; Evas_Coord_Rectangle geometry; Evas_Coord_Rectangle bounding_box; @@ -538,13 +536,12 @@ struct _Evas_Object_Protected_Data struct { unsigned char r, g, b, a; } color; - Eina_Bool usemap : 1; - Eina_Bool valid_map : 1; + + Evas_Render_Op render_op : 4; + Eina_Bool visible : 1; Eina_Bool have_clipees : 1; Eina_Bool anti_alias : 1; - Evas_Render_Op render_op : 4; - Eina_Bool valid_bounding_box : 1; Eina_Bool cached_surface : 1; Eina_Bool parent_cached_surface : 1; @@ -553,6 +550,13 @@ struct _Evas_Object_Protected_Data } cur, prev; struct { + struct { + Evas_Map *map; + Evas_Object *map_parent; + + Eina_Bool usemap : 1; + Eina_Bool valid_map : 1; + } cur, prev; void *surface; // surface holding map if needed int surface_w, surface_h; // current surface w & h alloc