For the sake of consistency, I would like to propose this patch that
enable the possibility to move around polygons like any other evas
object. It comes with a patch to expedite. With this patch, it also
open the path to improve polygon rendering by calculating them only
when they are altered, not moved around.

So what's your feedback on the subject ? Should I apply it or discard it ?
-- 
Cedric BAIL
diff --git a/evas/src/lib/canvas/evas_object_polygon.c b/evas/src/lib/canvas/evas_object_polygon.c
index 698316c..e3eb7ff 100644
--- a/evas/src/lib/canvas/evas_object_polygon.c
+++ b/evas/src/lib/canvas/evas_object_polygon.c
@@ -10,12 +10,18 @@ typedef struct _Evas_Polygon_Point       Evas_Polygon_Point;
 
 struct _Evas_Object_Polygon
 {
-   DATA32            magic;
-   Eina_List        *points;
+   DATA32               magic;
+   Eina_List           *points;
 
-   void             *engine_data;
+   void                *engine_data;
 
-   char              changed : 1;
+   struct {
+      int x, y;
+   } offset;
+
+   Evas_Coord_Rectangle	geometry;
+
+   char                 changed : 1;
 };
 
 struct _Evas_Polygon_Point
@@ -114,6 +120,7 @@ evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
    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;
@@ -129,10 +136,28 @@ evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
 					      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. */
+	Eina_List *over;
+
+	EINA_LIST_FOREACH(o->points, over, p)
+	  {
+	     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)
      {
@@ -158,6 +183,10 @@ evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
      }
    o->points = eina_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);
@@ -307,24 +336,28 @@ evas_object_polygon_render(Evas_Object *obj, void *output, void *context, void *
 							   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);
-   EINA_LIST_FOREACH(o->points, l, p)
+   if (o->changed)
      {
-	//int px, py;
-        //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);
+	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);
+	EINA_LIST_FOREACH(o->points, l, p)
+	  {
+	     //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
@@ -402,6 +435,12 @@ evas_object_polygon_render_pre(Evas_Object *obj)
 	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(&obj->layer->evas->clip_changes, obj, is_v, was_v);
 }
 
diff --git a/evas/src/lib/engines/common/evas_pipe.c b/evas/src/lib/engines/common/evas_pipe.c
index a9fee85..694ed21 100644
--- a/evas/src/lib/engines/common/evas_pipe.c
+++ b/evas/src/lib/engines/common/evas_pipe.c
@@ -354,16 +354,16 @@ evas_common_pipe_poly_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Threa
 	evas_common_draw_context_clip_clip(&(context), info->x, info->y, info->w, info->h);
 #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;
@@ -377,8 +377,8 @@ evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
 	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 = (RGBA_Polygon_Point *)eina_inlist_append(EINA_INLIST_GET(pts), EINA_INLIST_GET(pp));
 	  }
      }
diff --git a/evas/src/lib/engines/common/evas_pipe.h b/evas/src/lib/engines/common/evas_pipe.h
index 55c1aed..43f02a6 100644
--- a/evas/src/lib/engines/common/evas_pipe.h
+++ b/evas/src/lib/engines/common/evas_pipe.h
@@ -11,7 +11,7 @@ EAPI void evas_common_pipe_flush(RGBA_Image *im);
 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_grad2_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h, RGBA_Gradient2 *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);
diff --git a/evas/src/lib/engines/common/evas_polygon.h b/evas/src/lib/engines/common/evas_polygon.h
index d023568..0695f54 100644
--- a/evas/src/lib/engines/common/evas_polygon.h
+++ b/evas/src/lib/engines/common/evas_polygon.h
@@ -6,7 +6,7 @@ EAPI void                evas_common_polygon_init         (void);
 
 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);
 
 
 #endif /* _EVAS_POLYGON_H */
diff --git a/evas/src/lib/engines/common/evas_polygon_main.c b/evas/src/lib/engines/common/evas_polygon_main.c
index f92b1bc..cd8410a 100644
--- a/evas/src/lib/engines/common/evas_polygon_main.c
+++ b/evas/src/lib/engines/common/evas_polygon_main.c
@@ -123,7 +123,7 @@ polygon_edge_sorter(const void *a, const void *b)
 }
 
 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;
@@ -133,7 +133,7 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
    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;
 
@@ -187,8 +187,8 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	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++;
      }
@@ -197,8 +197,8 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	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++;
      }
@@ -210,31 +210,31 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
    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)
 	       }
 	  }
 
