now that mostly fixes this map clip issue... ugh. took a while to come up

with an elegant solution. also it does add overhead to fix. i might be
able to improve the overhead.
 


SVN revision: 51823
This commit is contained in:
Carsten Haitzler 2010-09-01 21:37:10 +00:00
parent d2ebce58b3
commit bfab8b9254
4 changed files with 50 additions and 24 deletions

View File

@ -70,42 +70,64 @@ evas_object_clippers_was_visible(Evas_Object *obj)
* *
*/ */
#define MAP_ACROSS 1
static void static void
evas_object_child_map_across_mark(Evas_Object *obj, Eina_List *clippers, evas_object_child_map_across_mark(Evas_Object *obj, Evas_Object *map_obj, Eina_Bool force)
Eina_Bool map)
{ {
#if 0 #ifdef MAP_ACROSS
if (map) if ((obj->cur.map_parent != map_obj) || force)
{
// if obj->cur.clipper is in clippers list, then set
// obj->cur.clip_across_map to 1
}
else
{ {
obj->cur.map_parent = map_obj;
obj->cur.cache.clip.dirty = 1;
evas_object_clip_recalc(obj);
if (obj->smart.smart)
{
Evas_Object *obj2;
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
{
// if obj has its own map - skip it. already done
if ((obj2->cur.map) && (obj2->cur.usemap)) continue;
evas_object_child_map_across_mark(obj2, map_obj, force);
}
}
} }
#endif #endif
} }
static void
evas_object_clip_across_check(Evas_Object *obj)
{
if (!obj->cur.clipper) return;
if (obj->cur.clipper->cur.map_parent != obj->cur.map_parent)
evas_object_child_map_across_mark(obj, obj->cur.map_parent, 1);
}
// this function is called on an object when map is enabled or disabled on it
// thus creating a "map boundary" at that point.
//
// FIXME: smart member add/del and clip set/unset needs to check the new
// smart parent (if any)
void void
evas_object_mapped_clip_across_mark(Evas_Object *obj) evas_object_mapped_clip_across_mark(Evas_Object *obj)
{ {
return; #ifdef MAP_ACROSS
#if 0
Eina_Bool map = 0; Eina_Bool map = 0;
if ((obj->cur.map) && (obj->cur.usemap)) map = 1; if ((obj->cur.map) && (obj->cur.usemap)) map = 1;
if (map) if (map)
{ {
Eina_List *list = NULL; evas_object_child_map_across_mark(obj, obj, 0);
// FIXME: list = build list of all clippers that are children of obj
// up until any obj that has map applied to it. if map is applied
// tghen we must assume this has been run before o9n that obj and
// its children etc.
evas_object_child_map_across_mark(obj, list, map);
} }
else else
evas_object_child_map_across_mark(obj, NULL, map); {
if (obj->smart.parent)
evas_object_child_map_across_mark
(obj, obj->smart.parent->cur.map_parent, 0);
else
evas_object_child_map_across_mark(obj, NULL, 0);
}
#endif #endif
} }
@ -231,6 +253,7 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
obj->layer->evas->last_timestamp, obj->layer->evas->last_timestamp,
NULL); NULL);
} }
evas_object_clip_across_check(obj);
} }
/** /**
@ -332,6 +355,7 @@ evas_object_clip_unset(Evas_Object *obj)
obj->layer->evas->last_timestamp, obj->layer->evas->last_timestamp,
NULL); NULL);
} }
evas_object_clip_across_check(obj);
} }
/** /**

View File

@ -201,6 +201,7 @@ evas_object_smart_member_add(Evas_Object *obj, Evas_Object *smart_obj)
evas_object_smart_member_cache_invalidate(obj); evas_object_smart_member_cache_invalidate(obj);
obj->restack = 1; obj->restack = 1;
evas_object_change(obj); evas_object_change(obj);
evas_object_mapped_clip_across_mark(obj);
if (smart_obj->smart.smart->smart_class->member_add) if (smart_obj->smart.smart->smart_class->member_add)
smart_obj->smart.smart->smart_class->member_add(smart_obj, obj); smart_obj->smart.smart->smart_class->member_add(smart_obj, obj);
} }
@ -241,6 +242,7 @@ evas_object_smart_member_del(Evas_Object *obj)
evas_object_inject(obj, obj->layer->evas); evas_object_inject(obj, obj->layer->evas);
obj->restack = 1; obj->restack = 1;
evas_object_change(obj); evas_object_change(obj);
evas_object_mapped_clip_across_mark(obj);
} }
/** /**

View File

@ -175,9 +175,8 @@ evas_object_clip_recalc(Evas_Object *obj)
int cx, cy, cw, ch, cvis, cr, cg, cb, ca; int cx, cy, cw, ch, cvis, cr, cg, cb, ca;
int nx, ny, nw, nh, nvis, nr, ng, nb, na; int nx, ny, nw, nh, nvis, nr, ng, nb, na;
if ((!obj->cur.cache.clip.dirty && if ((!obj->cur.cache.clip.dirty) &&
!(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) || !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty))
(obj->cur.clip_across_map))
return; return;
if (obj->layer->evas->events_frozen > 0) return; if (obj->layer->evas->events_frozen > 0) return;
evas_object_coords_recalc(obj); evas_object_coords_recalc(obj);
@ -201,7 +200,8 @@ evas_object_clip_recalc(Evas_Object *obj)
else cvis = obj->cur.visible; else cvis = obj->cur.visible;
cr = obj->cur.color.r; cg = obj->cur.color.g; cr = obj->cur.color.r; cg = obj->cur.color.g;
cb = obj->cur.color.b; ca = obj->cur.color.a; cb = obj->cur.color.b; ca = obj->cur.color.a;
if ((obj->cur.clipper) && (!obj->cur.clip_across_map)) if ((obj->cur.clipper) &&
(obj->cur.clipper->cur.map_parent == obj->cur.map_parent))
{ {
// this causes problems... hmmm // this causes problems... hmmm
if (obj->cur.clipper->cur.cache.clip.dirty) if (obj->cur.clipper->cur.cache.clip.dirty)

View File

@ -430,12 +430,12 @@ struct _Evas_Object
unsigned char r, g, b, a; unsigned char r, g, b, a;
} color; } color;
Evas_Object *clipper; Evas_Object *clipper;
Evas_Object *map_parent;
short layer; short layer;
Eina_Bool usemap : 1; Eina_Bool usemap : 1;
Eina_Bool visible : 1; Eina_Bool visible : 1;
Eina_Bool have_clipees : 1; Eina_Bool have_clipees : 1;
Eina_Bool anti_alias : 1; Eina_Bool anti_alias : 1;
Eina_Bool clip_across_map : 1;
Evas_Render_Op render_op : 4; Evas_Render_Op render_op : 4;
} cur, prev; } cur, prev;