Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/engines/common


Modified Files:
        evas_draw_main.c evas_rectangle_main.c 


Log Message:


working on optimising software-x11 with the one-buffer persistence idea that
software-16 uses. it works and in some cases gets massive speedups (70%+) but
in a few its slowdowns (30% down) in expedite tests - why, i don't know. it
should be the same or better in all tests. disabled for now - also not
complete. < 32bpp wont' work and not sure rotation works and masks don't work
either.

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_draw_main.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- evas_draw_main.c    13 Sep 2007 14:14:37 -0000      1.23
+++ evas_draw_main.c    2 Oct 2007 03:40:14 -0000       1.24
@@ -25,17 +25,19 @@
 {
    Cutout_Rect* rect;
 
-   if (rects->max < rects->active + 1) {
-      rects->max += 8;
-      rects->rects = realloc(rects->rects, sizeof(Cutout_Rect) * rects->max);
-   }
+   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 = rects->rects + rects->active;
    rect->x = x;
    rect->y = y;
    rect->w = w;
    rect->h = h;
-
+   rects->active++;
+   
    return rect;
 }
 
@@ -43,11 +45,13 @@
 evas_common_draw_context_cutouts_del(Cutout_Rects* rects,
                                      int index)
 {
-   if (index >= 0 && index < rects->active)
+   if ((index >= 0) && (index < rects->active))
      {
-        Cutout_Rect*    rect = rects->rects + index;
-
-        memmove(rect, rect + 1, sizeof (Cutout_Rect) * (rects->active - index 
- 1));
+        Cutout_Rect*    rect;
+       
+       rect = rects->rects + index;
+        memmove(rect, rect + 1, 
+               sizeof(Cutout_Rect) * (rects->active - index - 1));
         rects->active--;
      }
 }
@@ -176,6 +180,12 @@
 EAPI void
 evas_common_draw_context_add_cutout(RGBA_Draw_Context *dc, int x, int y, int 
w, int h)
 {
+   if (dc->clip.use)
+     {
+        RECTS_CLIP_TO_RECT(x, y, w, h,
+                          dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
+       if ((w < 1) || (h < 1)) return;
+     }
    evas_common_draw_context_cutouts_add(&dc->cutout, x, y, w, h);
 }
 
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_rectangle_main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- evas_rectangle_main.c       4 Apr 2007 09:55:39 -0000       1.7
+++ evas_rectangle_main.c       2 Oct 2007 03:40:14 -0000       1.8
@@ -19,30 +19,30 @@
    if ((w <= 0) || (h <= 0)) return;
    if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, dst->image->w, dst->image->h)))
      return;
-   /* no cutouts - cut right to the chase */
-   if (!dc->cutout.rects)
-     {
-       rectangle_draw_internal(dst, dc, x, y, w, h);
-       return;
-     }
    /* save out clip info */
    c = dc->clip.use; cx = dc->clip.x; cy = dc->clip.y; cw = dc->clip.w; ch = 
dc->clip.h;
    evas_common_draw_context_clip_clip(dc, 0, 0, dst->image->w, dst->image->h);
-   evas_common_draw_context_clip_clip(dc, x, y, w, h);
-   /* our clip is 0 size.. abort */
-   if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
+   /* no cutouts - cut right to the chase */
+   if (!dc->cutout.rects)
      {
-       dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; 
dc->clip.h = ch;
-       return;
+       rectangle_draw_internal(dst, dc, x, y, w, h);
      }
-   rects = evas_common_draw_context_apply_cutouts(dc);
-   for (i = 0; i < rects->active; ++i)
+   else
      {
-       r = rects->rects + i;
-       evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
-       rectangle_draw_internal(dst, dc, x, y, w, h);
+       evas_common_draw_context_clip_clip(dc, x, y, w, h);
+       /* our clip is 0 size.. abort */
+       if ((dc->clip.w > 0) && (dc->clip.h > 0))
+         {
+            rects = evas_common_draw_context_apply_cutouts(dc);
+            for (i = 0; i < rects->active; ++i)
+              {
+                 r = rects->rects + i;
+                 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
+                 rectangle_draw_internal(dst, dc, x, y, w, h);
+              }
+            evas_common_draw_context_apply_clear_cutouts(rects);
+         }
      }
-   evas_common_draw_context_apply_clear_cutouts(rects);
    /* restore clip info */
    dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; 
dc->clip.h = ch;
 }
@@ -54,14 +54,7 @@
    int yy;
    DATA32 *ptr;
 
-   if ((w <= 0) || (h <= 0)) return;
-   RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, dst->image->w, dst->image->h);
-   if ((w <= 0) || (h <= 0)) return;
-
-   if (dc->clip.use)
-     {
-       RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, 
dc->clip.h);
-     }
+   RECTS_CLIP_TO_RECT(x, y, w, h, dc->clip.x, dc->clip.y, dc->clip.w, 
dc->clip.h);
    if ((w <= 0) || (h <= 0)) return;
 
    func = evas_common_gfx_func_composite_color_span_get(dc->col.col, dst, w, 
dc->render_op);



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to