@@ -257,7 +257,7 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
 		  if (x1 >= (ext_x + ext_w)) x1 = ext_x + ext_w - 1;
 		  span = malloc(sizeof(RGBA_Span));
 		  spans = eina_inlist_append(spans, EINA_INLIST_GET(span));
-		  span->y = y;
+		  span->y = yi;
 		  span->x = x0;
 		  span->w = (x1 - x0) + 1;
 	       }
diff --git a/evas/src/lib/engines/common_16/evas_soft16_polygon.c b/evas/src/lib/engines/common_16/evas_soft16_polygon.c
index 9400aa0..dd125d2 100644
--- a/evas/src/lib/engines/common_16/evas_soft16_polygon.c
+++ b/evas/src/lib/engines/common_16/evas_soft16_polygon.c
@@ -76,7 +76,7 @@ polygon_edge_sorter(const void *a, const void *b)
 }
 
 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;
@@ -84,7 +84,7 @@ soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point
    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;
@@ -140,8 +140,8 @@ soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	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++;
      }
@@ -153,8 +153,8 @@ soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	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++;
      }
@@ -165,31 +165,31 @@ soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point
    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 @@ soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point
 		  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);
diff --git a/evas/src/lib/include/evas_common_soft16.h b/evas/src/lib/include/evas_common_soft16.h
index 801d9e9..14653be 100644
--- a/evas/src/lib/include/evas_common_soft16.h
+++ b/evas/src/lib/include/evas_common_soft16.h
@@ -89,7 +89,7 @@ EAPI void                soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Cont
 /**
  * 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)
diff --git a/evas/src/lib/include/evas_private.h b/evas/src/lib/include/evas_private.h
index 6522a91..2ae3d19 100644
--- a/evas/src/lib/include/evas_private.h
+++ b/evas/src/lib/include/evas_private.h
@@ -607,7 +607,7 @@ struct _Evas_Func
 
    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 (*gradient2_color_np_stop_insert)   (void *data, void *gradient, int r, int g, int b, int a, float pos);
    void (*gradient2_clear)                  (void *data, void *gradient);
diff --git a/evas/src/modules/engines/cairo_x11/evas_engine.c b/evas/src/modules/engines/cairo_x11/evas_engine.c
index da3b0aa..df81a2f 100644
--- a/evas/src/modules/engines/cairo_x11/evas_engine.c
+++ b/evas/src/modules/engines/cairo_x11/evas_engine.c
@@ -52,7 +52,7 @@ static void eng_line_draw(void *data, void *context, void *surface, int x1, int
 
 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);
@@ -764,7 +764,7 @@ eng_polygon_points_clear(void *data, void *context, void *polygon)
 }
 
 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;
@@ -780,9 +780,9 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
    if (pt)
      {
 	Eina_List *l;
-	cairo_move_to(ctxt->cairo, pt->x, pt->y);
+	cairo_move_to(ctxt->cairo, pt->x + x, pt->y + y);
 	EINA_LIST_FOREACH(poly->points->next, l, pt)
-	  cairo_line_to(ctxt->cairo, pt->x, pt->y);
+	  cairo_line_to(ctxt->cairo, pt->x + x, pt->y + y);
      }
    r = ctxt->col.r;
    g = ctxt->col.g;
diff --git a/evas/src/modules/engines/directfb/evas_engine.c b/evas/src/modules/engines/directfb/evas_engine.c
index 427ed5e..1960c22 100644
--- a/evas/src/modules/engines/directfb/evas_engine.c
+++ b/evas/src/modules/engines/directfb/evas_engine.c
@@ -1140,13 +1140,13 @@ evas_engine_dfb_rectangle_draw(void *data, void *context, void *surface, int x,
 
 #ifndef DFB_USE_EVAS_POLYGON_DRAW
 static void
-evas_engine_dfb_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
+evas_engine_dfb_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
-   _dfb_polygon_draw(surface, context, polygon);
+   _dfb_polygon_draw(surface, context, polygon, x, y);
 }
 #else
 static void
-evas_engine_dfb_polygon_draw(void *data, void *context, void *surface, void *polygon)
+evas_engine_dfb_polygon_draw(void *data, void *context, void *surface, void *polygon, int x, int y)
 {
    DirectFB_Engine_Image_Entry *eim = surface;
    IDirectFBSurface *screen;
@@ -1158,7 +1158,7 @@ evas_engine_dfb_polygon_draw(void *data, void *context, void *surface, void *pol
    if (!_dfb_lock_and_sync_image(screen, dst, DSLF_READ | DSLF_WRITE))
      return;
 
-   evas_common_polygon_draw(dst, context, polygon);
+   evas_common_polygon_draw(dst, context, polygon, x, y);
    evas_common_cpu_end_opt();
 
    dst->image.data = NULL;
diff --git a/evas/src/modules/engines/directfb/evas_engine.h b/evas/src/modules/engines/directfb/evas_engine.h
index a8d8357..7ad1e38 100644
--- a/evas/src/modules/engines/directfb/evas_engine.h
+++ b/evas/src/modules/engines/directfb/evas_engine.h
@@ -66,6 +66,6 @@ struct _Render_Engine
 };
 
 int _dfb_surface_set_color_from_context(IDirectFBSurface *surface, RGBA_Draw_Context *dc);
-void _dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points);
+void _dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points, int x, int y);
 
 #endif
diff --git a/evas/src/modules/engines/directfb/polygon.c b/evas/src/modules/engines/directfb/polygon.c
index 5b3ad25..715fd84 100644
--- a/evas/src/modules/engines/directfb/polygon.c
+++ b/evas/src/modules/engines/directfb/polygon.c
@@ -116,7 +116,7 @@ polygon_spans_fill(IDirectFBSurface *surface, int y, const span_t *spans, int n_
 
 
 void
-_dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points)
+_dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist *points, int px, int py)
 {
    RGBA_Polygon_Point *pt;
    RGBA_Vertex        *point;
@@ -180,8 +180,8 @@ _dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + px;
+	point[k].y = pt->y + py;
 	point[k].i = k;
 	k++;
      }
@@ -190,8 +190,8 @@ _dfb_polygon_draw(IDirectFBSurface *surface, RGBA_Draw_Context *dc, Eina_Inlist
    k = 0;
    EINA_INLIST_FOREACH(points, pt)
      {
-	point[k].x = pt->x;
-	point[k].y = pt->y;
+	point[k].x = pt->x + px;
+	point[k].y = pt->y + py;
 	point[k].i = k;
 	k++;
      }
diff --git a/evas/src/modules/engines/gl_common/evas_gl_common.h b/evas/src/modules/engines/gl_common/evas_gl_common.h
index a626760..6049641 100644
--- a/evas/src/modules/engines/gl_common/evas_gl_common.h
+++ b/evas/src/modules/engines/gl_common/evas_gl_common.h
@@ -356,7 +356,7 @@ void              evas_gl_font_texture_draw(void *gc, void *surface, void *dc, R
 
 Evas_GL_Polygon  *evas_gl_common_poly_point_add(Evas_GL_Polygon *poly, int x, int y);
 Evas_GL_Polygon  *evas_gl_common_poly_points_clear(Evas_GL_Polygon *poly);
-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);
 
 void              evas_gl_common_line_draw(Evas_GL_Context *gc, int x1, int y1, int x2, int y2);
 
diff --git a/evas/src/modules/engines/gl_common/evas_gl_polygon.c b/evas/src/modules/engines/gl_common/evas_gl_polygon.c
index 1425d1c..49dd902 100644
--- a/evas/src/modules/engines/gl_common/evas_gl_polygon.c
+++ b/evas/src/modules/engines/gl_common/evas_gl_polygon.c
@@ -120,7 +120,7 @@ polygon_edge_sorter(const void *a, const void *b)
 }
 
 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 dx, int dy)
 {
    Cutout_Rects *rects;
    Cutout_Rect  *r;
@@ -164,8 +164,8 @@ evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly)
    k = 0;
    EINA_LIST_FOREACH(poly->points, l, pt)
      {
-        point[k].x = pt->x;
-        point[k].y = pt->y;
+        point[k].x = pt->x + dx;
+        point[k].y = pt->y + dy;
         point[k].i = k;
         k++;
      }
@@ -175,8 +175,8 @@ evas_gl_common_poly_draw(Evas_GL_Context *gc, Evas_GL_Polygon *poly)
 
    EINA_LIST_FOREACH(poly->points, l, pt)
      {
-        point[k].x = pt->x;
-        point[k].y = pt->y;
+        point[k].x = pt->x + dx;
+        point[k].y = pt->y + dy;
         point[k].i = k;
         k++;
      }
diff --git a/evas/src/modules/engines/gl_glew/evas_engine.c b/evas/src/modules/engines/gl_glew/evas_engine.c
index b215de8..ebc24c8 100644
--- a/evas/src/modules/engines/gl_glew/evas_engine.c
+++ b/evas/src/modules/engines/gl_glew/evas_engine.c
@@ -314,13 +314,13 @@ eng_polygon_points_clear(void *data, void *context, void *polygon)
 }
 
 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->win->gl_context, polygon);
+//--//   evas_gl_common_poly_draw(re->window->gl_context, polygon, x, y);
 }
 
 static void
diff --git a/evas/src/modules/engines/gl_sdl/evas_engine.c b/evas/src/modules/engines/gl_sdl/evas_engine.c
index e2c8891..c9e8088 100644
--- a/evas/src/modules/engines/gl_sdl/evas_engine.c
+++ b/evas/src/modules/engines/gl_sdl/evas_engine.c
@@ -320,14 +320,14 @@ eng_polygon_points_clear(void *data, void *context __UNUSED__, void *polygon)
 }
 
 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;
    evas_gl_common_context_target_surface_set(re->gl_context, surface);
    re->gl_context->dc = context;
-   evas_gl_common_poly_draw(re->gl_context, polygon);
+   evas_gl_common_poly_draw(re->gl_context, polygon, x, y);
 }
 
 static void
diff --git a/evas/src/modules/engines/gl_x11/evas_engine.c b/evas/src/modules/engines/gl_x11/evas_engine.c
index a440fcf..fe13c1f 100644
--- a/evas/src/modules/engines/gl_x11/evas_engine.c
+++ b/evas/src/modules/engines/gl_x11/evas_engine.c
@@ -587,7 +587,7 @@ eng_polygon_points_clear(void *data, void *context __UNUSED__, void *polygon)
 }
 
 static void
-eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data, void *context, void *surface __UNUSED__, void *polygon, int x, int y)
 {
    Render_Engine *re;
 
@@ -595,7 +595,7 @@ eng_polygon_draw(void *data, void *context, void *surface, void *polygon)
    eng_window_use(re->win);
    evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
    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
diff --git a/evas/src/modules/engines/software_16/evas_engine.c b/evas/src/modules/engines/software_16/evas_engine.c
index d2de032..3f6cf3c 100644
--- a/evas/src/modules/engines/software_16/evas_engine.c
+++ b/evas/src/modules/engines/software_16/evas_engine.c
@@ -191,9 +191,9 @@ eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *
 }
 
 static void
-eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
-   soft16_polygon_draw(surface, context, polygon);
+   soft16_polygon_draw(surface, context, polygon, x, y);
 }
 
 
diff --git a/evas/src/modules/engines/software_16_sdl/evas_engine.c b/evas/src/modules/engines/software_16_sdl/evas_engine.c
index 6fc11cd..049da61 100644
--- a/evas/src/modules/engines/software_16_sdl/evas_engine.c
+++ b/evas/src/modules/engines/software_16_sdl/evas_engine.c
@@ -993,7 +993,7 @@ evas_engine_sdl16_rectangle_draw(void *data __UNUSED__, void *context, void *sur
 }
 
 static void
-evas_engine_sdl16_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
+evas_engine_sdl16_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
    SDL_Engine_Image_Entry       *eim = surface;
    int                           mustlock_im = 0;
@@ -1005,7 +1005,7 @@ evas_engine_sdl16_polygon_draw(void *data __UNUSED__, void *context, void *surfa
 	_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);
diff --git a/evas/src/modules/engines/software_generic/evas_engine.c b/evas/src/modules/engines/software_generic/evas_engine.c
index a224ae5..568bcdd 100644
--- a/evas/src/modules/engines/software_generic/evas_engine.c
+++ b/evas/src/modules/engines/software_generic/evas_engine.c
@@ -179,15 +179,15 @@ eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *
 }
 
 static void
-eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
+eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
 #ifdef BUILD_PIPE_RENDER
    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();
      }
 }
diff --git a/evas/src/modules/engines/software_sdl/evas_engine.c b/evas/src/modules/engines/software_sdl/evas_engine.c
index d78e203..db1e590 100644
--- a/evas/src/modules/engines/software_sdl/evas_engine.c
+++ b/evas/src/modules/engines/software_sdl/evas_engine.c
@@ -838,7 +838,7 @@ evas_engine_sdl_rectangle_draw(void *data __UNUSED__, void *context, void *surfa
 }
 
 static void
-evas_engine_sdl_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
+evas_engine_sdl_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon, int x, int y)
 {
    SDL_Engine_Image_Entry       *eim = surface;
    int                           mustlock_im = 0;
@@ -850,7 +850,7 @@ evas_engine_sdl_polygon_draw(void *data __UNUSED__, void *context, void *surface
 	_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)
diff --git a/evas/src/modules/engines/xrender_x11/evas_engine.c b/evas/src/modules/engines/xrender_x11/evas_engine.c
index 7337faf..4cc1a55 100644
--- a/evas/src/modules/engines/xrender_x11/evas_engine.c
+++ b/evas/src/modules/engines/xrender_x11/evas_engine.c
@@ -108,7 +108,7 @@ struct _Render_Engine
    void (*render_surface_copy)(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
    void (*render_surface_rectangle_draw)(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
    void (*render_surface_line_draw)(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-   void (*render_surface_polygon_draw)(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+   void (*render_surface_polygon_draw)(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 };
 
 /* internal engine routines */
