2004-01-29 21:46:57 -08:00
|
|
|
{
|
|
|
|
int Cy, j;
|
2005-12-03 01:27:53 -08:00
|
|
|
DATA32 *dptr, *pix, *pbuf, **yp;
|
2004-01-29 21:46:57 -08:00
|
|
|
int r, g, b, a, rr, gg, bb, aa;
|
2005-12-03 01:27:53 -08:00
|
|
|
int *xp, xap, yap, pos;
|
2004-01-29 21:46:57 -08:00
|
|
|
int dyy, dxx;
|
2005-12-03 01:27:53 -08:00
|
|
|
int w = dst_clip_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
#ifdef EVAS_SLI
|
|
|
|
int ysli = dst_clip_y;
|
|
|
|
#endif
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2004-01-29 21:46:57 -08:00
|
|
|
dptr = dst_ptr;
|
2005-12-03 01:27:53 -08:00
|
|
|
pos = (src_region_y * src_w) + src_region_x;
|
2004-01-29 21:46:57 -08:00
|
|
|
dyy = dst_clip_y - dst_region_y;
|
|
|
|
dxx = dst_clip_x - dst_region_x;
|
2005-12-03 01:27:53 -08:00
|
|
|
|
|
|
|
xp = xpoints + dxx;
|
|
|
|
yp = ypoints + dyy;
|
|
|
|
xapp = xapoints + dxx;
|
|
|
|
yapp = yapoints + dyy;
|
|
|
|
pbuf = buf;
|
|
|
|
|
2008-06-03 02:09:39 -07:00
|
|
|
if (src->cache_entry.flags.alpha)
|
2004-01-29 21:46:57 -08:00
|
|
|
{
|
2005-12-03 01:27:53 -08:00
|
|
|
while (dst_clip_h--)
|
2004-01-29 21:46:57 -08:00
|
|
|
{
|
2006-11-15 08:44:34 -08:00
|
|
|
#ifdef EVAS_SLI
|
|
|
|
if (((ysli) % dc->sli.h) == dc->sli.y)
|
|
|
|
#endif
|
2004-01-29 21:46:57 -08:00
|
|
|
{
|
2006-01-22 23:57:30 -08:00
|
|
|
Cy = *yapp >> 16;
|
|
|
|
yap = *yapp & 0xffff;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-01-22 23:57:30 -08:00
|
|
|
while (dst_clip_w--)
|
2004-01-29 21:46:57 -08:00
|
|
|
{
|
2006-01-22 23:57:30 -08:00
|
|
|
pix = *yp + *xp + pos;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
a = (A_VAL(pix) * yap) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
r = (R_VAL(pix) * yap) >> 10;
|
|
|
|
g = (G_VAL(pix) * yap) >> 10;
|
|
|
|
b = (B_VAL(pix) * yap) >> 10;
|
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
a += (A_VAL(pix) * Cy) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
r += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
g += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
b += (B_VAL(pix) * Cy) >> 10;
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
a += (A_VAL(pix) * j) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
r += (R_VAL(pix) * j) >> 10;
|
|
|
|
g += (G_VAL(pix) * j) >> 10;
|
|
|
|
b += (B_VAL(pix) * j) >> 10;
|
|
|
|
}
|
|
|
|
if ((xap = *xapp) > 0)
|
|
|
|
{
|
|
|
|
pix = *yp + *xp + 1 + pos;
|
2006-11-15 08:44:34 -08:00
|
|
|
aa = (A_VAL(pix) * yap) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
rr = (R_VAL(pix) * yap) >> 10;
|
|
|
|
gg = (G_VAL(pix) * yap) >> 10;
|
|
|
|
bb = (B_VAL(pix) * yap) >> 10;
|
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
aa += (A_VAL(pix) * Cy) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
rr += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
gg += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
bb += (B_VAL(pix) * Cy) >> 10;
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
aa += (A_VAL(pix) * j) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
rr += (R_VAL(pix) * j) >> 10;
|
|
|
|
gg += (G_VAL(pix) * j) >> 10;
|
|
|
|
bb += (B_VAL(pix) * j) >> 10;
|
|
|
|
}
|
2006-11-15 08:44:34 -08:00
|
|
|
a += ((aa - a) * xap) >> 8;
|
2006-01-22 23:57:30 -08:00
|
|
|
r += ((rr - r) * xap) >> 8;
|
|
|
|
g += ((gg - g) * xap) >> 8;
|
|
|
|
b += ((bb - b) * xap) >> 8;
|
|
|
|
}
|
2010-12-01 01:46:26 -08:00
|
|
|
*pbuf++ = ARGB_JOIN(((a + (1 << 3)) >> 4),
|
|
|
|
((r + (1 << 3)) >> 4),
|
|
|
|
((g + (1 << 3)) >> 4),
|
|
|
|
((b + (1 << 3)) >> 4));
|
2006-01-22 23:57:30 -08:00
|
|
|
xp++; xapp++;
|
2004-01-29 21:46:57 -08:00
|
|
|
}
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
func(buf, NULL, dc->mul.col, dptr, w);
|
|
|
|
}
|
|
|
|
#ifdef EVAS_SLI
|
|
|
|
ysli++;
|
|
|
|
#endif
|
|
|
|
pbuf = buf;
|
|
|
|
dptr += dst_w; dst_clip_w = w;
|
|
|
|
yp++; yapp++;
|
|
|
|
xp = xpoints + dxx;
|
|
|
|
xapp = xapoints + dxx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#ifdef DIRECT_SCALE
|
2008-06-03 02:09:39 -07:00
|
|
|
if ((!src->cache_entry.flags.alpha) &&
|
|
|
|
(!dst->cache_entry.flags.alpha) &&
|
2006-11-15 08:44:34 -08:00
|
|
|
(!dc->mul.use))
|
|
|
|
{
|
|
|
|
while (dst_clip_h--)
|
|
|
|
{
|
|
|
|
#ifdef EVAS_SLI
|
|
|
|
if (((ysli) % dc->sli.h) == dc->sli.y)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
Cy = *yapp >> 16;
|
|
|
|
yap = *yapp & 0xffff;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
pbuf = dptr;
|
|
|
|
while (dst_clip_w--)
|
|
|
|
{
|
|
|
|
pix = *yp + *xp + pos;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
r = (R_VAL(pix) * yap) >> 10;
|
|
|
|
g = (G_VAL(pix) * yap) >> 10;
|
|
|
|
b = (B_VAL(pix) * yap) >> 10;
|
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
r += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
g += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
b += (B_VAL(pix) * Cy) >> 10;
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
r += (R_VAL(pix) * j) >> 10;
|
|
|
|
g += (G_VAL(pix) * j) >> 10;
|
|
|
|
b += (B_VAL(pix) * j) >> 10;
|
|
|
|
}
|
|
|
|
if ((xap = *xapp) > 0)
|
|
|
|
{
|
|
|
|
pix = *yp + *xp + 1 + pos;
|
|
|
|
rr = (R_VAL(pix) * yap) >> 10;
|
|
|
|
gg = (G_VAL(pix) * yap) >> 10;
|
|
|
|
bb = (B_VAL(pix) * yap) >> 10;
|
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
rr += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
gg += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
bb += (B_VAL(pix) * Cy) >> 10;
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
rr += (R_VAL(pix) * j) >> 10;
|
|
|
|
gg += (G_VAL(pix) * j) >> 10;
|
|
|
|
bb += (B_VAL(pix) * j) >> 10;
|
|
|
|
}
|
|
|
|
r += ((rr - r) * xap) >> 8;
|
|
|
|
g += ((gg - g) * xap) >> 8;
|
|
|
|
b += ((bb - b) * xap) >> 8;
|
|
|
|
}
|
2010-12-01 01:46:26 -08:00
|
|
|
*pbuf++ = ARGB_JOIN(0xff,
|
|
|
|
((r + (1 << 3)) >> 4),
|
|
|
|
((g + (1 << 3)) >> 4),
|
|
|
|
((b + (1 << 3)) >> 4));
|
2006-11-15 08:44:34 -08:00
|
|
|
xp++; xapp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef EVAS_SLI
|
|
|
|
ysli++;
|
|
|
|
#endif
|
2006-01-22 23:57:30 -08:00
|
|
|
dptr += dst_w; dst_clip_w = w;
|
|
|
|
yp++; yapp++;
|
|
|
|
xp = xpoints + dxx;
|
|
|
|
xapp = xapoints + dxx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2008-07-19 10:40:52 -07:00
|
|
|
#endif
|
2006-01-22 23:57:30 -08:00
|
|
|
{
|
|
|
|
while (dst_clip_h--)
|
|
|
|
{
|
2006-11-15 08:44:34 -08:00
|
|
|
#ifdef EVAS_SLI
|
|
|
|
if (((ysli) % dc->sli.h) == dc->sli.y)
|
|
|
|
#endif
|
2004-01-29 21:46:57 -08:00
|
|
|
{
|
2006-11-15 08:44:34 -08:00
|
|
|
Cy = *yapp >> 16;
|
|
|
|
yap = *yapp & 0xffff;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
while (dst_clip_w--)
|
2006-01-22 23:57:30 -08:00
|
|
|
{
|
2006-11-15 08:44:34 -08:00
|
|
|
pix = *yp + *xp + pos;
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
r = (R_VAL(pix) * yap) >> 10;
|
|
|
|
g = (G_VAL(pix) * yap) >> 10;
|
|
|
|
b = (B_VAL(pix) * yap) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
r += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
g += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
b += (B_VAL(pix) * Cy) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
2006-11-15 08:44:34 -08:00
|
|
|
r += (R_VAL(pix) * j) >> 10;
|
|
|
|
g += (G_VAL(pix) * j) >> 10;
|
|
|
|
b += (B_VAL(pix) * j) >> 10;
|
2006-01-22 23:57:30 -08:00
|
|
|
}
|
2006-11-15 08:44:34 -08:00
|
|
|
if ((xap = *xapp) > 0)
|
|
|
|
{
|
|
|
|
pix = *yp + *xp + 1 + pos;
|
|
|
|
rr = (R_VAL(pix) * yap) >> 10;
|
|
|
|
gg = (G_VAL(pix) * yap) >> 10;
|
|
|
|
bb = (B_VAL(pix) * yap) >> 10;
|
|
|
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
rr += (R_VAL(pix) * Cy) >> 10;
|
|
|
|
gg += (G_VAL(pix) * Cy) >> 10;
|
|
|
|
bb += (B_VAL(pix) * Cy) >> 10;
|
|
|
|
}
|
|
|
|
if (j > 0)
|
|
|
|
{
|
|
|
|
pix += src_w;
|
|
|
|
rr += (R_VAL(pix) * j) >> 10;
|
|
|
|
gg += (G_VAL(pix) * j) >> 10;
|
|
|
|
bb += (B_VAL(pix) * j) >> 10;
|
|
|
|
}
|
|
|
|
r += ((rr - r) * xap) >> 8;
|
|
|
|
g += ((gg - g) * xap) >> 8;
|
|
|
|
b += ((bb - b) * xap) >> 8;
|
|
|
|
}
|
2010-12-01 01:46:26 -08:00
|
|
|
*pbuf++ = ARGB_JOIN(0xff,
|
|
|
|
((r + (1 << 3)) >> 4),
|
|
|
|
((g + (1 << 3)) >> 4),
|
|
|
|
((b + (1 << 3)) >> 4));
|
2006-11-15 08:44:34 -08:00
|
|
|
xp++; xapp++;
|
2006-01-22 23:57:30 -08:00
|
|
|
}
|
2008-07-19 10:40:52 -07:00
|
|
|
|
2006-11-15 08:44:34 -08:00
|
|
|
func(buf, NULL, dc->mul.col, dptr, w);
|
2004-01-29 21:46:57 -08:00
|
|
|
}
|
2006-11-15 08:44:34 -08:00
|
|
|
#ifdef EVAS_SLI
|
|
|
|
ysli++;
|
|
|
|
#endif
|
2006-01-22 23:57:30 -08:00
|
|
|
pbuf = buf;
|
|
|
|
dptr += dst_w; dst_clip_w = w;
|
|
|
|
yp++; yapp++;
|
|
|
|
xp = xpoints + dxx;
|
|
|
|
xapp = xapoints + dxx;
|
2004-01-29 21:46:57 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|