* evas: Make evas_object_move on Evas_Object_Polygon work.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 16 Mar 2010 13:23:37 +0000 (13:23 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 16 Mar 2010 13:23:37 +0000 (13:23 +0000)
TODO: Make evas_object_resize work also.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@47291 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

25 files changed:
src/lib/canvas/evas_object_polygon.c
src/lib/engines/common/evas_pipe.c
src/lib/engines/common/evas_pipe.h
src/lib/engines/common/evas_polygon.h
src/lib/engines/common/evas_polygon_main.c
src/lib/engines/common_16/evas_soft16_polygon.c
src/lib/include/evas_common_soft16.h
src/lib/include/evas_private.h
src/modules/engines/cairo_x11/evas_engine.c
src/modules/engines/directfb/evas_engine.c
src/modules/engines/directfb/evas_engine.h
src/modules/engines/directfb/polygon.c
src/modules/engines/gl_common/evas_gl_common.h
src/modules/engines/gl_common/evas_gl_polygon.c
src/modules/engines/gl_glew/evas_engine.c
src/modules/engines/gl_sdl/evas_engine.c
src/modules/engines/gl_x11/evas_engine.c
src/modules/engines/software_16/evas_engine.c
src/modules/engines/software_16_sdl/evas_engine.c
src/modules/engines/software_generic/evas_engine.c
src/modules/engines/software_sdl/evas_engine.c
src/modules/engines/xrender_x11/evas_engine.c
src/modules/engines/xrender_x11/evas_engine.h
src/modules/engines/xrender_x11/evas_engine_xcb_render.c
src/modules/engines/xrender_x11/evas_engine_xlib_render.c

index 698316c..e3eb7ff 100644 (file)
@@ -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);
 }
 
index a9fee85..694ed21 100644 (file)
@@ -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));
          }
      }
index 55c1aed..43f02a6 100644 (file)
@@ -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);
index d023568..0695f54 100644 (file)
@@ -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 */
index f92b1bc..cd8410a 100644 (file)
@@ -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;
               }
index 9400aa0..dd125d2 100644 (file)
@@ -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);
index 801d9e9..14653be 100644 (file)
@@ -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)
index 4269065..4f33245 100644 (file)
@@ -609,7 +609,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);
index da3b0aa..df81a2f 100644 (file)
@@ -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;
index 427ed5e..1960c22 100644 (file)
@@ -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;
index a8d8357..7ad1e38 100644 (file)
@@ -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
index 5b3ad25..715fd84 100644 (file)
@@ -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++;
      }
index a626760..6049641 100644 (file)
@@ -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);
 
index 1425d1c..49dd902 100644 (file)
@@ -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++;
      }
index b215de8..ebc24c8 100644 (file)
@@ -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
index e2c8891..c9e8088 100644 (file)
@@ -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
index 55b265b..6fbcbe3 100644 (file)
@@ -586,7 +586,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;
 
@@ -594,7 +594,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
index d2de032..3f6cf3c 100644 (file)
@@ -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);
 }
 
 
index 6fc11cd..049da61 100644 (file)
@@ -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);
index a224ae5..568bcdd 100644 (file)
@@ -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();
      }
 }
index d78e203..db1e590 100644 (file)
@@ -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)
index 7337faf..4cc1a55 100644 (file)
@@ -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);
 }
 
 
index 7ccb4d6..d5bea6e 100644 (file)
@@ -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
 
 
index 59d67e9..9b4825b 100644 (file)
@@ -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; */
index 6a827f2..2a597ef 100644 (file)
@@ -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++;
          }
     }