_evas_draw_point(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y)
{
RGBA_Gfx_Pt_Func pfunc;
+ DATA8 *mask = NULL;
if (!dst->image.data) return;
if (!IN_RANGE(x, y, dst->cache_entry.w, dst->cache_entry.h))
# endif
#endif
{
- pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst->cache_entry.flags.alpha, dc->render_op);
- if (pfunc)
- pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask = im->image.data8
+ + (y - dc->clip.mask_y) * im->cache_entry.w
+ + (x - dc->clip.mask_x);
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(dc->col.col, dst->cache_entry.flags.alpha, dc->render_op);
+ if (pfunc)
+ pfunc(0, *mask, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
+ }
+ else
+ {
+ pfunc = evas_common_gfx_func_composite_color_pt_get(dc->col.col, dst->cache_entry.flags.alpha, dc->render_op);
+ if (pfunc)
+ pfunc(0, 255, dc->col.col, dst->image.data + (dst->cache_entry.w * y) + x);
+ }
}
}
EAPI void
-evas_common_line_point_draw(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x, int y)
+evas_common_line_point_draw(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x, int y, RGBA_Image *mask_ie, int mask_x, int mask_y)
{
Eina_Bool no_cuse;
RGBA_Gfx_Pt_Func pfunc;
+ DATA8 *mask = NULL;
if (!dst->image.data) return;
no_cuse = ((clip_x == 0) && (clip_y == 0) &&
if ((!no_cuse) && (!IN_RECT(x, y, clip_x, clip_y, clip_w, clip_h)))
return;
- pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
- if (pfunc)
- pfunc(0, 255, color, dst->image.data + (dst->cache_entry.w * y) + x);
+ if (mask_ie)
+ {
+ mask = mask_ie->image.data8
+ + (y - mask_y) * mask_ie->cache_entry.w
+ + (x - mask_x);
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ if (pfunc)
+ pfunc(0, *mask, color, dst->image.data + (dst->cache_entry.w * y) + x);
+ }
+ else
+ {
+ pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ if (pfunc)
+ pfunc(0, 255, color, dst->image.data + (dst->cache_entry.w * y) + x);
+ }
}
/*
{
int dx, dy, len, lx, ty, rx, by;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p, color;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
RGBA_Gfx_Func sfunc;
# endif
#endif
{
- sfunc = evas_common_gfx_func_composite_color_span_get(color, dst->cache_entry.flags.alpha, len, dc->render_op);
- if (sfunc)
- sfunc(NULL, NULL, color, p, len);
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask = im->image.data8
+ + ((y0 - dc->clip.mask_y) * im->cache_entry.w)
+ + (x0 - dc->clip.mask_x);
+ sfunc = evas_common_gfx_func_composite_mask_color_span_get(color, dst->cache_entry.flags.alpha, len, dc->render_op);
+ if (sfunc) sfunc(NULL, mask, color, p, len);
+ }
+ else
+ {
+ sfunc = evas_common_gfx_func_composite_color_span_get(color, dst->cache_entry.flags.alpha, len, dc->render_op);
+ if (sfunc)
+ sfunc(NULL, NULL, color, p, len);
+ }
}
}
return;
}
- pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
+ if (dc->clip.mask)
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
+ else
+ pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
if (!pfunc) return;
if (dx == 0)
# endif
#endif
{
- while (len--)
+ if (dc->clip.mask)
{
- pfunc(0, 255, color, p);
- p += dstw;
+ RGBA_Image *im = dc->clip.mask;
+ mask_w = im->cache_entry.w;
+ mask = im->image.data8
+ + ((y0 - dc->clip.mask_y) * mask_w)
+ + (x0 - dc->clip.mask_x);
+ while (len--)
+ {
+ pfunc(0, *mask, color, p);
+ p += dstw;
+ mask += mask_w;
+ }
+ }
+ else
+ {
+ while (len--)
+ {
+ pfunc(0, 255, color, p);
+ p += dstw;
+ }
}
}
}
len = y1 - y0 + 1;
if (dx > 0) dstw++;
else dstw--;
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask_w = im->cache_entry.w;
+ mask = im->image.data8
+ + ((y0 - dc->clip.mask_y) * mask_w)
+ + (x0 - dc->clip.mask_x);
+ if (dx > 0) mask_w++;
+ else mask_w--;
+ }
}
else
{
p = dst->image.data + (dstw * y1) + x1;
if (dx > 0) dstw--;
else dstw++;
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask_w = im->cache_entry.w;
+ mask = im->image.data8
+ + ((y1 - dc->clip.mask_y) * mask_w)
+ + (x1 - dc->clip.mask_x);
+ if (dx > 0) mask_w--;
+ else mask_w++;
+ }
}
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
else
# endif
#endif
- pfunc(0, 255, color, p);
+ {
+ if (mask)
+ {
+ pfunc(0, *mask, color, p);
+ mask += mask_w;
+ }
+ else
+ pfunc(0, 255, color, p);
+ }
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pixman_x_position += x_unit;
rx = clw - 1;
static void
-_draw_render_thread_simple_line(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1)
+_draw_render_thread_simple_line(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1, RGBA_Image *mask_ie, int mask_x, int mask_y)
{
int dx, dy, len, lx, ty, rx, by;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
RGBA_Gfx_Func sfunc;
len = x1 - x0 + 1;
p = dst->image.data + (dstw * y0) + x0;
- sfunc = evas_common_gfx_func_composite_color_span_get(color, dst->cache_entry.flags.alpha, len, render_op);
- if (sfunc) sfunc(NULL, NULL, color, p, len);
+ if (mask_ie)
+ {
+ mask = mask_ie->image.data8
+ + ((y0 - mask_y) * mask_ie->cache_entry.w)
+ + (x0 - mask_x);
+ sfunc = evas_common_gfx_func_composite_mask_color_span_get(color, dst->cache_entry.flags.alpha, len, render_op);
+ if (sfunc) sfunc(NULL, mask, color, p, len);
+ }
+ else
+ {
+ sfunc = evas_common_gfx_func_composite_color_span_get(color, dst->cache_entry.flags.alpha, len, render_op);
+ if (sfunc) sfunc(NULL, NULL, color, p, len);
+ }
}
return;
}
- pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ if (mask_ie)
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ else
+ pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
if (!pfunc) return;
if (dx == 0)
len = y1 - y0 + 1;
p = dst->image.data + (dstw * y0) + x0;
- while (len--)
+ if (mask_ie)
{
- pfunc(0, 255, color, p);
- p += dstw;
+ mask_w = mask_ie->cache_entry.w;
+ mask = mask_ie->image.data8
+ + ((y0 - mask_y) * mask_w)
+ + (x0 - mask_x);
+ while (len--)
+ {
+ pfunc(0, *mask, color, p);
+ p += dstw;
+ mask += mask_w;
+ }
+ }
+ else
+ {
+ while (len--)
+ {
+ pfunc(0, 255, color, p);
+ p += dstw;
+ }
}
}
return;
len = y1 - y0 + 1;
if (dx > 0) dstw++;
else dstw--;
+ if (mask_ie)
+ {
+ mask_w = mask_ie->cache_entry.w;
+ mask = mask_ie->image.data8
+ + ((y0 - mask_y) * mask_w)
+ + (x0 - mask_x);
+ if (dx > 0) mask_w++;
+ else mask_w--;
+ }
}
else
{
p = dst->image.data + (dstw * y1) + x1;
if (dx > 0) dstw--;
else dstw++;
+ if (mask_ie)
+ {
+ mask_w = mask_ie->cache_entry.w;
+ mask = mask_ie->image.data8
+ + ((y1 - mask_y) * mask_w)
+ + (x1 - mask_x);
+ if (dx > 0) mask_w--;
+ else mask_w++;
+ }
}
- while (len--)
+ if (mask)
{
- pfunc(0, 255, color, p);
- p += dstw;
+ while (len--)
+ {
+ pfunc(0, *mask, color, p);
+ p += dstw;
+ mask += mask_w;
+ }
+ }
+ else
+ {
+ while (len--)
+ {
+ pfunc(0, 255, color, p);
+ p += dstw;
+ }
}
}
}
rx = clw - 1;
EAPI void
-evas_common_line_draw_line(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1)
+evas_common_line_draw_line(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1, RGBA_Image *mask_ie, int mask_x, int mask_y)
{
int px, py, x, y, prev_x, prev_y;
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 0;
int delx, dely, xx, yy, dxx, dyy;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p, *data;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
dx = x1 - x0;
_draw_render_thread_simple_line
(dst, clip_x, clip_y, clip_w, clip_h,
color, render_op,
- x0, y0, x1, y1);
+ x0, y0, x1, y1,
+ mask_ie, mask_x, mask_y);
return;
}
- pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ if (mask_ie)
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
+ else
+ pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, render_op);
if (!pfunc) return;
clx = clip_x;
x1 -= clx;
y1 -= cly;
+ if (mask_ie)
+ {
+ mask_w = mask_ie->cache_entry.w;
+ mask = mask_ie->image.data8
+ + ((cly - mask_y) * mask_w) + (clx - mask_x);
+ }
+
/* shallow: x-parametric */
if ((dy < dx) || (dy < -dx))
{
SETUP_LINE_SHALLOW;
+ if (mask) mask += (py * mask_w) + px;
while (px < rx)
{
y = (yy >> 16);
{
prev_y = y;
p += dh;
+ if (mask) mask += mask_w;
py += dely;
}
if (!p1_in)
{
if (py < 0) goto next_x;
}
- if (IN_RANGE(px, py, clw, clh)) pfunc(0, 255, color, p);
+ if (IN_RANGE(px, py, clw, clh))
+ {
+ if (mask) pfunc(0, *mask, color, p);
+ else pfunc(0, 255, color, p);
+ }
next_x:
yy += dyy;
px++;
p++;
+ if (mask) mask++;
}
return;
}
/* steep: y-parametric */
SETUP_LINE_STEEP;
+ if (mask) mask += (py * mask_w) + px;
while (py < by)
{
prev_x = x;
px += delx;
p += delx;
+ if (mask) mask += delx;
}
if (!p1_in)
{
{
if (px < 0) goto next_y;
}
- if (IN_RANGE(px, py, clw, clh)) pfunc(0, 255, color, p);
+ if (IN_RANGE(px, py, clw, clh))
+ {
+ if (mask) pfunc(0, *mask, color, p);
+ else pfunc(0, 255, color, p);
+ }
next_y:
xx += dxx;
py++;
p += dstw;
+ if (mask) mask += mask_w;
}
}
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 0;
int delx, dely, xx, yy, dxx, dyy;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p, *data, color;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
dx = x1 - x0;
}
color = dc->col.col;
- pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
+ if (dc->clip.mask)
+ pfunc = evas_common_gfx_func_composite_mask_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
+ else
+ pfunc = evas_common_gfx_func_composite_color_pt_get(color, dst->cache_entry.flags.alpha, dc->render_op);
if (!pfunc) return;
clx = dc->clip.x;
x1 -= clx;
y1 -= cly;
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask_w = im->cache_entry.w;
+ mask = im->image.data8
+ + ((cly - dc->clip.mask_y) * mask_w) + (clx - dc->clip.mask_x);
+ }
+
/* shallow: x-parametric */
if ((dy < dx) || (dy < -dx))
{
SETUP_LINE_SHALLOW;
+ if (mask) mask += (py * mask_w) + px;
while (px < rx)
{
y = (yy >> 16);
{
prev_y = y;
p += dh;
+ if (mask) mask += mask_w;
py += dely;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
else
# endif
#endif
- pfunc(0, 255, color, p);
+ {
+ if (mask) pfunc(0, *mask, color, p);
+ else pfunc(0, 255, color, p);
+ }
}
next_x:
yy += dyy;
px++;
p++;
+ if (mask) mask++;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_x += pix_x_unit;
/* steep: y-parametric */
SETUP_LINE_STEEP;
+ if (mask) mask += (py * mask_w) + px;
while (py < by)
{
prev_x = x;
px += delx;
p += delx;
+ if (mask) mask += delx;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_x += pix_x_unit;
else
# endif
#endif
- pfunc(0, 255, color, p);
+ {
+ if (mask) pfunc(0, *mask, color, p);
+ else pfunc(0, 255, color, p);
+ }
}
next_y:
xx += dxx;
py++;
p += dstw;
+ if (mask) mask += mask_w;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_y += pix_y_unit;
}
EAPI void
-evas_common_line_draw_line_aa(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1)
+evas_common_line_draw_line_aa(RGBA_Image *dst, int clip_x, int clip_y, int clip_w, int clip_h, DATA32 color, int render_op, int x0, int y0, int x1, int y1, RGBA_Image *mask_ie, int mask_x, int mask_y)
{
int px, py, x, y, prev_x, prev_y;
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
int delx, dely, xx, yy, dxx, dyy;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p, *data;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
dx = x1 - x0;
_draw_render_thread_simple_line
(dst, clip_x, clip_y, clip_w, clip_h,
color, render_op,
- x0, y0, x1, y1);
+ x0, y0, x1, y1,
+ mask_ie, mask_x, mask_y);
return;
}
x1 -= clx;
y1 -= cly;
+ if (mask_ie)
+ {
+ mask_w = mask_ie->cache_entry.w;
+ mask = mask_ie->image.data8
+ + (cly - mask_y) * mask_w + (clx - mask_x);
+ }
+
/* shallow: x-parametric */
if ((dy < dx) || (dy < -dx))
{
SETUP_LINE_SHALLOW;
+ if (mask) mask += (py * mask_w) + px;
while (px < rx)
{
DATA8 aa;
{
prev_y = y;
p += dh;
+ if (mask) mask += mask_w;
py += dely;
}
if (!p1_in)
{
aa = ((yy - (y << 16)) >> 8);
- if ((py) < clh) pfunc(0, 255 - aa, color, p);
- if ((py + 1) < clh) pfunc(0, aa, color, p + dstw);
+ if (mask)
+ {
+ if ((py) < clh) pfunc(0, (255 - aa) * (*mask) / 255, color, p);
+ if ((py + 1) < clh) pfunc(0, aa * (*(mask + mask_w)) / 255, color, p + dstw);
+ }
+ else
+ {
+ if ((py) < clh) pfunc(0, 255 - aa, color, p);
+ if ((py + 1) < clh) pfunc(0, aa, color, p + dstw);
+ }
}
next_x:
yy += dyy;
px++;
p++;
+ if (mask) mask++;
}
return;
}
/* steep: y-parametric */
SETUP_LINE_STEEP;
+ if (mask) mask += (py * mask_w) + px;
while (py < by)
{
prev_x = x;
px += delx;
p += delx;
+ if (mask) mask += delx;
}
if (!p1_in)
{
if (py < clh)
{
aa = ((xx - (x << 16)) >> 8);
- if ((px) < clw) pfunc(0, 255 - aa, color, p);
- if ((px + 1) < clw) pfunc(0, aa, color, p + 1);
+
+ if (mask)
+ {
+ if ((px) < clw) pfunc(0, (255 - aa) * (*mask) / 255, color, p);
+ if ((px + 1) < clw) pfunc(0, aa * (*(mask + 1)) / 255, color, p + 1);
+ }
+ else
+ {
+ if ((px) < clw) pfunc(0, 255 - aa, color, p);
+ if ((px + 1) < clw) pfunc(0, aa, color, p + 1);
+ }
}
next_y:
xx += dxx;
py++;
p += dstw;
+ if (mask) mask += mask_w;
}
}
int dx, dy, rx, by, p0_in, p1_in, dh, a_a = 1;
int delx, dely, xx, yy, dxx, dyy;
int clx, cly, clw, clh;
- int dstw;
+ int dstw, mask_w = 0;
DATA32 *p, *data, color;
+ DATA8 *mask = NULL;
RGBA_Gfx_Pt_Func pfunc;
dx = x1 - x0;
x1 -= clx;
y1 -= cly;
+ if (dc->clip.mask)
+ {
+ RGBA_Image *im = dc->clip.mask;
+ mask_w = im->cache_entry.w;
+ mask = im->image.data8
+ + ((cly - dc->clip.mask_y) * mask_w) + (clx - dc->clip.mask_x);
+ }
+
/* shallow: x-parametric */
if ((dy < dx) || (dy < -dx))
{
SETUP_LINE_SHALLOW;
+ if (mask) mask += (py * mask_w) + px;
while (px < rx)
{
DATA8 aa;
{
prev_y = y;
p += dh;
+ if (mask) mask += mask_w;
py += dely;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
else
# endif
#endif
- pfunc(0, 255 - aa, color, p);
+ {
+ if (mask) pfunc(0, (255 - aa) * (*mask) / 255, color, p);
+ else pfunc(0, 255 - aa, color, p);
+ }
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pixman_image_unref(aa_mask_image);
else
# endif
#endif
- pfunc(0, aa, color, p + dstw);
+ {
+ if (mask) pfunc(0, aa * (*(mask + mask_w)) / 255, color, p + dstw);
+ else pfunc(0, aa, color, p + dstw);
+ }
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pixman_image_unref(aa_mask_image);
yy += dyy;
px++;
p++;
+ if (mask) mask++;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_x += pix_x_unit;
/* steep: y-parametric */
SETUP_LINE_STEEP;
+ if (mask) mask += (py * mask_w) + px;
while (py < by)
{
prev_x = x;
px += delx;
p += delx;
+ if (mask) mask += delx;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_x += pix_x_unit;
else
# endif
#endif
- pfunc(0, 255 - aa, color, p);
+ {
+ if (mask) pfunc(0, (255 - aa) * (*mask) / 255, color, p);
+ else pfunc(0, 255 - aa, color, p);
+ }
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pixman_image_unref(aa_mask_image);
else
# endif
#endif
- pfunc(0, aa, color, p + 1);
+ {
+ if (mask) pfunc(0, aa * (*(mask + 1)) / 255, color, p + 1);
+ else pfunc(0, aa, color, p + 1);
+ }
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pixman_image_unref(aa_mask_image);
xx += dxx;
py++;
p += dstw;
+ if (mask) mask += mask_w;
#ifdef HAVE_PIXMAN
# ifdef PIXMAN_LINE
pix_y += pix_y_unit;