Hi,

   I wanted to improve evas polygons. In the current situation, we
need to setup and destroy each polygon every time we call evas_render.
It would be nice to make it survive during two call to evas_render and
being able to modify it a little bit. Moving it around and adding
point would be nice to have. So here is a patch that just give this
possibility. Older code should still work fine, but as I only know one
app that use it (expedite) I need your comment on this stuff.

   Of course, this improve speed for the OpenGL engine from something
around 650 to something around 800.

As always have fun with this patch :-)
-- 
Cedric BAIL
Index: src/lib/canvas/evas_object_polygon.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_polygon.c,v
retrieving revision 1.22
diff -u -a -r1.22 evas_object_polygon.c
--- src/lib/canvas/evas_object_polygon.c	28 Jun 2007 23:22:20 -0000	1.22
+++ src/lib/canvas/evas_object_polygon.c	11 Jun 2008 15:20:44 -0000
@@ -10,12 +10,18 @@
 
 struct _Evas_Object_Polygon
 {
-   DATA32            magic;
-   Evas_List        *points;
-   
-   void             *engine_data;
+   DATA32               magic;
+   Evas_List           *points;
 
-   char              changed : 1;
+   void                *engine_data;
+
+   struct {
+      int x, y;
+   } offset;
+
+   Evas_Coord_Rectangle	geometry;
+
+   char                 changed : 1;
 };
 
 struct _Evas_Polygon_Point
@@ -98,6 +104,7 @@
    Evas_Polygon_Point *p;
    Evas_Coord min_x, max_x, min_y, max_y;
    int is, was = 0;
+   int off_x, off_y;
 
    MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
    return;
@@ -113,10 +120,29 @@
 					      obj->layer->evas->pointer.x,
 					      obj->layer->evas->pointer.y, 1, 1);
      }
+
+   if (!o->points)
+     {
+	o->offset.x = obj->cur.geometry.x - obj->prev.geometry.x;
+	o->offset.y = obj->cur.geometry.y - obj->prev.geometry.y;
+     }
+   else
+     {
+	/* Update all points and take offset into account. */
+	Evas_List *over;
+
+	for (over = o->points; over; over = evas_list_next(over))
+	  {
+	     p = evas_list_data(over);
+	     p->x += o->offset.x;
+	     p->y += o->offset.y;
+	  }
+     }
+
    p = malloc(sizeof(Evas_Polygon_Point));
    if (!p) return;
-   p->x = x;
-   p->y = y;
+   p->x = x + o->offset.x;
+   p->y = y + o->offset.y;
 
    if (!o->points)
      {
@@ -142,6 +168,10 @@
      }
    o->points = evas_list_append(o->points, p);
 
+   o->geometry = obj->cur.geometry;
+   o->offset.x = 0;
+   o->offset.y = 0;
+
 ////   obj->cur.cache.geometry.validity = 0;
    o->changed = 1;
    evas_object_change(obj);
@@ -289,28 +319,33 @@
 							   context);
    obj->layer->evas->engine.func->context_render_op_set(output, context,
 							obj->cur.render_op);
-   o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
-									obj->layer->evas->engine.data.context,
-									o->engine_data);
-   for (l = o->points; l; l = l->next)
+   if (o->changed)
      {
-	Evas_Polygon_Point *p;
-	//int px, py;
+	o->engine_data = obj->layer->evas->engine.func->polygon_points_clear(obj->layer->evas->engine.data.output,
+									     obj->layer->evas->engine.data.context,
+									     o->engine_data);
+	for (l = o->points; l; l = l->next)
+	  {
+	     Evas_Polygon_Point *p;
+	     //int px, py;
 
-        p = l->data;
+	     p = l->data;
 
-        //px = evas_coord_world_x_to_screen(obj->layer->evas, p->x);
-	//py = evas_coord_world_y_to_screen(obj->layer->evas, p->y);
-	o->engine_data = obj->layer->evas->engine.func->polygon_point_add(obj->layer->evas->engine.data.output,
-									  obj->layer->evas->engine.data.context,
-									  o->engine_data,
-									  p->x + x, p->y + y);
+	     //px = evas_coord_world_x_to_screen(obj->layer->evas, p->x);
+	     //py = evas_coord_world_y_to_screen(obj->layer->evas, p->y);
+	     o->engine_data = obj->layer->evas->engine.func->polygon_point_add(obj->layer->evas->engine.data.output,
+									       obj->layer->evas->engine.data.context,
+									       o->engine_data,
+									       p->x, p->y);
+	  }
      }
