optimisipoos. (e17's menus should be more responsive now)

SVN revision: 14084
This commit is contained in:
Carsten Haitzler 2005-04-03 14:22:17 +00:00
parent c3d08acb8b
commit cb54bb2e60
13 changed files with 78 additions and 63 deletions

View File

@ -17,7 +17,8 @@ evas_object_clip_recalc(Evas_Object *obj)
cb = obj->cur.color.b; ca = obj->cur.color.a;
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.clipper->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
nx = obj->cur.clipper->cur.cache.clip.x;
ny = obj->cur.clipper->cur.cache.clip.y;
nw = obj->cur.clipper->cur.cache.clip.w;
@ -44,6 +45,17 @@ evas_object_clip_recalc(Evas_Object *obj)
obj->cur.cache.clip.g = cg;
obj->cur.cache.clip.b = cb;
obj->cur.cache.clip.a = ca;
obj->cur.cache.clip.dirty = 0;
}
void
evas_object_clip_dirty(Evas_Object *obj)
{
Evas_List *l;
obj->cur.cache.clip.dirty = 1;
for (l = obj->clip.clipees; l; l = l->next)
evas_object_clip_dirty(l->data);
}
void
@ -51,10 +63,11 @@ evas_object_recalc_clippees(Evas_Object *obj)
{
Evas_List *l;
evas_object_clip_recalc(obj);
for (l = obj->clip.clipees; l; l = l->next)
if (obj->cur.cache.clip.dirty)
{
evas_object_recalc_clippees(l->data);
evas_object_clip_recalc(obj);
for (l = obj->clip.clipees; l; l = l->next)
evas_object_recalc_clippees(l->data);
}
}
@ -178,6 +191,7 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip)
obj->cur.clipper = clip;
clip->clip.clipees = evas_list_append(clip->clip.clipees, obj);
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (!obj->smart.smart)
{
@ -264,6 +278,7 @@ evas_object_clip_unset(Evas_Object *obj)
obj->cur.clipper->clip.clipees = evas_list_remove(obj->cur.clipper->clip.clipees, obj);
obj->cur.clipper = NULL;
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (!obj->smart.smart)
{

View File

@ -31,7 +31,8 @@ evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
if (obj == stop) goto done;
if ((!evas_event_passes_through(obj)) && (!obj->smart.smart))
{
evas_object_clip_recalc(obj);
// 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)) &&
(obj->cur.visible) &&
(obj->delete_me == 0) &&
@ -462,7 +463,8 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, const void *data)
obj = l->data;
/* if its under the pointer and its visible and its in the new */
/* in list */
evas_object_clip_recalc(obj);
// 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) &&
(obj->cur.visible) &&
(evas_object_clippers_is_visible(obj)) &&

View File

@ -310,7 +310,8 @@ evas_object_gradient_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -1484,7 +1484,8 @@ evas_object_image_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -301,7 +301,8 @@ evas_object_line_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -476,6 +476,7 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
obj->cur.geometry.y = y;
obj->cur.cache.geometry.validity = 0;
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (!evas_event_passes_through(obj))
{
@ -531,6 +532,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
obj->cur.geometry.h = h;
obj->cur.cache.geometry.validity = 0;
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
// if (obj->func->coords_recalc) obj->func->coords_recalc(obj);
if (!evas_event_passes_through(obj))
@ -616,6 +618,7 @@ evas_object_show(Evas_Object *obj)
}
obj->cur.visible = 1;
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (!evas_event_passes_through(obj))
{
@ -658,6 +661,7 @@ evas_object_hide(Evas_Object *obj)
}
obj->cur.visible = 0;
evas_object_change(obj);
evas_object_clip_dirty(obj);
evas_object_recalc_clippees(obj);
if (!evas_event_passes_through(obj))
{

View File

@ -321,7 +321,8 @@ evas_object_polygon_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -172,7 +172,8 @@ evas_object_rectangle_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -895,7 +895,8 @@ evas_object_text_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -3628,7 +3628,8 @@ evas_object_textblock_render_pre(Evas_Object *obj)
/* if someone is clipping this obj - go calculate the clipper */
if (obj->cur.clipper)
{
evas_object_clip_recalc(obj->cur.clipper);
if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj->cur.clipper);
obj->cur.clipper->func->render_pre(obj->cur.clipper);
}
/* now figure what changed and add draw rects */

View File

@ -103,7 +103,8 @@ evas_render_updates(Evas *e)
Evas_Object *obj;
obj = (Evas_Object *)l2;
evas_object_clip_recalc(obj);
// if (obj->cur.cache.clip.dirty)
evas_object_clip_recalc(obj);
/* build active object list */
if (evas_object_is_active(obj))
active_objects = evas_list_append(active_objects, obj);

View File

@ -51,76 +51,60 @@ evas_object_list_prepend(void *in_list, void *in_item)
void *
evas_object_list_append_relative(void *in_list, void *in_item, void *in_relative)
{
Evas_Object_List *l;
Evas_Object_List *list, *item, *relative;
Evas_Object_List *list, *relative, *new_l;
list = in_list;
item = in_item;
new_l = in_item;
relative = in_relative;
for (l = list; l; l = l->next)
if (relative)
{
if (l == relative)
if (relative->next)
{
Evas_Object_List *new_l;
new_l = item;
if (l->next)
{
new_l->next = l->next;
l->next->prev = new_l;
}
else new_l->next = NULL;
l->next = new_l;
new_l->prev = l;
if (!new_l->next)
list->last = new_l;
return list;
new_l->next = relative->next;
relative->next->prev = new_l;
}
else new_l->next = NULL;
relative->next = new_l;
new_l->prev = relative;
if (!new_l->next) list->last = new_l;
return list;
}
return evas_object_list_append(list, item);
return evas_object_list_append(list, new_l);
}
void *
evas_object_list_prepend_relative(void *in_list, void *in_item, void *in_relative)
{
Evas_Object_List *l;
Evas_Object_List *list, *item, *relative;
Evas_Object_List *list, *relative, *new_l;
list = in_list;
item = in_item;
new_l = in_item;
relative = in_relative;
for (l = list; l; l = l->next)
if (relative)
{
if (l == relative)
new_l->prev = relative->prev;
new_l->next = relative;
relative->prev = new_l;
if (new_l->prev)
{
Evas_Object_List *new_l;
new_l = item;
new_l->prev = l->prev;
new_l->next = l;
l->prev = new_l;
if (new_l->prev)
{
new_l->prev->next = new_l;
if (!new_l->next)
list->last = new_l;
return list;
}
new_l->prev->next = new_l;
if (!new_l->next)
list->last = new_l;
return list;
}
else
{
if (!new_l->next)
new_l->last = new_l;
else
{
if (!new_l->next)
new_l->last = new_l;
else
{
new_l->last = list->last;
list->last = NULL;
}
return new_l;
new_l->last = list->last;
list->last = NULL;
}
return new_l;
}
}
return evas_object_list_prepend(list, item);
return evas_object_list_prepend(list, new_l);
}
void *

View File

@ -407,6 +407,7 @@ struct _Evas_Object
int x, y, w, h;
unsigned char r, g, b, a;
char visible : 1;
char dirty : 1;
} clip;
} cache;
struct {
@ -631,6 +632,7 @@ Evas_List *evas_object_render_pre_prev_cur_add(Evas_List *updates, Evas_Object *
void evas_object_render_pre_effect_updates(Evas_List *updates, Evas_Object *obj, int is_v, int was_v);
Evas_List * evas_rects_return_difference_rects(int x, int y, int w, int h, int xx, int yy, int ww, int hh);
void evas_object_clip_recalc(Evas_Object *obj);
void evas_object_clip_dirty(Evas_Object *obj);
Evas_Layer *evas_layer_new(Evas *e);
void evas_layer_pre_free(Evas_Layer *lay);
void evas_layer_free(Evas_Layer *lay);
@ -645,7 +647,7 @@ int evas_object_is_visible(Evas_Object *obj);
int evas_object_was_visible(Evas_Object *obj);
int evas_object_is_opaque(Evas_Object *obj);
int evas_object_was_opaque(Evas_Object *obj);
void evas_object_recalc_clippees(Evas_Object *obj);
//void evas_object_recalc_clippees(Evas_Object *obj);
int evas_object_clippers_is_visible(Evas_Object *obj);
int evas_object_clippers_was_visible(Evas_Object *obj);
void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info);