evas/common: Prepare soil to land scaling code for threaded render

SVN revision: 81188
This commit is contained in:
Leandro Pereira 2012-12-17 21:29:33 +00:00
parent 6ea2723322
commit b4ceb3f2ba
10 changed files with 367 additions and 103 deletions

View File

@ -13,7 +13,8 @@ EAPI void evas_common_rgba_image_scalecache_dump(void);
EAPI void evas_common_scale_rgba_in_to_out_clip_sample_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
EAPI void evas_common_scale_rgba_in_to_out_clip_smooth_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
EAPI void evas_common_scale_rgba_sample_draw (RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
EAPI void evas_common_scale_rgba_smooth_draw (RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
EAPI Eina_Bool evas_common_scale_rgba_in_to_out_clip_prepare (Cutout_Rects *reuse, const RGBA_Image *src, const RGBA_Image *dst, RGBA_Draw_Context *dc, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
#endif /* _EVAS_SCALE_MAIN_H */

View File

@ -58,13 +58,197 @@ evas_common_scale_rgba_in_to_out_clip_sample_do(const Cutout_Rects *reuse,
}
}
EAPI void
evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
{
int x, y;
int *lin_ptr;
DATA32 *buf, *dptr;
DATA32 **row_ptr;
DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
int src_w, src_h, dst_w, dst_h;
RGBA_Gfx_Func func;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h,
0, 0, src->cache_entry.w, src->cache_entry.h))) return;
src_w = src->cache_entry.w;
src_h = src->cache_entry.h;
dst_w = dst->cache_entry.w;
dst_h = dst->cache_entry.h;
src_data = src->image.data;
dst_data = dst->image.data;
if (dst_clip_x < 0)
{
dst_clip_w += dst_clip_x;
dst_clip_x = 0;
}
if (dst_clip_y < 0)
{
dst_clip_h += dst_clip_y;
dst_clip_y = 0;
}
if ((dst_clip_x + dst_clip_w) > dst_w)
dst_clip_w = dst_w - dst_clip_x;
if ((dst_clip_y + dst_clip_h) > dst_h)
dst_clip_h = dst_h - dst_clip_y;
if (dst_clip_x < dst_region_x)
{
dst_clip_w += dst_clip_x - dst_region_x;
dst_clip_x = dst_region_x;
}
if ((dst_clip_x + dst_clip_w) > (dst_region_x + dst_region_w))
dst_clip_w = dst_region_x + dst_region_w - dst_clip_x;
if (dst_clip_y < dst_region_y)
{
dst_clip_h += dst_clip_y - dst_region_y;
dst_clip_y = dst_region_y;
}
if ((dst_clip_y + dst_clip_h) > (dst_region_y + dst_region_h))
dst_clip_h = dst_region_y + dst_region_h - dst_clip_y;
if ((src_region_w <= 0) || (src_region_h <= 0) ||
(dst_region_w <= 0) || (dst_region_h <= 0) ||
(dst_clip_w <= 0) || (dst_clip_h <= 0))
return;
/* sanitise x */
if (src_region_x < 0)
{
dst_region_x -= (src_region_x * dst_region_w) / src_region_w;
dst_region_w += (src_region_x * dst_region_w) / src_region_w;
src_region_w += src_region_x;
src_region_x = 0;
}
if (src_region_x >= src_w) return;
if ((src_region_x + src_region_w) > src_w)
{
dst_region_w = (dst_region_w * (src_w - src_region_x)) / (src_region_w);
src_region_w = src_w - src_region_x;
}
if (dst_region_w <= 0) return;
if (src_region_w <= 0) return;
if (dst_clip_x < 0)
{
dst_clip_w += dst_clip_x;
dst_clip_x = 0;
}
if (dst_clip_w <= 0) return;
if (dst_clip_x >= dst_w) return;
if (dst_clip_x < dst_region_x)
{
dst_clip_w += (dst_clip_x - dst_region_x);
dst_clip_x = dst_region_x;
}
if ((dst_clip_x + dst_clip_w) > dst_w)
{
dst_clip_w = dst_w - dst_clip_x;
}
if (dst_clip_w <= 0) return;
/* sanitise y */
if (src_region_y < 0)
{
dst_region_y -= (src_region_y * dst_region_h) / src_region_h;
dst_region_h += (src_region_y * dst_region_h) / src_region_h;
src_region_h += src_region_y;
src_region_y = 0;
}
if (src_region_y >= src_h) return;
if ((src_region_y + src_region_h) > src_h)
{
dst_region_h = (dst_region_h * (src_h - src_region_y)) / (src_region_h);
src_region_h = src_h - src_region_y;
}
if (dst_region_h <= 0) return;
if (src_region_h <= 0) return;
if (dst_clip_y < 0)
{
dst_clip_h += dst_clip_y;
dst_clip_y = 0;
}
if (dst_clip_h <= 0) return;
if (dst_clip_y >= dst_h) return;
if (dst_clip_y < dst_region_y)
{
dst_clip_h += (dst_clip_y - dst_region_y);
dst_clip_y = dst_region_y;
}
if ((dst_clip_y + dst_clip_h) > dst_h)
{
dst_clip_h = dst_h - dst_clip_y;
}
if (dst_clip_h <= 0) return;
/* allocate scale lookup tables */
lin_ptr = alloca(dst_clip_w * sizeof(int));
row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
/* figure out dst jump */
//dst_jump = dst_w - dst_clip_w;
/* figure out dest start ptr */
dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);
if (mul_col != 0xffffffff)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
else
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
if ((dst_region_w == src_region_w) && (dst_region_h == src_region_h))
{
ptr = src_data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
for (y = 0; y < dst_clip_h; y++)
{
/* * blend here [clip_w *] ptr -> dst_ptr * */
func(ptr, NULL, mul_col, dst_ptr, dst_clip_w);
ptr += src_w;
dst_ptr += dst_w;
}
}
else
{
/* fill scale tables */
for (x = 0; x < dst_clip_w; x++)
lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
for (y = 0; y < dst_clip_h; y++)
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
+ src_region_y) * src_w);
/* scale to dst */
dptr = dst_ptr;
/* a scanline buffer */
buf = alloca(dst_clip_w * sizeof(DATA32));
for (y = 0; y < dst_clip_h; y++)
{
dst_ptr = buf;
for (x = 0; x < dst_clip_w; x++)
{
ptr = row_ptr[y] + lin_ptr[x];
*dst_ptr = *ptr;
dst_ptr++;
}
/* * blend here [clip_w *] buf -> dptr * */
func(buf, NULL, mul_col, dptr, dst_clip_w);
dptr += dst_w;
}
}
}
static void
scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h)
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h)
{
int x, y;
int *lin_ptr;

View File

@ -91,17 +91,91 @@ scale_calc_a_points(int *p, int s, int d, int c, int cc)
#ifdef BUILD_MMX
# undef SCALE_FUNC
# define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_mmx
# define SCALE_FUNC _evas_common_scale_rgba_in_to_out_clip_smooth_mmx
# undef SCALE_USING_MMX
# define SCALE_USING_MMX
# include "evas_scale_smooth_scaler.c"
#endif
#undef SCALE_FUNC
#define SCALE_FUNC evas_common_scale_rgba_in_to_out_clip_smooth_c
#define SCALE_FUNC _evas_common_scale_rgba_in_to_out_clip_smooth_c
#undef SCALE_USING_MMX
#include "evas_scale_smooth_scaler.c"
#ifdef BUILD_MMX
void
evas_common_scale_rgba_in_to_out_clip_smooth_mmx(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h)
{
int clip_x, clip_y, clip_w, clip_h;
DATA32 mul_col;
if (dc->clip.use)
{
clip_x = dc->clip.x;
clip_y = dc->clip.y;
clip_w = dc->clip.w;
clip_h = dc->clip.h;
}
else
{
clip_x = 0;
clip_y = 0;
clip_w = dst->cache_entry.w;
clip_h = dst->cache_entry.h;
}
mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
_evas_common_scale_rgba_in_to_out_clip_smooth_mmx
(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, dc->render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
#endif
void
evas_common_scale_rgba_in_to_out_clip_smooth_c(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h)
{
int clip_x, clip_y, clip_w, clip_h;
DATA32 mul_col;
if (dc->clip.use)
{
clip_x = dc->clip.x;
clip_y = dc->clip.y;
clip_w = dc->clip.w;
clip_h = dc->clip.h;
}
else
{
clip_x = 0;
clip_y = 0;
clip_w = dst->cache_entry.w;
clip_h = dst->cache_entry.h;
}
mul_col = dc->mul.use ? dc->mul.col : 0xffffffff;
_evas_common_scale_rgba_in_to_out_clip_smooth_mmx
(src, dst,
clip_x, clip_y, clip_w, clip_h,
mul_col, dc->render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
EAPI void
evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
@ -129,6 +203,30 @@ evas_common_scale_rgba_in_to_out_clip_smooth(RGBA_Image *src, RGBA_Image *dst,
cb);
}
EAPI void
evas_common_scale_rgba_smooth_draw(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
{
#ifdef BUILD_MMX
int mmx, sse, sse2;
evas_common_cpu_can_do(&mmx, &sse, &sse2);
if (mmx)
_evas_common_scale_rgba_in_to_out_clip_smooth_mmx
(src, dst,
dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
mul_col, render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
else
#endif
_evas_common_scale_rgba_in_to_out_clip_smooth_c
(src, dst,
dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
mul_col, render_op,
src_region_x, src_region_y, src_region_w, src_region_h,
dst_region_x, dst_region_y, dst_region_w, dst_region_h);
}
EAPI void
evas_common_scale_rgba_in_to_out_clip_smooth_do(const Cutout_Rects *reuse,
const Eina_Rectangle *clip,

View File

@ -1,53 +1,34 @@
void
SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h)
SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, int dst_clip_x, int dst_clip_y, int dst_clip_w, int dst_clip_h, DATA32 mul_col, int render_op, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h)
{
DATA32 *dst_ptr;
int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
int src_w, src_h, dst_w, dst_h;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
return;
if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
return;
if (!(RECTS_INTERSECT(dst_region_x, dst_region_y, dst_region_w, dst_region_h,
0, 0, dst->cache_entry.w, dst->cache_entry.h))) return;
if (!(RECTS_INTERSECT(src_region_x, src_region_y, src_region_w, src_region_h,
0, 0, src->cache_entry.w, src->cache_entry.h))) return;
src_w = src->cache_entry.w;
src_h = src->cache_entry.h;
dst_w = dst->cache_entry.w;
dst_h = dst->cache_entry.h;
if (dc->clip.use)
if (dst_clip_x < 0)
{
dst_clip_x = dc->clip.x;
dst_clip_y = dc->clip.y;
dst_clip_w = dc->clip.w;
dst_clip_h = dc->clip.h;
if (dst_clip_x < 0)
{
dst_clip_w += dst_clip_x;
dst_clip_x = 0;
}
if (dst_clip_y < 0)
{
dst_clip_h += dst_clip_y;
dst_clip_y = 0;
}
if ((dst_clip_w <= 0) || (dst_clip_h <= 0)) return;
if ((dst_clip_x + dst_clip_w) > dst_w) dst_clip_w = dst_w - dst_clip_x;
if ((dst_clip_y + dst_clip_h) > dst_h) dst_clip_h = dst_h - dst_clip_y;
dst_clip_w += dst_clip_x;
dst_clip_x = 0;
}
else
if (dst_clip_y < 0)
{
dst_clip_x = 0;
dst_clip_y = 0;
dst_clip_w = dst_w;
dst_clip_h = dst_h;
dst_clip_h += dst_clip_y;
dst_clip_y = 0;
}
if ((dst_clip_w <= 0) || (dst_clip_h <= 0)) return;
if ((dst_clip_x + dst_clip_w) > dst_w) dst_clip_w = dst_w - dst_clip_x;
if ((dst_clip_y + dst_clip_h) > dst_h) dst_clip_h = dst_h - dst_clip_y;
if (dst_clip_x < dst_region_x)
{
dst_clip_w += dst_clip_x - dst_region_x;
@ -141,7 +122,7 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst,
if (dst_clip_h > 65536) return;
if (dst_region_w > (65536 * 1024)) return;
if (dst_region_h > (65536 * 1024)) return;
/* figure out dst jump
* NB: Unused currently, so commented out */
// dst_jump = dst_w - dst_clip_w;

View File

@ -8,20 +8,20 @@
RGBA_Gfx_Func func;
src_data = src->image.data;
/* some maximum region sizes to avoid insane calc point tables */
SCALE_CALC_X_POINTS(xpoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
SCALE_CALC_Y_POINTS(ypoints, src_data, src_w, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
SCALE_CALC_A_POINTS(xapoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w);
SCALE_CALC_A_POINTS(yapoints, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h);
/* a scanline buffer */
buf = alloca(dst_clip_w * sizeof(DATA32));
if (dc->mul.use)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
if (mul_col != 0xffffffff)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
else
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
/* scaling down vertically */
if ((dst_region_w >= src_region_w) &&
(dst_region_h < src_region_h))

View File

@ -82,7 +82,7 @@
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;
@ -96,7 +96,7 @@
#ifdef DIRECT_SCALE
if ((!src->cache_entry.flags.alpha) &&
(!dst->cache_entry.flags.alpha) &&
(!dc->mul.use))
(mul_col == 0xffffffff))
{
while (dst_clip_h--)
{
@ -155,7 +155,7 @@
((b + (1 << 3)) >> 4));
xp++; xapp++;
}
dptr += dst_w; dst_clip_w = w;
yp++; yapp++;
xp = xpoints;// + dxx;
@ -220,8 +220,8 @@
((b + (1 << 3)) >> 4));
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;

View File

@ -4,8 +4,8 @@
int a, r, g, b, rx, gx, bx, ax;
int xap, yap, pos;
//int dyy, dxx;
DATA32 **yp;
DATA32 **yp;
int *xp;
int w = dst_clip_w;
@ -28,16 +28,16 @@
{
Cy = *yapp >> 16;
yap = *yapp & 0xffff;
while (dst_clip_w--)
{
Cx = *xapp >> 16;
xap = *xapp & 0xffff;
sptr = *yp + *xp + pos;
pix = sptr;
sptr += src_w;
ax = (A_VAL(pix) * xap) >> 9;
rx = (R_VAL(pix) * xap) >> 9;
gx = (G_VAL(pix) * xap) >> 9;
@ -58,12 +58,12 @@
gx += (G_VAL(pix) * i) >> 9;
bx += (B_VAL(pix) * i) >> 9;
}
a = (ax * yap) >> 14;
r = (rx * yap) >> 14;
g = (gx * yap) >> 14;
b = (bx * yap) >> 14;
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
{
pix = sptr;
@ -118,20 +118,20 @@
gx += (G_VAL(pix) * i) >> 9;
bx += (B_VAL(pix) * i) >> 9;
}
a += (ax * j) >> 14;
r += (rx * j) >> 14;
g += (gx * j) >> 14;
b += (bx * j) >> 14;
}
*pbuf++ = ARGB_JOIN(((a + (1 << 4)) >> 5),
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
*pbuf++ = ARGB_JOIN(((a + (1 << 4)) >> 5),
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
((b + (1 << 4)) >> 5));
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;
@ -145,23 +145,23 @@
#ifdef DIRECT_SCALE
if ((!src->cache_entry.flags.alpha) &&
(!dst->cache_entry.flags.alpha) &&
(!dc->mul.use))
(mul_col == 0xffffffff))
{
while (dst_clip_h--)
{
Cy = *yapp >> 16;
yap = *yapp & 0xffff;
pbuf = dptr;
while (dst_clip_w--)
{
Cx = *xapp >> 16;
xap = *xapp & 0xffff;
sptr = *yp + *xp + pos;
pix = sptr;
sptr += src_w;
rx = (R_VAL(pix) * xap) >> 9;
gx = (G_VAL(pix) * xap) >> 9;
bx = (B_VAL(pix) * xap) >> 9;
@ -183,7 +183,7 @@
r = (rx * yap) >> 14;
g = (gx * yap) >> 14;
b = (bx * yap) >> 14;
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
{
pix = sptr;
@ -205,7 +205,7 @@
gx += (G_VAL(pix) * i) >> 9;
bx += (B_VAL(pix) * i) >> 9;
}
r += (rx * Cy) >> 14;
g += (gx * Cy) >> 14;
b += (bx * Cy) >> 14;
@ -236,9 +236,9 @@
g += (gx * j) >> 14;
b += (bx * j) >> 14;
}
*pbuf++ = ARGB_JOIN(0xff,
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
*pbuf++ = ARGB_JOIN(0xff,
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
((b + (1 << 4)) >> 5));
xp++; xapp++;
}
@ -250,22 +250,22 @@
}
}
else
#endif
#endif
{
while (dst_clip_h--)
{
Cy = *yapp >> 16;
yap = *yapp & 0xffff;
while (dst_clip_w--)
{
Cx = *xapp >> 16;
xap = *xapp & 0xffff;
sptr = *yp + *xp + pos;
pix = sptr;
sptr += src_w;
rx = (R_VAL(pix) * xap) >> 9;
gx = (G_VAL(pix) * xap) >> 9;
bx = (B_VAL(pix) * xap) >> 9;
@ -287,7 +287,7 @@
r = (rx * yap) >> 14;
g = (gx * yap) >> 14;
b = (bx * yap) >> 14;
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
{
pix = sptr;
@ -340,14 +340,14 @@
g += (gx * j) >> 14;
b += (bx * j) >> 14;
}
*pbuf++ = ARGB_JOIN(0xff,
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
*pbuf++ = ARGB_JOIN(0xff,
((r + (1 << 4)) >> 5),
((g + (1 << 4)) >> 5),
((b + (1 << 4)) >> 5));
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;

View File

@ -82,8 +82,8 @@
((b + (1 << 3)) >> 4));
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;
@ -97,7 +97,7 @@
#ifdef DIRECT_SCALE
if ((!src->cache_entry.flags.alpha) &&
(!dst->cache_entry.flags.alpha) &&
(!dc->mul.use))
(mul_col == 0xffffffff))
{
while (dst_clip_h--)
{
@ -222,8 +222,8 @@
((b + (1 << 3)) >> 4));
xp++; xapp++;
}
func(buf, NULL, dc->mul.col, dptr, w);
func(buf, NULL, mul_col, dptr, w);
pbuf = buf;
dptr += dst_w; dst_clip_w = w;

View File

@ -3,14 +3,14 @@
RGBA_Gfx_Func func;
ptr = src->image.data + ((dst_clip_y - dst_region_y + src_region_y) * src_w) + (dst_clip_x - dst_region_x) + src_region_x;
if (dc->mul.use)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
if (mul_col != 0xffffffff)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
else
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
while (dst_clip_h--)
{
func(ptr, NULL, dc->mul.col, dst_ptr, dst_clip_w);
func(ptr, NULL, mul_col, dst_ptr, dst_clip_w);
ptr += src_w;
dst_ptr += dst_w;

View File

@ -19,11 +19,11 @@
/* a scanline buffer */
pdst = dst_ptr; // it's been set at (dst_clip_x, dst_clip_y)
pdst_end = pdst + (dst_clip_h * dst_w);
if (!dc->mul.use)
if (mul_col == 0xffffffff)
{
if ((dc->render_op == _EVAS_RENDER_BLEND) && !src->cache_entry.flags.alpha)
if ((render_op == _EVAS_RENDER_BLEND) && !src->cache_entry.flags.alpha)
{ direct_scale = 1; buf_step = dst->cache_entry.w; }
else if (dc->render_op == _EVAS_RENDER_COPY)
else if (render_op == _EVAS_RENDER_COPY)
{
direct_scale = 1; buf_step = dst->cache_entry.w;
if (src->cache_entry.flags.alpha)
@ -33,10 +33,10 @@
if (!direct_scale)
{
buf = alloca(dst_clip_w * sizeof(DATA32));
if (dc->mul.use)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op);
if (mul_col != 0xffffffff)
func = evas_common_gfx_func_composite_pixel_color_span_get(src, mul_col, dst, dst_clip_w, render_op);
else
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op);
func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, render_op);
}
else
buf = pdst;
@ -99,7 +99,7 @@
}
/* * blend here [clip_w *] buf -> dptr * */
if (!direct_scale)
func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
func(buf, NULL, mul_col, pdst, dst_clip_w);
pdst += dst_w;
psrc += src_w;
@ -149,7 +149,7 @@
}
/* * blend here [clip_w *] buf -> dptr * */
if (!direct_scale)
func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
func(buf, NULL, mul_col, pdst, dst_clip_w);
pdst += dst_w;
syy += dsyy;
buf += buf_step;
@ -223,7 +223,7 @@
}
/* * blend here [clip_w *] buf -> dptr * */
if (!direct_scale)
func(buf, NULL, dc->mul.col, pdst, dst_clip_w);
func(buf, NULL, mul_col, pdst, dst_clip_w);
pdst += dst_w;
syy += dsyy;