* evas: Make evas_object_move on Evas_Object_Polygon work.

TODO: Make evas_object_resize work also.


SVN revision: 47291
This commit is contained in:
Cedric BAIL 2010-03-16 13:23:37 +00:00
parent bf9b51d12b
commit a859e60140
25 changed files with 140 additions and 101 deletions

View 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);
}

View 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));
}
}

View 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);

View 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 */

View 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;
}

View 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);

View 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)

View 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);

View 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;

View 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;

View 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

View 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++;
}

View 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);

View 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++;
}

View 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

View 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

View 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

View 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);
}

View 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);

View 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();
}
}

View 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)

View 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);
}

View 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

View 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; */

View 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++;
}
}