Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/include


Modified Files:
        evas_inline.x evas_private.h 


Log Message:


cedric rect + arrays patch for reducing allocs

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_inline.x,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_inline.x       12 Jun 2008 13:22:26 -0000      1.3
+++ evas_inline.x       7 Jul 2008 21:29:29 -0000       1.4
@@ -1,6 +1,50 @@
 #ifndef EVAS_INLINE_H
 #define EVAS_INLINE_H
 
+static inline void
+evas_add_rect(Evas_Rectangles *rects, int x, int y, int w, int h)
+{
+   if ((rects->count + 1) > rects->total)
+     {
+       Evas_Rectangle *_add_rect;
+       unsigned int _tmp_total;
+
+       _tmp_total = rects->total + 32;
+       _add_rect = realloc(rects->array, sizeof(Evas_Rectangle) * _tmp_total);
+       if (!_add_rect) return ;
+
+       rects->total = _tmp_total;
+       rects->array = _add_rect;
+     }
+   rects->array[rects->count].x = x;
+   rects->array[rects->count].y = y;
+   rects->array[rects->count].w = w;
+   rects->array[rects->count].h = h;
+   rects->count += 1;
+}
+
+static inline Cutout_Rect*
+evas_common_draw_context_cutouts_add(Cutout_Rects* rects,
+                                     int x, int y, int w, int h)
+{
+   Cutout_Rect* rect;
+
+   if (rects->max < (rects->active + 1))
+     {
+       rects->max += 32;
+       rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
+     }
+
+   rect = rects->rects + rects->active;
+   rect->x = x;
+   rect->y = y;
+   rect->w = w;
+   rect->h = h;
+   rects->active++;
+
+   return rect;
+}
+
 static inline int
 evas_object_is_opaque(Evas_Object *obj)
 {
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- evas_private.h      4 Jun 2008 16:42:39 -0000       1.107
+++ evas_private.h      7 Jul 2008 21:29:29 -0000       1.108
@@ -103,6 +103,7 @@
 typedef struct _Evas_Key_Grab               Evas_Key_Grab;
 typedef struct _Evas_Callbacks              Evas_Callbacks;
 typedef struct _Evas_Format                 Evas_Format;
+typedef struct _Evas_Rectangles             Evas_Rectangles;
 
 #define MAGIC_EVAS          0x70777770
 #define MAGIC_OBJ           0x71777770
@@ -381,6 +382,13 @@
    unsigned char     delete_me : 1;
 };
 
+struct _Evas_Rectangles
+{
+   unsigned int    total;
+   unsigned int    count;
+   Evas_Rectangle *array;
+};
+
 struct _Evas_Size
 {
    Evas_Coord w, h;
@@ -696,11 +704,11 @@
 void evas_object_inject(Evas_Object *obj, Evas *e);
 void evas_object_release(Evas_Object *obj, int clean_layer);
 void evas_object_change(Evas_Object *obj);
-Evas_List *evas_object_render_pre_visible_change(Evas_List *updates, 
Evas_Object *obj, int is_v, int was_v);
-Evas_List *evas_object_render_pre_clipper_change(Evas_List *updates, 
Evas_Object *obj);
-Evas_List *evas_object_render_pre_prev_cur_add(Evas_List *updates, Evas_Object 
*obj);
-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_render_pre_visible_change(Evas_Rectangles *rects, Evas_Object 
*obj, int is_v, int was_v);
+void evas_object_render_pre_clipper_change(Evas_Rectangles *rects, Evas_Object 
*obj);
+void evas_object_render_pre_prev_cur_add(Evas_Rectangles *rects, Evas_Object 
*obj);
+void evas_object_render_pre_effect_updates(Evas_Rectangles *rects, Evas_Object 
*obj, int is_v, int was_v);
+void evas_rects_return_difference_rects(Evas_Rectangles *rects, int x, int y, 
int w, int h, int xx, int yy, int ww, int hh);
 
 void evas_object_clip_dirty(Evas_Object *obj);
 void evas_object_recalc_clippees(Evas_Object *obj);



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to