@@ -709,13 +709,13 @@ eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2,
 }
 
 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->render_surface_polygon_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon);
+   re->render_surface_polygon_draw((Xrender_Surface *)surface, (RGBA_Draw_Context *)context, (RGBA_Polygon_Point *)polygon, x, y);
 }
 
 
diff --git a/evas/src/modules/engines/xrender_x11/evas_engine.h b/evas/src/modules/engines/xrender_x11/evas_engine.h
index 7ccb4d6..d5bea6e 100644
--- a/evas/src/modules/engines/xrender_x11/evas_engine.h
+++ b/evas/src/modules/engines/xrender_x11/evas_engine.h
@@ -150,7 +150,7 @@ void             _xr_xlib_render_surface_composite(Xrender_Surface *srs, Xrender
 void             _xr_xlib_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
 void             _xr_xlib_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
 void             _xr_xlib_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-void             _xr_xlib_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+void             _xr_xlib_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 
 #ifdef BUILD_ENGINE_XRENDER_XCB
 Xrender_Surface *_xr_xcb_render_surface_new(Ximage_Info *xinf, int w, int h, xcb_render_pictforminfo_t *fmt, int alpha);
@@ -166,7 +166,7 @@ void             _xr_xcb_render_surface_composite(Xrender_Surface *srs, Xrender_
 void             _xr_xcb_render_surface_copy(Xrender_Surface *srs, Xrender_Surface *drs, int sx, int sy, int x, int y, int w, int h);
 void             _xr_xcb_render_surface_rectangle_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x, int y, int w, int h);
 void             _xr_xcb_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, int x1, int y1, int x2, int y2);
