_evas_common_map_rgba_internal_mmx(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, dc->render_op,
- p, smooth, dc->anti_alias, level);
+ p, smooth, dc->anti_alias, level,
+ dc->clip.mask, dc->clip.mask_x, dc->clip.mask_y);
}
#endif
_evas_common_map_rgba_internal(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, dc->render_op,
- p, smooth, dc->anti_alias, level);
+ p, smooth, dc->anti_alias, level,
+ dc->clip.mask, dc->clip.mask_x, dc->clip.mask_y);
}
#ifdef BUILD_NEON
_evas_common_map_rgba_internal_neon(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, dc->render_op,
- p, smooth, dc->anti_alias, level);
+ p, smooth, dc->anti_alias, level,
+ dc->clip.mask, dc->clip.mask_x, dc->clip.mask_y);
}
#endif
}
EAPI void
-evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, int npoints EINA_UNUSED, RGBA_Map_Point *p, int smooth, Eina_Bool anti_alias, int level)
+evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, int npoints EINA_UNUSED, RGBA_Map_Point *p, int smooth, Eina_Bool anti_alias, int level, RGBA_Image *mask_ie, int mask_x, int mask_y)
{
#ifdef BUILD_MMX
int mmx, sse, sse2;
_evas_common_map_rgba_internal_mmx(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, render_op,
- p, smooth, anti_alias, level);
+ p, smooth, anti_alias, level,
+ mask_ie, mask_x, mask_y);
else
#endif
#ifdef BUILD_NEON
_evas_common_map_rgba_internal_neon(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, render_op,
- p, smooth, anti_alias, level);
+ p, smooth, anti_alias, level,
+ mask_ie, mask_x, mask_y);
else
#endif
_evas_common_map_rgba_internal(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, render_op,
- p, smooth, anti_alias, level);
+ p, smooth, anti_alias, level,
+ mask_ie, mask_x, mask_y);
}
EAPI void
int npoints, RGBA_Map_Point *points,
int smooth, int level);
-EAPI void evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, int npoints, RGBA_Map_Point *p, int smooth, Eina_Bool anti_alias, int level);
+EAPI void evas_common_map_rgba_draw(RGBA_Image *src, RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 mul_col, int render_op, int npoints, RGBA_Map_Point *p, int smooth, Eina_Bool anti_alias, int level, RGBA_Image *mask_ie, int mask_x, int mask_y);
EAPI Eina_Bool
evas_common_map_rgba_prepare(RGBA_Image *src, RGBA_Image *dst,
{
d = dst->image.data;
d += (y * dst->cache_entry.w) + x;
- func(buf, NULL, mul_col, d, w);
+ if (!mask_ie)
+ func(buf, NULL, mul_col, d, w);
+ else
+ {
+ DATA8 *mask = mask_ie->image.data8
+ + (y - mask_y) * mask_ie->cache_entry.w
+ + (x - mask_x);
+ if (mul_col != 0xffffffff) func2(buf, NULL, mul_col, buf, w);
+ func(buf, mask, 0, d, w);
+ }
}
}
}
{
d = dst->image.data;
d += (y * dst->cache_entry.w) + x;
- func(buf, NULL, mul_col, d, w);
+ if (!mask_ie)
+ func(buf, NULL, mul_col, d, w);
+ else
+ {
+ DATA8 *mask = mask_ie->image.data8
+ + (y - mask_y) * mask_ie->cache_entry.w
+ + (x - mask_x);
+ if (mul_col != 0xffffffff) func2(buf, NULL, mul_col, buf, w);
+ func(buf, mask, 0, d, w);
+ }
}
}
}
int clip_x, int clip_y, int clip_w, int clip_h,
DATA32 mul_col, int render_op,
RGBA_Map_Point *p,
- int smooth, int anti_alias, int level EINA_UNUSED) // level unused for now - for future use
+ int smooth, int anti_alias, int level EINA_UNUSED, // level unused for now - for future use
+ RGBA_Image *mask_ie, int mask_x, int mask_y)
{
int i;
int cx, cy, cw, ch;
int ytop, ybottom, ystart, yend, y, sw, shp, swp, direct;
Line *spans;
DATA32 *buf = NULL, *sp;
- RGBA_Gfx_Func func = NULL;
+ RGBA_Gfx_Func func = NULL, func2 = NULL;
Eina_Bool havea = EINA_FALSE;
+ Eina_Bool sa, ssa, da;
int havecol = 4;
cx = clip_x;
swp = sw << (FP + FPI);
shp = src->cache_entry.h << (FP + FPI);
+ sa = src->cache_entry.flags.alpha;
+ ssa = src->cache_entry.flags.alpha_sparse;
+ da = dst->cache_entry.flags.alpha;
+
// limit u,v coords of points to be within the source image
for (i = 0; i < 4; i++)
{
/* FIXME: even if anti-alias is enabled, only edges may require the
pixels composition. we can optimize it. */
- if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha) &&
- (mul_col == 0xffffffff) && (!havea) && (!anti_alias))
+ if ((!sa) && (!dst->cache_entry.flags.alpha) &&
+ (mul_col == 0xffffffff) && (!havea) && (!anti_alias) && (!mask_ie))
{
direct = 1;
}
int pa;
buf = alloca(cw * sizeof(DATA32));
- pa = src->cache_entry.flags.alpha;
- if (havea) src->cache_entry.flags.alpha = 1;
- if (mul_col != 0xffffffff)
- func = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, mul_col, dst->cache_entry.flags.alpha, cw, render_op);
+ if (havea) sa = 1;
+ if (!mask_ie)
+ {
+ if (mul_col != 0xffffffff)
+ func = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, mul_col, da, cw, render_op);
+ else
+ func = evas_common_gfx_func_composite_pixel_span_get(sa, ssa, da, cw, render_op);
+ }
else
- func = evas_common_gfx_func_composite_pixel_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, cw, render_op);
+ {
+ func = evas_common_gfx_func_composite_pixel_mask_span_get(sa, ssa, da, cw, render_op);
+ if (mul_col != 0xffffffff)
+ func2 = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, mul_col, da, cw, render_op);
+ }
if (anti_alias) src->cache_entry.flags.alpha = EINA_TRUE;
else src->cache_entry.flags.alpha = pa;
{
Line *spans;
DATA32 *buf = NULL, *sp;
- RGBA_Gfx_Func func = NULL;
+ RGBA_Gfx_Func func = NULL, func2 = NULL;
int cx, cy, cw, ch;
DATA32 mul_col;
int ystart, yend, y, sw, shp, swp, direct;
int havecol;
int i;
+ Eina_Bool sa, ssa, da;
+
+ RGBA_Image *mask_ie = dc->clip.mask;
+ int mask_x = dc->clip.mask_x;
+ int mask_y = dc->clip.mask_y;
cx = dc->clip.x;
cy = dc->clip.y;
havecol = ms->havecol;
direct = ms->direct;
+ sa = src->cache_entry.flags.alpha;
+ ssa = src->cache_entry.flags.alpha_sparse;
+ da = dst->cache_entry.flags.alpha;
+
// allocate some s to hold out span list
spans = alloca((yend - ystart + 1) * sizeof(Line));
memcpy(spans, &ms->spans[ystart - ms->ystart],
int pa;
buf = alloca(cw * sizeof(DATA32));
- pa = src->cache_entry.flags.alpha;
- if (ms->havea) src->cache_entry.flags.alpha = 1;
- if (dc->mul.use)
- func = evas_common_gfx_func_composite_pixel_color_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dc->mul.col, dst->cache_entry.flags.alpha, cw, dc->render_op);
+ if (ms->havea) sa = 1;
+ if (mask_ie)
+ {
+ if (mul_col != 0xffffffff)
+ func = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, dc->mul.col, da, cw, dc->render_op);
+ else
+ func = evas_common_gfx_func_composite_pixel_span_get(sa, ssa, da, cw, dc->render_op);
+ }
else
- func = evas_common_gfx_func_composite_pixel_span_get(src->cache_entry.flags.alpha, src->cache_entry.flags.alpha_sparse, dst->cache_entry.flags.alpha, cw, dc->render_op);
- src->cache_entry.flags.alpha = pa;
+ {
+ func = evas_common_gfx_func_composite_pixel_mask_span_get(sa, ssa, da, cw, dc->render_op);
+ if (mul_col != 0xffffffff)
+ func2 = evas_common_gfx_func_composite_pixel_color_span_get(sa, ssa, dc->mul.col, da, cw, dc->render_op);
+ }
}
if (havecol == 0)
RGBA_Map *map;
int smooth, level, offset;
Eina_Bool anti_alias;
+ void *mask;
+ int mask_x, mask_y;
};
struct _Evas_Thread_Command_Multi_Font
(im, map->surface,
map->clip.x, map->clip.y, map->clip.w, map->clip.h,
map->mul_col, map->render_op, m->count - offset, &m->pts[offset],
- map->smooth, map->anti_alias, map->level);
+ map->smooth, map->anti_alias, map->level,
+ map->mask, map->mask_x, map->mask_y);
}
evas_common_cpu_end_opt();
cm->level = level;
cm->offset = offset;
+ cm->mask = dc->clip.mask;
+ cm->mask_x = dc->clip.mask_x;
+ cm->mask_y = dc->clip.mask_y;
+
evas_thread_cmd_enqueue(_draw_thread_map_draw, cm);
return EINA_TRUE;