Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

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


Modified Files:
        evas_line_main.c 


Log Message:


fix segv's in simple line draws

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_line_main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- evas_line_main.c    16 May 2006 07:38:18 -0000      1.14
+++ evas_line_main.c    16 May 2006 08:52:05 -0000      1.15
@@ -152,23 +152,25 @@
 

    if (dy == 0)

      {

-       if (dx < 0)

+       if ((y0 >= ty) && (y0 <= by))

          {

-           int  tmp = x1;

-

-           x1 = x0;

-           x0 = tmp;

+            if (dx < 0)

+              {

+                 int  tmp = x1;

+                 

+                 x1 = x0;

+                 x0 = tmp;

+              }

+            

+            if (x0 < lx) x0 = lx;

+            if (x1 > rx) x1 = rx;

+            

+            len = x1 - x0 + 1;

+            p = dst->image->data + (dstw * y0) + x0;

+            sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, 
len, dc->render_op);

+            if (sfunc)

+              sfunc(NULL, NULL, color, p, len);

          }

-

-       if (x0 < lx) x0 = lx;

-       if (x1 > rx) x1 = rx;

-

-       len = x1 - x0 + 1;

-       p = dst->image->data + (dstw * y0) + x0;

-       sfunc = evas_common_gfx_func_composite_color_span_get(color, dst, len, 
dc->render_op);

-       if (sfunc)

-          sfunc(NULL, NULL, color, p, len);

-

        return;

      }

 

@@ -177,17 +179,19 @@
 

    if (dx == 0)

      {

-       if (y0 < ty) y0 = ty;

-       if (y1 > by) y1 = by;

-

-       len = y1 - y0 + 1;

-       p = dst->image->data + (dstw * y0) + x0;

-       while (len--)

+       if ((x0 >= lx) && (x0 <= rx))

          {

-           pfunc(0, 255, color, p);

-           p += dstw;

+            if (y0 < ty) y0 = ty;

+            if (y1 > by) y1 = by;

+            

+            len = y1 - y0 + 1;

+            p = dst->image->data + (dstw * y0) + x0;

+            while (len--)

+              {

+                 pfunc(0, 255, color, p);

+                 p += dstw;

+              }

          }

-

        return;

      }

 

@@ -252,10 +256,20 @@
                  }

              }

          }

-       len = y1 - y0 + 1;

-       p = dst->image->data + (dstw * y0) + x0;

-       if (dx > 0)  dstw++;

-       else  dstw--;

+       if (y1 > y0)

+         {

+            p = dst->image->data + (dstw * y0) + x0;

+            len = y1 - y0 + 1;

+            if (dx > 0)  dstw++;

+            else  dstw--;

+         }

+       else

+         {

+            len = y0 - y1 + 1;

+            p = dst->image->data + (dstw * y1) + x1;

+            if (dx > 0)  dstw--;

+            else  dstw++;

+         }

 

        while (len--)

          {





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to