-void             _xr_xcb_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points);
+void             _xr_xcb_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y);
 #endif
 
 
diff --git a/evas/src/modules/engines/xrender_x11/evas_engine_xcb_render.c b/evas/src/modules/engines/xrender_x11/evas_engine_xcb_render.c
index 59d67e9..9b4825b 100644
--- a/evas/src/modules/engines/xrender_x11/evas_engine_xcb_render.c
+++ b/evas/src/modules/engines/xrender_x11/evas_engine_xcb_render.c
@@ -791,7 +791,7 @@ _xr_xcb_render_surface_line_draw(Xrender_Surface *rs __UNUSED__, RGBA_Draw_Conte
 }
 
 void
-_xr_xcb_render_surface_polygon_draw(Xrender_Surface *rs __UNUSED__, RGBA_Draw_Context *dc __UNUSED__, RGBA_Polygon_Point *points __UNUSED__)
+_xr_xcb_render_surface_polygon_draw(Xrender_Surface *rs __UNUSED__, RGBA_Draw_Context *dc __UNUSED__, RGBA_Polygon_Point *points __UNUSED__, int x, int y)
 {
 /*    RGBA_Polygon_Point *pt; */
 /*    int i, num; */
diff --git a/evas/src/modules/engines/xrender_x11/evas_engine_xlib_render.c b/evas/src/modules/engines/xrender_x11/evas_engine_xlib_render.c
index 6a827f2..2a597ef 100644
--- a/evas/src/modules/engines/xrender_x11/evas_engine_xlib_render.c
+++ b/evas/src/modules/engines/xrender_x11/evas_engine_xlib_render.c
@@ -677,7 +677,7 @@ _xr_xlib_render_surface_line_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, in
 }
 
 void
-_xr_xlib_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points)
+_xr_xlib_render_surface_polygon_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 @@ _xr_xlib_render_surface_polygon_draw(Xrender_Surface *rs, RGBA_Draw_Context *dc,
      {
 	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++;
 	  }
     }
diff --git a/expedite/src/bin/poly_blend.c b/expedite/src/bin/poly_blend.c
index 490bb4b..7ec9ebf 100644
--- a/expedite/src/bin/poly_blend.c
+++ b/expedite/src/bin/poly_blend.c
@@ -103,7 +103,7 @@ static void _loop(double t, int f)
 	x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 4);
 	y = (win_h / 2) - (h / 2);
 	y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 4);
-	poly(o, i, x, y);
+	evas_object_move(o, x, y);
      }
    FPS_STD(NAME);
 }
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to