aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/evas
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-04-03 14:22:17 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-04-03 14:22:17 +0000
commitcb54bb2e60e351c6315f1ee9474e3924eb8abe71 (patch)
tree94dbc4808d48eb4b9b78d1431d5aa238b99120cf /legacy/evas
parentfile and collection cache - this should remove a lot of file io... :) (diff)
downloadefl-cb54bb2e60e351c6315f1ee9474e3924eb8abe71.tar.gz
optimisipoos. (e17's menus should be more responsive now)
SVN revision: 14084
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/lib/canvas/evas_clip.c23
-rw-r--r--legacy/evas/src/lib/canvas/evas_events.c6
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_gradient.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_image.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_line.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_main.c4
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_polygon.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_rectangle.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_text.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_textblock.c3
-rw-r--r--legacy/evas/src/lib/canvas/evas_render.c3
-rw-r--r--legacy/evas/src/lib/data/evas_object_list.c80
-rw-r--r--legacy/evas/src/lib/include/evas_private.h4
13 files changed, 78 insertions, 63 deletions
diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c
index c977f7b700..ad23c8f1f8 100644
--- a/legacy/evas/src/lib/canvas/evas_clip.c
+++ b/legacy/evas/src/lib/canvas/evas_clip.c
@@ -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,17 +45,29 @@ 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_recalc_clippees(Evas_Object *obj)
+evas_object_clip_dirty(Evas_Object *obj)
{
Evas_List *l;
- evas_object_clip_recalc(obj);
+ obj->cur.cache.clip.dirty = 1;
for (l = obj->clip.clipees; l; l = l->next)
+ evas_object_clip_dirty(l->data);
+}
+
+void
+evas_object_recalc_clippees(Evas_Object *obj)
+{
+ Evas_List *l;
+
+ 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)
{
diff --git a/legacy/evas/src/lib/canvas/evas_events.c b/legacy/evas/src/lib/canvas/evas_events.c
index bb7e73f576..439ce84892 100644
--- a/legacy/evas/src/lib/canvas/evas_events.c
+++ b/legacy/evas/src/lib/canvas/evas_events.c
@@ -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)) &&
diff --git a/legacy/evas/src/lib/canvas/evas_object_gradient.c b/legacy/evas/src/lib/canvas/evas_object_gradient.c
index 145a8da305..bcc038bbe6 100644
--- a/legacy/evas/src/lib/canvas/evas_object_gradient.c
+++ b/legacy/evas/src/lib/canvas/evas_object_gradient.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c
index 2c5566c8a1..5d6669c96d 100644
--- a/legacy/evas/src/lib/canvas/evas_object_image.c
+++ b/legacy/evas/src/lib/canvas/evas_object_image.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_line.c b/legacy/evas/src/lib/canvas/evas_object_line.c
index add7a12283..4532c427cb 100644
--- a/legacy/evas/src/lib/canvas/evas_object_line.c
+++ b/legacy/evas/src/lib/canvas/evas_object_line.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_main.c b/legacy/evas/src/lib/canvas/evas_object_main.c
index d0a47171fc..e353fa5c0f 100644
--- a/legacy/evas/src/lib/canvas/evas_object_main.c
+++ b/legacy/evas/src/lib/canvas/evas_object_main.c
@@ -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))
{
diff --git a/legacy/evas/src/lib/canvas/evas_object_polygon.c b/legacy/evas/src/lib/canvas/evas_object_polygon.c
index cc4cbdd871..112d474755 100644
--- a/legacy/evas/src/lib/canvas/evas_object_polygon.c
+++ b/legacy/evas/src/lib/canvas/evas_object_polygon.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_rectangle.c b/legacy/evas/src/lib/canvas/evas_object_rectangle.c
index 124698fe3b..9a65ba0b73 100644
--- a/legacy/evas/src/lib/canvas/evas_object_rectangle.c
+++ b/legacy/evas/src/lib/canvas/evas_object_rectangle.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_text.c b/legacy/evas/src/lib/canvas/evas_object_text.c
index 7ce2396c77..7f3423c367 100644
--- a/legacy/evas/src/lib/canvas/evas_object_text.c
+++ b/legacy/evas/src/lib/canvas/evas_object_text.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c
index 24cb859279..ebe912cfa5 100644
--- a/legacy/evas/src/lib/canvas/evas_object_textblock.c
+++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c
@@ -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 */
diff --git a/legacy/evas/src/lib/canvas/evas_render.c b/legacy/evas/src/lib/canvas/evas_render.c
index 952fa18b23..8a8df441ec 100644
--- a/legacy/evas/src/lib/canvas/evas_render.c
+++ b/legacy/evas/src/lib/canvas/evas_render.c
@@ -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);
diff --git a/legacy/evas/src/lib/data/evas_object_list.c b/legacy/evas/src/lib/data/evas_object_list.c
index 38cd92e862..16e897a74b 100644
--- a/legacy/evas/src/lib/data/evas_object_list.c
+++ b/legacy/evas/src/lib/data/evas_object_list.c
@@ -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 *
diff --git a/legacy/evas/src/lib/include/evas_private.h b/legacy/evas/src/lib/include/evas_private.h
index 7047f5c589..b0191a0b35 100644
--- a/legacy/evas/src/lib/include/evas_private.h
+++ b/legacy/evas/src/lib/include/evas_private.h
@@ -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);