+
    if (o->engine_data)
      obj->layer->evas->engine.func->polygon_draw(output,
 						 context,
 						 surface,
-						 o->engine_data);
+						 o->engine_data,
+						 o->offset.x + x, o->offset.y + y);
 }
 
 static void
@@ -383,6 +418,12 @@
 	goto done;
      }
    done:
+   if ((obj->cur.geometry.x != obj->prev.geometry.x) ||
+       (obj->cur.geometry.y != obj->prev.geometry.y))
+     {
+	o->offset.x += obj->cur.geometry.x - obj->prev.geometry.x;
+	o->offset.y += obj->cur.geometry.y - obj->prev.geometry.y;
+     }
    evas_object_render_pre_effect_updates(updates, obj, is_v, was_v);
 }
 
Index: src/lib/engines/common/evas_pipe.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_pipe.c,v
retrieving revision 1.12
diff -u -a -r1.12 evas_pipe.c
--- src/lib/engines/common/evas_pipe.c	31 May 2008 04:16:39 -0000	1.12
+++ src/lib/engines/common/evas_pipe.c	11 Jun 2008 15:20:44 -0000
@@ -337,24 +337,24 @@
    if (info)
      {
 	RGBA_Draw_Context context;
-	
+
 	memcpy(&(context), &(op->context), sizeof(RGBA_Draw_Context));
 #ifdef EVAS_SLI
 	evas_common_draw_context_set_sli(&(context), info->y, info->h);
-#else	
+#else
 	evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
-#endif	
+#endif
 	evas_common_polygon_draw(dst, &(context),
-				 op->op.poly.points);
+				 op->op.poly.points, 0, 0);
      }
    else
      evas_common_polygon_draw(dst, &(op->context),
-			      op->op.poly.points);
+			      op->op.poly.points, 0, 0);
 }
 
 EAPI void
 evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
-			   RGBA_Polygon_Point *points)
+			   RGBA_Polygon_Point *points, int x, int y)
 {
    RGBA_Pipe_Op *op;
    RGBA_Polygon_Point *pts = NULL, *p, *pp;
@@ -368,8 +368,8 @@
 	pp = calloc(1, sizeof(RGBA_Polygon_Point));
 	if (pp)
 	  {
-	     pp->x = p->x;
-	     pp->y = p->y;
+	     pp->x = p->x + x;
+	     pp->y = p->y + y;
 	     pts = evas_object_list_append(pts, pp);
 	  }
      }
Index: src/lib/engines/common/evas_polygon_main.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_polygon_main.c,v
retrieving revision 1.8
diff -u -a -r1.8 evas_polygon_main.c
--- src/lib/engines/common/evas_polygon_main.c	12 Apr 2008 00:32:25 -0000	1.8
+++ src/lib/engines/common/evas_polygon_main.c	11 Jun 2008 15:20:44 -0000
@@ -118,7 +118,7 @@
 }
 
 EAPI void
-evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points)
+evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
 {
    RGBA_Gfx_Func      func;
    RGBA_Polygon_Point *pt;
@@ -128,7 +128,7 @@
    int                num_active_edges;
    int                n;
    int                i, j, k;
-   int                y0, y1, y;
+   int                y0, y1, yi;
    int                ext_x, ext_y, ext_w, ext_h;
    int               *sorted_index;
 
@@ -183,8 +183,8 @@
    for (l = (Evas_Object_List *)points; l; l = l->next)
      {
 	pt = (RGBA_Polygon_Point *)l;
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + x;
+	point[k].y = pt->y + y;
 	point[k].i = k;
 	k++;
      }
@@ -194,8 +194,8 @@
    for (l = (Evas_Object_List *)points; l; l = l->next)
      {
 	pt = (RGBA_Polygon_Point *)l;
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + x;
+	point[k].y = pt->y + y;
 	point[k].i = k;
 	k++;
      }
@@ -207,31 +207,31 @@
    num_active_edges = 0;
    spans = NULL;
 
-   for (y = y0; y <= y1; y++)
+   for (yi = y0; yi <= y1; yi++)
      {
-	for (; (k < n) && (point[sorted_index[k]].y <= ((double)y + 0.5)); k++)
+	for (; (k < n) && (point[sorted_index[k]].y <= ((double)yi + 0.5)); k++)
 	  {
 	     i = sorted_index[k];
 
 	     if (i > 0) j = i - 1;
 	     else j = n - 1;
-	     if (point[j].y <= ((double)y - 0.5))
+	     if (point[j].y <= ((double)yi - 0.5))
 	       {
 		  POLY_EDGE_DEL(j)
 	       }
-	     else if (point[j].y > ((double)y + 0.5))
+	     else if (point[j].y > ((double)yi + 0.5))
 	       {
-		  POLY_EDGE_ADD(j, y)
+		  POLY_EDGE_ADD(j, yi)
 	       }
 	     if (i < (n - 1)) j = i + 1;
 	     else j = 0;
-	     if (point[j].y <= ((double)y - 0.5))
+	     if (point[j].y <= ((double)yi - 0.5))
 	       {
 		  POLY_EDGE_DEL(i)
 	       }
-	     else if (point[j].y > ((double)y + 0.5))
+	     else if (point[j].y > ((double)yi + 0.5))
 	       {
-		  POLY_EDGE_ADD(i, y)
+		  POLY_EDGE_ADD(i, yi)
 	       }
 	  }
 
@@ -254,7 +254,7 @@
 		  if (x1 >= (ext_x + ext_w)) x1 = ext_x + ext_w - 1;
 		  span = malloc(sizeof(RGBA_Span));
 		  spans = evas_object_list_append(spans, span);
-		  span->y = y;
+		  span->y = yi;
 		  span->x = x0;
 		  span->w = (x1 - x0) + 1;
 	       }
Index: src/lib/engines/common_16/evas_soft16_polygon.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_polygon.c,v
retrieving revision 1.1
diff -u -a -r1.1 evas_soft16_polygon.c
--- src/lib/engines/common_16/evas_soft16_polygon.c	12 Apr 2008 02:11:07 -0000	1.1
+++ src/lib/engines/common_16/evas_soft16_polygon.c	11 Jun 2008 15:20:44 -0000
@@ -76,7 +76,7 @@
 }
 
 void
-soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points)
+soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
 {
    RGBA_Polygon_Point *pt;
    RGBA_Vertex       *point;
@@ -85,7 +85,7 @@
    int                num_active_edges;
    int                n;
    int                i, j, k;
-   int                y0, y1, y;
+   int                y0, y1, yi;
    int                ext_x, ext_y, ext_w, ext_h;
    int               *sorted_index;
    DATA8 alpha;
@@ -142,8 +142,8 @@
    for (k = 0, l = (Evas_Object_List *)points; l; k++, l = l->next)
      {
 	pt = (RGBA_Polygon_Point *)l;
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + x;
+	point[k].y = pt->y + y;
 	point[k].i = k;
      }
    qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
@@ -154,8 +154,8 @@
    for (k = 0, l = (Evas_Object_List *)points; l; k++, l = l->next)
      {
 	pt = (RGBA_Polygon_Point *)l;
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + x;
+	point[k].y = pt->y + y;
 	point[k].i = k;
      }
 
@@ -165,31 +165,31 @@
    k = 0;
    num_active_edges = 0;
 
-   for (y = y0; y <= y1; y++)
+   for (yi = y0; yi <= y1; yi++)
      {
-	for (; (k < n) && (point[sorted_index[k]].y <= ((float)y + 0.5)); k++)
+	for (; (k < n) && (point[sorted_index[k]].y <= ((float)yi + 0.5)); k++)
 	  {
 	     i = sorted_index[k];
 
 	     if (i > 0) j = i - 1;
 	     else j = n - 1;
-	     if (point[j].y <= ((float)y - 0.5))
+	     if (point[j].y <= ((float)yi - 0.5))
 	       {
 		  POLY_EDGE_DEL(j)
 	       }
-	     else if (point[j].y > ((float)y + 0.5))
+	     else if (point[j].y > ((float)yi + 0.5))
 	       {
-		  POLY_EDGE_ADD(j, y)
+		  POLY_EDGE_ADD(j, yi)
 	       }
 	     if (i < (n - 1)) j = i + 1;
 	     else j = 0;
-	     if (point[j].y <= ((float)y - 0.5))
+	     if (point[j].y <= ((float)yi - 0.5))
 	       {
 		  POLY_EDGE_DEL(i)
 	       }
-	     else if (point[j].y > ((float)y + 0.5))
+	     else if (point[j].y > ((float)yi + 0.5))
 	       {
-		  POLY_EDGE_ADD(i, y)
+		  POLY_EDGE_ADD(i, yi)
 	       }
 	  }
 
@@ -213,7 +213,7 @@
 		  if (x1 >= (ext_x + ext_w)) x1 = ext_x + ext_w - 1;
 
 		  w = (x1 - x0) + 1;
-		  dst_itr = dst->pixels + (y * dst->stride) + x0;
+		  dst_itr = dst->pixels + (yi * dst->stride) + x0;
 
 		  if (alpha == 32)
 		    _soft16_scanline_fill_solid_solid(dst_itr, w, rgb565);
Index: src/lib/include/evas_common.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v
retrieving revision 1.104
diff -u -a -r1.104 evas_common.h
--- src/lib/include/evas_common.h	3 Jun 2008 09:09:35 -0000	1.104
+++ src/lib/include/evas_common.h	11 Jun 2008 15:20:44 -0000
@@ -1166,7 +1166,7 @@
 
 EAPI RGBA_Polygon_Point *evas_common_polygon_point_add    (RGBA_Polygon_Point *points, int x, int y);
 EAPI RGBA_Polygon_Point *evas_common_polygon_points_clear (RGBA_Polygon_Point *points);
-EAPI void                evas_common_polygon_draw         (RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+EAPI void                evas_common_polygon_draw         (RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 
 /****/
 EAPI void     evas_common_blit_init               (void);
@@ -1278,7 +1278,7 @@
 EAPI void evas_common_pipe_free(RGBA_Image *im);
 EAPI void evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h);
 EAPI void evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1);
-EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 EAPI void evas_common_pipe_grad_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient *gr);
 EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const char *text);
 EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
Index: src/lib/include/evas_common_soft16.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common_soft16.h,v
retrieving revision 1.4
diff -u -a -r1.4 evas_common_soft16.h
--- src/lib/include/evas_common_soft16.h	3 Jun 2008 14:45:38 -0000	1.4
+++ src/lib/include/evas_common_soft16.h	11 Jun 2008 15:20:44 -0000
@@ -126,7 +126,7 @@
 /**
  * Polygon (evas_soft16_polygon.c)
  */
