forked from enlightenment/efl
evas/map: Refactor common code for map drawing
This patch refactors common code for map draws - so that it can be used by other engines and *threaded* X11. Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi> Patch by: Paulo Alcantara <pcacjr@profusion.mobi> SVN revision: 79855
This commit is contained in:
parent
cf1360416e
commit
cae8fd7ed4
|
@ -646,14 +646,12 @@ evas_common_map_rgba_prepare(RGBA_Image *src, RGBA_Image *dst,
|
||||||
#include "evas_map_image_internal.c"
|
#include "evas_map_image_internal.c"
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
|
||||||
RGBA_Draw_Context *dc,
|
RGBA_Draw_Context *dc,
|
||||||
int npoints EINA_UNUSED, RGBA_Map_Point *p,
|
int npoints EINA_UNUSED, RGBA_Map_Point *p,
|
||||||
int smooth, int level)
|
int smooth, int level,
|
||||||
|
Evas_Common_Map_RGBA_Cb cb)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_MMX
|
|
||||||
int mmx, sse, sse2;
|
|
||||||
#endif
|
|
||||||
static Cutout_Rects *rects = NULL;
|
static Cutout_Rects *rects = NULL;
|
||||||
Cutout_Rect *r;
|
Cutout_Rect *r;
|
||||||
int c, cx, cy, cw, ch;
|
int c, cx, cy, cw, ch;
|
||||||
|
@ -670,17 +668,10 @@ evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
||||||
}
|
}
|
||||||
evas_common_image_colorspace_normalize(src);
|
evas_common_image_colorspace_normalize(src);
|
||||||
if (!src->image.data) return;
|
if (!src->image.data) return;
|
||||||
#ifdef BUILD_MMX
|
|
||||||
evas_common_cpu_can_do(&mmx, &sse, &sse2);
|
|
||||||
#endif
|
|
||||||
if ((!dc->cutout.rects) && (!dc->clip.use))
|
if ((!dc->cutout.rects) && (!dc->clip.use))
|
||||||
{
|
{
|
||||||
#ifdef BUILD_MMX
|
cb(src, dst, dc, p, smooth, level);
|
||||||
if (mmx)
|
|
||||||
evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* save out clip info */
|
/* save out clip info */
|
||||||
|
@ -697,17 +688,32 @@ evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
||||||
{
|
{
|
||||||
r = rects->rects + i;
|
r = rects->rects + i;
|
||||||
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
|
||||||
#ifdef BUILD_MMX
|
cb(src, dst, dc, p, smooth, level);
|
||||||
if (mmx)
|
|
||||||
evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
|
|
||||||
}
|
}
|
||||||
/* restore clip info */
|
/* restore clip info */
|
||||||
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
||||||
|
RGBA_Draw_Context *dc,
|
||||||
|
int npoints EINA_UNUSED, RGBA_Map_Point *p,
|
||||||
|
int smooth, int level)
|
||||||
|
{
|
||||||
|
Evas_Common_Map_RGBA_Cb cb;
|
||||||
|
#ifdef BUILD_MMX
|
||||||
|
int mmx, sse, sse2;
|
||||||
|
|
||||||
|
evas_common_cpu_can_do(&mmx, &sse, &sse2);
|
||||||
|
if (mmx)
|
||||||
|
cb = evas_common_map_rgba_internal_mmx;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
cb = evas_common_map_rgba_internal;
|
||||||
|
|
||||||
|
evas_common_map_rgba_cb(src, dst, dc, npoints, p, smooth, level, cb);
|
||||||
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_map_rgba_do(const Eina_Rectangle *clip,
|
evas_common_map_rgba_do(const Eina_Rectangle *clip,
|
||||||
RGBA_Image *src, RGBA_Image *dst,
|
RGBA_Image *src, RGBA_Image *dst,
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
#ifndef _EVAS_MAP_H
|
#ifndef _EVAS_MAP_H
|
||||||
#define _EVAS_MAP_H
|
#define _EVAS_MAP_H
|
||||||
|
|
||||||
|
typedef void (*Evas_Common_Map_RGBA_Cb)(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level);
|
||||||
|
|
||||||
|
EAPI void
|
||||||
|
evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
|
||||||
|
RGBA_Draw_Context *dc,
|
||||||
|
int npoints, RGBA_Map_Point *points,
|
||||||
|
int smooth, int level,
|
||||||
|
Evas_Common_Map_RGBA_Cb cb);
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
|
||||||
RGBA_Draw_Context *dc,
|
RGBA_Draw_Context *dc,
|
||||||
|
|
Loading…
Reference in New Issue