natah's clip patch - seems to be all genki :)

SVN revision: 15938
This commit is contained in:
Carsten Haitzler 2005-07-29 07:46:22 +00:00
parent a17ebe021d
commit 02664a6eb0
3 changed files with 28 additions and 18 deletions

View File

@ -6,9 +6,14 @@ 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;
// FIXME: This shouldn't be necessary as frozen checks should happen at a
// higher level.
// if (obj->layer->evas->events_frozen > 0) return;
if (obj->layer->evas->events_frozen > 0) return; /* Skip coord recalc on smart object and invalid output */
evas_object_coords_recalc(obj); if ((!obj->smart.smart) &&
(obj->cur.cache.geometry.validity != obj->layer->evas->output_validity))
evas_object_coords_recalc(obj);
cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y; cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y;
cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h; cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h;
if (obj->cur.color.a == 0) cvis = 0; if (obj->cur.color.a == 0) cvis = 0;
@ -64,10 +69,10 @@ evas_object_recalc_clippees(Evas_Object *obj)
{ {
Evas_List *l; Evas_List *l;
if (obj->cur.cache.clip.dirty) evas_object_clip_recalc(obj);
for (l = obj->clip.clipees; l; l = l->next)
{ {
evas_object_clip_recalc(obj); if (obj->cur.cache.clip.dirty)
for (l = obj->clip.clipees; l; l = l->next)
evas_object_recalc_clippees(l->data); evas_object_recalc_clippees(l->data);
} }
} }
@ -193,7 +198,8 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
clip->clip.clipees = evas_list_append(clip->clip.clipees, obj); clip->clip.clipees = evas_list_append(clip->clip.clipees, obj);
evas_object_change(obj); evas_object_change(obj);
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj); if ((!obj->layer->evas->events_frozen) && (obj->cur.cache.clip.dirty))
evas_object_recalc_clippees(obj);
if (!obj->smart.smart) if (!obj->smart.smart)
{ {
if (evas_object_is_in_output_rect(obj, if (evas_object_is_in_output_rect(obj,
@ -281,7 +287,8 @@ evas_object_clip_unset(Evas_Object *obj)
obj->cur.clipper = NULL; obj->cur.clipper = NULL;
evas_object_change(obj); evas_object_change(obj);
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj); if (!obj->layer->evas->events_frozen && obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj);
if (!obj->smart.smart) if (!obj->smart.smart)
{ {
if (evas_object_is_in_output_rect(obj, if (evas_object_is_in_output_rect(obj,

View File

@ -40,8 +40,6 @@ evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
if (obj == stop) goto done; if (obj == stop) goto done;
if ((!evas_event_passes_through(obj)) && (!obj->smart.smart)) if ((!evas_event_passes_through(obj)) && (!obj->smart.smart))
{ {
// FIXME: i don't think we need this
// evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(obj, x, y, 1, 1)) && if ((evas_object_is_in_output_rect(obj, x, y, 1, 1)) &&
(obj->cur.visible) && (obj->cur.visible) &&
(obj->delete_me == 0) && (obj->delete_me == 0) &&
@ -140,8 +138,8 @@ evas_event_thaw(Evas *e)
Evas_Object *obj; Evas_Object *obj;
obj = (Evas_Object *)l2; obj = (Evas_Object *)l2;
evas_object_clip_recalc(obj); if (obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj); evas_object_recalc_clippees(obj);
} }
} }
} }

View File

@ -275,9 +275,10 @@ evas_object_render_pre_effect_updates(Evas_List *updates, Evas_Object *obj, int
void void
evas_object_coords_recalc(Evas_Object *obj) evas_object_coords_recalc(Evas_Object *obj)
{ {
if (obj->smart.smart) return; // FIXME: Check before entering
if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity) // if (obj->smart.smart) return;
return; // if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity)
// return;
obj->cur.cache.geometry.x = obj->cur.cache.geometry.x =
evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x); evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x);
obj->cur.cache.geometry.y = obj->cur.cache.geometry.y =
@ -482,7 +483,6 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
if (obj->layer->evas->events_frozen != 0) if (obj->layer->evas->events_frozen != 0)
{ {
evas_object_recalc_clippees(obj);
if (!pass) if (!pass)
{ {
if (!obj->smart.smart) if (!obj->smart.smart)
@ -499,6 +499,8 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
} }
} }
} }
else if (obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj);
evas_object_inform_call_move(obj); evas_object_inform_call_move(obj);
} }
@ -544,7 +546,6 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
obj->cur.cache.geometry.validity = 0; obj->cur.cache.geometry.validity = 0;
evas_object_change(obj); evas_object_change(obj);
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (obj->layer->evas->events_frozen != 0) if (obj->layer->evas->events_frozen != 0)
{ {
// if (obj->func->coords_recalc) obj->func->coords_recalc(obj); // if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
@ -564,6 +565,8 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
} }
} }
} }
else if (obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj);
evas_object_inform_call_resize(obj); evas_object_inform_call_resize(obj);
} }
@ -636,7 +639,6 @@ evas_object_show(Evas_Object *obj)
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
if (obj->layer->evas->events_frozen != 0) if (obj->layer->evas->events_frozen != 0)
{ {
evas_object_recalc_clippees(obj);
if (!evas_event_passes_through(obj)) if (!evas_event_passes_through(obj))
{ {
if (!obj->smart.smart) if (!obj->smart.smart)
@ -652,6 +654,8 @@ evas_object_show(Evas_Object *obj)
} }
} }
} }
else if (obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj);
evas_object_inform_call_show(obj); evas_object_inform_call_show(obj);
} }
@ -683,7 +687,6 @@ evas_object_hide(Evas_Object *obj)
evas_object_clip_dirty(obj); evas_object_clip_dirty(obj);
if (obj->layer->evas->events_frozen != 0) if (obj->layer->evas->events_frozen != 0)
{ {
evas_object_recalc_clippees(obj);
if (!evas_event_passes_through(obj)) if (!evas_event_passes_through(obj))
{ {
if (!obj->smart.smart) if (!obj->smart.smart)
@ -731,6 +734,8 @@ evas_object_hide(Evas_Object *obj)
} }
} }
} }
else if (obj->cur.cache.clip.dirty)
evas_object_recalc_clippees(obj);
evas_object_inform_call_hide(obj); evas_object_inform_call_hide(obj);
} }