-EAPI void                soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+  EAPI void                soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 
 /**
  * Line (evas_soft16_line.c)
Index: src/lib/include/evas_private.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.107
diff -u -a -r1.107 evas_private.h
--- src/lib/include/evas_private.h	4 Jun 2008 16:42:39 -0000	1.107
+++ src/lib/include/evas_private.h	11 Jun 2008 15:20:44 -0000
@@ -598,7 +598,7 @@
 
    void *(*polygon_point_add)              (void *data, void *context, void *polygon, int x, int y);
    void *(*polygon_points_clear)           (void *data, void *context, void *polygon);
-   void (*polygon_draw)                    (void *data, void *context, void *surface, void *polygon);
+   void (*polygon_draw)                    (void *data, void *context, void *surface, void *polygon, int x, int y);
 
    void *(*gradient_new)                   (void *data);
    void (*gradient_free)                   (void *data, void *gradient);
Index: src/modules/engines/cairo_x11/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/cairo_x11/evas_engine.c,v
retrieving revision 1.13
diff -u -a -r1.13 evas_engine.c
--- src/modules/engines/cairo_x11/evas_engine.c	3 Jun 2008 09:09:36 -0000	1.13
+++ src/modules/engines/cairo_x11/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -48,7 +48,7 @@
 
 static void *eng_polygon_point_add(void *data, void *context, void *polygon, int x, int y);
 static void *eng_polygon_points_clear(void *data, void *context, void *polygon);
-static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon);
+static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y);
 
 static void *eng_gradient_new(void *data);
 static void eng_gradient_free(void *data, void *gradient);
@@ -741,7 +741,7 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    Render_Engine *re;
    Evas_Cairo_Context *ctxt;
@@ -757,11 +757,11 @@
    if (pt)
      {
 	Evas_List *l;
-	cairo_move_to(ctxt->cairo, pt->x, pt->y);
+	cairo_move_to(ctxt->cairo, pt->x + x, pt->y + y);
 	for (l = poly->points->next; l; l = l->next)
 	  {
 	     pt = l->data;
-	     cairo_line_to(ctxt->cairo, pt->x, pt->y);
+	     cairo_line_to(ctxt->cairo, pt->x + x, pt->y + y);
 	  }
      }
    r = ctxt->col.r;
Index: src/modules/engines/gl_common/evas_gl_common.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_common/evas_gl_common.h,v
retrieving revision 1.18
diff -u -a -r1.18 evas_gl_common.h
--- src/modules/engines/gl_common/evas_gl_common.h	10 Jun 2008 12:18:54 -0000	1.18
+++ src/modules/engines/gl_common/evas_gl_common.h	11 Jun 2008 15:20:44 -0000
@@ -233,7 +233,7 @@
 void              evas_gl_common_rect_draw(Evas_GL_Context *gc, int x, int y, int w, int h);
 void              evas_gl_common_image_draw(Evas_GL_Context *gc, Evas_GL_Image *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth);
 void              evas_gl_common_line_draw(Evas_GL_Context *gc, int x1, int y1, int x2, int y2);
-void              evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly);
+void              evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y);
 
 Evas_GL_Font_Texture *evas_gl_font_texture_new(Evas_GL_Context *gc, RGBA_Font_Glyph *fg);
 void                  evas_gl_font_texture_free(Evas_GL_Font_Texture *ft);
Index: src/modules/engines/gl_common/evas_gl_polygon.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_common/evas_gl_polygon.c,v
retrieving revision 1.3
diff -u -a -r1.3 evas_gl_polygon.c
--- src/modules/engines/gl_common/evas_gl_polygon.c	10 Jun 2008 12:18:54 -0000	1.3
+++ src/modules/engines/gl_common/evas_gl_polygon.c	11 Jun 2008 15:20:44 -0000
@@ -81,7 +81,7 @@
 #endif
 
 void
-evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly)
+evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly, int x, int y)
 {
    int r, g, b, a;
    Evas_List *l;
@@ -108,6 +108,9 @@
    evas_gl_common_context_read_buf_set(gc, GL_BACK);
    evas_gl_common_context_write_buf_set(gc, GL_BACK);
 
+   glPushMatrix();
+   glTranslatef(x, y, 0);
+
    if (poly->changed || poly->dl <= 0)
      {
 	if (poly->dl > 0) glDeleteLists(poly->dl, 1);
@@ -162,8 +165,10 @@
 
 	poly->changed = 0;
 
+	glPopMatrix();
 	return ;
      }
 
    glCallList(poly->dl);
+   glPopMatrix();
 }
Index: src/modules/engines/gl_glew/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_glew/evas_engine.c,v
retrieving revision 1.3
diff -u -a -r1.3 evas_engine.c
--- src/modules/engines/gl_glew/evas_engine.c	3 Jun 2008 09:09:37 -0000	1.3
+++ src/modules/engines/gl_glew/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -318,13 +318,13 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    Render_Engine *re;
 
    re = (Render_Engine *)data;
    re->window->gl_context->dc = context;
-   evas_gl_common_poly_draw(re->window->gl_context, polygon);
+   evas_gl_common_poly_draw(re->window->gl_context, polygon, x, y);
 }
 
 static void *
Index: src/modules/engines/gl_x11/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/gl_x11/evas_engine.c,v
retrieving revision 1.29
diff -u -a -r1.29 evas_engine.c
--- src/modules/engines/gl_x11/evas_engine.c	3 Jun 2008 09:09:37 -0000	1.29
+++ src/modules/engines/gl_x11/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -366,13 +366,13 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    Render_Engine *re;
 
    re = (Render_Engine *)data;
    re->win->gl_context->dc = context;
-   evas_gl_common_poly_draw(re->win->gl_context, polygon);
+   evas_gl_common_poly_draw(re->win->gl_context, polygon, x, y);
 }
 
 static void *
Index: src/modules/engines/glitz_x11/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/glitz_x11/evas_engine.c,v
retrieving revision 1.2
diff -u -a -r1.2 evas_engine.c
--- src/modules/engines/glitz_x11/evas_engine.c	17 Jun 2007 02:56:58 -0000	1.2
+++ src/modules/engines/glitz_x11/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -51,7 +51,7 @@
 
 static void eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2, int y2);
 
-static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon);
+static void eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y);
 
 static void *eng_gradient_new(void *data);
 static void eng_gradient_free(void *data, void *gradient);
Index: src/modules/engines/software_16/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16/evas_engine.c,v
retrieving revision 1.13
diff -u -a -r1.13 evas_engine.c
--- src/modules/engines/software_16/evas_engine.c	3 Jun 2008 14:45:39 -0000	1.13
+++ src/modules/engines/software_16/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -167,9 +167,9 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
-   soft16_polygon_draw(surface, context, polygon);
+   soft16_polygon_draw(surface, context, polygon, x, y);
 }
 
 static void *
Index: src/modules/engines/software_16_sdl/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_16_sdl/evas_engine.c,v
retrieving revision 1.3
diff -u -a -r1.3 evas_engine.c
--- src/modules/engines/software_16_sdl/evas_engine.c	3 Jun 2008 14:45:39 -0000	1.3
+++ src/modules/engines/software_16_sdl/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -971,7 +971,7 @@
 }
 
 static void
-evas_engine_sdl16_polygon_draw(void *data, void *context, void *surface, void *polygon)
+evas_engine_sdl16_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    SDL_Engine_Image_Entry       *eim = surface;
    int                           mustlock_im = 0;
@@ -983,7 +983,7 @@
 	_SDL_UPDATE_PIXELS(eim);
      }
 
-   soft16_polygon_draw((Soft16_Image *) eim->cache_entry.src, context, polygon);
+   soft16_polygon_draw((Soft16_Image *) eim->cache_entry.src, context, polygon, x, y);
 
    if (mustlock_im)
      SDL_UnlockSurface(eim->surface);
Index: src/modules/engines/software_generic/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_generic/evas_engine.c,v
retrieving revision 1.23
diff -u -a -r1.23 evas_engine.c
--- src/modules/engines/software_generic/evas_engine.c	10 Jun 2008 09:22:27 -0000	1.23
+++ src/modules/engines/software_generic/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -180,15 +180,15 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
 #ifdef BUILD_PTHREAD
    if (cpunum > 1)
-     evas_common_pipe_poly_draw(surface, context, polygon);
+     evas_common_pipe_poly_draw(surface, context, polygon, x, y);
    else
 #endif
      {
-	evas_common_polygon_draw(surface, context, polygon);
+	evas_common_polygon_draw(surface, context, polygon, x, y);
 	evas_common_cpu_end_opt();
      }
 }
Index: src/modules/engines/software_sdl/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_sdl/evas_engine.c,v
retrieving revision 1.11
diff -u -a -r1.11 evas_engine.c
--- src/modules/engines/software_sdl/evas_engine.c	3 Jun 2008 09:09:37 -0000	1.11
+++ src/modules/engines/software_sdl/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -740,7 +740,7 @@
 }
 
 static void
-evas_engine_sdl_polygon_draw(void *data, void *context, void *surface, void *polygon)
+evas_engine_sdl_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    SDL_Engine_Image_Entry       *eim = surface;
    int                           mustlock_im = 0;
@@ -752,7 +752,7 @@
 	_SDL_UPDATE_PIXELS(eim);
      }
 
-   evas_common_polygon_draw((RGBA_Image *) eim->cache_entry.src, context, polygon);
+   evas_common_polygon_draw((RGBA_Image *) eim->cache_entry.src, context, polygon, x, y);
    evas_common_cpu_end_opt();
 
    if (mustlock_im)
Index: src/modules/engines/xrender_x11/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.c,v
retrieving revision 1.22
diff -u -a -r1.22 evas_engine.c
--- src/modules/engines/xrender_x11/evas_engine.c	12 Apr 2008 00:32:28 -0000	1.22
+++ src/modules/engines/xrender_x11/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -334,9 +334,9 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
-   _xre_poly_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon);
+   _xre_poly_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon, x, y);
 }
 
 static void *
Index: src/modules/engines/xrender_x11/evas_engine.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine.h,v
retrieving revision 1.10
diff -u -a -r1.10 evas_engine.h
--- src/modules/engines/xrender_x11/evas_engine.h	7 Apr 2008 23:07:23 -0000	1.10
+++ src/modules/engines/xrender_x11/evas_engine.h	11 Jun 2008 15:20:44 -0000
@@ -81,7 +81,7 @@
 void             _xr_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
 void             _xr_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
 void             _xr_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-void             _xre_poly_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+void             _xre_poly_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
   
     
 typedef struct _XR_Image XR_Image;
Index: src/modules/engines/xrender_x11/evas_engine_xrender.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_x11/evas_engine_xrender.c,v
retrieving revision 1.30
diff -u -a -r1.30 evas_engine_xrender.c
--- src/modules/engines/xrender_x11/evas_engine_xrender.c	7 Apr 2008 23:07:23 -0000	1.30
+++ src/modules/engines/xrender_x11/evas_engine_xrender.c	11 Jun 2008 15:20:44 -0000
@@ -676,7 +676,7 @@
 }
 
 void
-_xre_poly_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points)
+_xre_poly_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
 {
    RGBA_Polygon_Point *pt;
    int i, num;
@@ -730,8 +730,8 @@
      {
 	if (i < num)
 	  {
-	     pts[i].x = pt->x;
-	     pts[i].y = pt->y;
+	     pts[i].x = pt->x + x;
+	     pts[i].y = pt->y + y;
 	     i++;
 	  }
     }
Index: src/modules/engines/xrender_xcb/evas_engine.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.c,v
retrieving revision 1.15
diff -u -a -r1.15 evas_engine.c
--- src/modules/engines/xrender_xcb/evas_engine.c	12 Apr 2008 00:32:29 -0000	1.15
+++ src/modules/engines/xrender_xcb/evas_engine.c	11 Jun 2008 15:20:44 -0000
@@ -349,9 +349,9 @@
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
-   _xre_poly_draw((Xcb_Render_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon);
+   _xre_poly_draw((Xcb_Render_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon, x, y);
 }
 
 static void *
Index: src/modules/engines/xrender_xcb/evas_engine.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine.h,v
retrieving revision 1.8
diff -u -a -r1.8 evas_engine.h
--- src/modules/engines/xrender_xcb/evas_engine.h	1 Oct 2006 18:26:47 -0000	1.8
+++ src/modules/engines/xrender_xcb/evas_engine.h	11 Jun 2008 15:20:44 -0000
@@ -84,7 +84,7 @@
 void                _xr_render_surface_copy(Xcb_Render_Surface *srs, Xcb_Render_Surface *drs, int sx, int sy, int x, int y, int w, int h);
 void                _xr_render_surface_rectangle_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
 void                _xr_render_surface_line_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-void                _xre_poly_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+void                _xre_poly_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
   
     
 typedef struct _XR_Image XR_Image;
Index: src/modules/engines/xrender_xcb/evas_engine_xrender.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/xrender_xcb/evas_engine_xrender.c,v
retrieving revision 1.10
diff -u -a -r1.10 evas_engine_xrender.c
--- src/modules/engines/xrender_xcb/evas_engine_xrender.c	14 Apr 2007 22:45:39 -0000	1.10
+++ src/modules/engines/xrender_xcb/evas_engine_xrender.c	11 Jun 2008 15:20:45 -0000
@@ -809,7 +809,7 @@
 }
 
 void
-_xre_poly_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points)
+_xre_poly_draw(Xcb_Render_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y)
 {
 /*    RGBA_Polygon_Point *pt; */
 /*    int i, num; */
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to