1. buffer test really wqasnt being very fair - time to be fair.
2. be able to skip a copy in certain cases when scaling - should improve speed in several situations - evas is defintiely not optimal :) SVN revision: 19983
This commit is contained in:
parent
c7788c6bd8
commit
07e7927004
|
@ -25,7 +25,7 @@ main(int argc, char **argv)
|
||||||
einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas);
|
einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas);
|
||||||
|
|
||||||
/* the following is specific to the engine */
|
/* the following is specific to the engine */
|
||||||
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_BGR24;
|
einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
|
||||||
img_buf = malloc(win_w * win_h * 3);
|
img_buf = malloc(win_w * win_h * 3);
|
||||||
einfo->info.dest_buffer = img_buf;
|
einfo->info.dest_buffer = img_buf;
|
||||||
einfo->info.dest_buffer_row_bytes = win_w * 3;
|
einfo->info.dest_buffer_row_bytes = win_w * 3;
|
||||||
|
|
|
@ -351,10 +351,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* a scanline buffer */
|
|
||||||
buf = malloc(dst_clip_w * sizeof(DATA32));
|
|
||||||
if (!buf) goto no_buf;
|
|
||||||
|
|
||||||
/* fill scale tables */
|
/* fill scale tables */
|
||||||
for (x = 0; x < dst_clip_w; x++)
|
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;
|
lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
|
||||||
|
@ -363,6 +359,31 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
+ src_region_y) * src_w);
|
+ src_region_y) * src_w);
|
||||||
/* scale to dst */
|
/* scale to dst */
|
||||||
dptr = dst_ptr;
|
dptr = dst_ptr;
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)))
|
||||||
|
{
|
||||||
|
for (y = 0; y < dst_clip_h; y++)
|
||||||
|
{
|
||||||
|
dst_ptr = dptr;
|
||||||
|
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, dptr, dst_clip_w);
|
||||||
|
dptr += dst_w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
/* a scanline buffer */
|
||||||
|
buf = malloc(dst_clip_w * sizeof(DATA32));
|
||||||
|
if (!buf) goto no_buf;
|
||||||
|
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
for (y = 0; y < dst_clip_h; y++)
|
||||||
{
|
{
|
||||||
dst_ptr = buf;
|
dst_ptr = buf;
|
||||||
|
@ -379,6 +400,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
no_buf:
|
no_buf:
|
||||||
/* free scale tables */
|
/* free scale tables */
|
||||||
|
|
|
@ -95,6 +95,83 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!dc->mod.use) && (!dc->mul.use))
|
||||||
|
{
|
||||||
|
while (dst_clip_h--)
|
||||||
|
{
|
||||||
|
pbuf = dptr;
|
||||||
|
while (dst_clip_w--)
|
||||||
|
{
|
||||||
|
Cx = *xapp >> 16;
|
||||||
|
xap = *xapp & 0xffff;
|
||||||
|
pix = *yp + *xp + pos;
|
||||||
|
|
||||||
|
r = (R_VAL(pix) * xap) >> 10;
|
||||||
|
g = (G_VAL(pix) * xap) >> 10;
|
||||||
|
b = (B_VAL(pix) * xap) >> 10;
|
||||||
|
for (j = (1 << 14) - xap; j > Cx; j -= Cx)
|
||||||
|
{
|
||||||
|
pix++;
|
||||||
|
r += (R_VAL(pix) * Cx) >> 10;
|
||||||
|
g += (G_VAL(pix) * Cx) >> 10;
|
||||||
|
b += (B_VAL(pix) * Cx) >> 10;
|
||||||
|
}
|
||||||
|
if (j > 0)
|
||||||
|
{
|
||||||
|
pix++;
|
||||||
|
r += (R_VAL(pix) * j) >> 10;
|
||||||
|
g += (G_VAL(pix) * j) >> 10;
|
||||||
|
b += (B_VAL(pix) * j) >> 10;
|
||||||
|
}
|
||||||
|
if ((yap = *yapp) > 0)
|
||||||
|
{
|
||||||
|
pix = *yp + *xp + src_w + pos;
|
||||||
|
rr = (R_VAL(pix) * xap) >> 10;
|
||||||
|
gg = (G_VAL(pix) * xap) >> 10;
|
||||||
|
bb = (B_VAL(pix) * xap) >> 10;
|
||||||
|
for (j = (1 << 14) - xap; j > Cx; j -= Cx)
|
||||||
|
{
|
||||||
|
pix++;
|
||||||
|
rr += (R_VAL(pix) * Cx) >> 10;
|
||||||
|
gg += (G_VAL(pix) * Cx) >> 10;
|
||||||
|
bb += (B_VAL(pix) * Cx) >> 10;
|
||||||
|
}
|
||||||
|
if (j > 0)
|
||||||
|
{
|
||||||
|
pix++;
|
||||||
|
rr += (R_VAL(pix) * j) >> 10;
|
||||||
|
gg += (G_VAL(pix) * j) >> 10;
|
||||||
|
bb += (B_VAL(pix) * j) >> 10;
|
||||||
|
}
|
||||||
|
r += ((rr - r) * yap) >> 8;
|
||||||
|
g += ((gg - g) * yap) >> 8;
|
||||||
|
b += ((bb - b) * yap) >> 8;
|
||||||
|
}
|
||||||
|
*pbuf++ = ARGB_JOIN(0xff, r >> 4, g >> 4, b >> 4);
|
||||||
|
xp++; xapp++;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (dc->mod.use)
|
||||||
|
func_cmod(buf, dptr, w, dc->mod.r, dc->mod.g, dc->mod.b, dc->mod.a);
|
||||||
|
else if (dc->mul.use)
|
||||||
|
func_mul(buf, dptr, w, dc->mul.col);
|
||||||
|
else
|
||||||
|
func(buf, dptr, w);
|
||||||
|
pbuf = buf;
|
||||||
|
*/
|
||||||
|
|
||||||
|
dptr += dst_w; dst_clip_w = w;
|
||||||
|
yp++; yapp++;
|
||||||
|
xp = xpoints + dxx;
|
||||||
|
xapp = xapoints + dxx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
while (dst_clip_h--)
|
while (dst_clip_h--)
|
||||||
{
|
{
|
||||||
while (dst_clip_w--)
|
while (dst_clip_w--)
|
||||||
|
@ -163,3 +240,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -144,6 +144,121 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!dc->mod.use) && (!dc->mul.use))
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
pix++;
|
||||||
|
for (i = (1 << 14) - xap; i > Cx; i -= Cx)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * Cx) >> 9;
|
||||||
|
gx += (G_VAL(pix) * Cx) >> 9;
|
||||||
|
bx += (B_VAL(pix) * Cx) >> 9;
|
||||||
|
pix++;
|
||||||
|
}
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * i) >> 9;
|
||||||
|
gx += (G_VAL(pix) * i) >> 9;
|
||||||
|
bx += (B_VAL(pix) * i) >> 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = (rx * yap) >> 14;
|
||||||
|
g = (gx * yap) >> 14;
|
||||||
|
b = (bx * yap) >> 14;
|
||||||
|
|
||||||
|
for (j = (1 << 14) - yap; j > Cy; j -= Cy)
|
||||||
|
{
|
||||||
|
pix = sptr;
|
||||||
|
sptr += src_w;
|
||||||
|
rx = (R_VAL(pix) * xap) >> 9;
|
||||||
|
gx = (G_VAL(pix) * xap) >> 9;
|
||||||
|
bx = (B_VAL(pix) * xap) >> 9;
|
||||||
|
pix++;
|
||||||
|
for (i = (1 << 14) - xap; i > Cx; i -= Cx)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * Cx) >> 9;
|
||||||
|
gx += (G_VAL(pix) * Cx) >> 9;
|
||||||
|
bx += (B_VAL(pix) * Cx) >> 9;
|
||||||
|
pix++;
|
||||||
|
}
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * i) >> 9;
|
||||||
|
gx += (G_VAL(pix) * i) >> 9;
|
||||||
|
bx += (B_VAL(pix) * i) >> 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
r += (rx * Cy) >> 14;
|
||||||
|
g += (gx * Cy) >> 14;
|
||||||
|
b += (bx * Cy) >> 14;
|
||||||
|
}
|
||||||
|
if (j > 0)
|
||||||
|
{
|
||||||
|
pix = sptr;
|
||||||
|
sptr += src_w;
|
||||||
|
rx = (R_VAL(pix) * xap) >> 9;
|
||||||
|
gx = (G_VAL(pix) * xap) >> 9;
|
||||||
|
bx = (B_VAL(pix) * xap) >> 9;
|
||||||
|
pix++;
|
||||||
|
for (i = (1 << 14) - xap; i > Cx; i -= Cx)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * Cx) >> 9;
|
||||||
|
gx += (G_VAL(pix) * Cx) >> 9;
|
||||||
|
bx += (B_VAL(pix) * Cx) >> 9;
|
||||||
|
pix++;
|
||||||
|
}
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
rx += (R_VAL(pix) * i) >> 9;
|
||||||
|
gx += (G_VAL(pix) * i) >> 9;
|
||||||
|
bx += (B_VAL(pix) * i) >> 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
r += (rx * j) >> 14;
|
||||||
|
g += (gx * j) >> 14;
|
||||||
|
b += (bx * j) >> 14;
|
||||||
|
}
|
||||||
|
*pbuf++ = ARGB_JOIN(0xff, r >> 5, g >> 5, b >> 5);
|
||||||
|
xp++; xapp++;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (dc->mod.use)
|
||||||
|
func_cmod(buf, dptr, w, dc->mod.r, dc->mod.g, dc->mod.b, dc->mod.a);
|
||||||
|
else if (dc->mul.use)
|
||||||
|
func_mul(buf, dptr, w, dc->mul.col);
|
||||||
|
else
|
||||||
|
func(buf, dptr, w);
|
||||||
|
pbuf = dptr;
|
||||||
|
*/
|
||||||
|
dptr += dst_w; dst_clip_w = w;
|
||||||
|
xp = xpoints + dxx;
|
||||||
|
xapp = xapoints + dxx;
|
||||||
|
yp++; yapp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
while (dst_clip_h--)
|
while (dst_clip_h--)
|
||||||
{
|
{
|
||||||
Cy = *yapp >> 16;
|
Cy = *yapp >> 16;
|
||||||
|
@ -250,6 +365,7 @@
|
||||||
yp++; yapp++;
|
yp++; yapp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* MMX scaling down would go here */
|
/* MMX scaling down would go here */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -96,6 +96,83 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!dc->mod.use) && (!dc->mul.use))
|
||||||
|
{
|
||||||
|
while (dst_clip_h--)
|
||||||
|
{
|
||||||
|
Cy = *yapp >> 16;
|
||||||
|
yap = *yapp & 0xffff;
|
||||||
|
|
||||||
|
pbuf = dptr;
|
||||||
|
while (dst_clip_w--)
|
||||||
|
{
|
||||||
|
pix = *yp + *xp + pos;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
*pbuf++ = ARGB_JOIN(0xff, r >> 4, g >> 4, b >> 4);
|
||||||
|
xp++; xapp++;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (dc->mod.use)
|
||||||
|
func_cmod(buf, dptr, w, dc->mod.r, dc->mod.g, dc->mod.b, dc->mod.a);
|
||||||
|
else if (dc->mul.use)
|
||||||
|
func_mul(buf, dptr, w, dc->mul.col);
|
||||||
|
else
|
||||||
|
func(buf, dptr, w);
|
||||||
|
pbuf = buf;
|
||||||
|
*/
|
||||||
|
dptr += dst_w; dst_clip_w = w;
|
||||||
|
yp++; yapp++;
|
||||||
|
xp = xpoints + dxx;
|
||||||
|
xapp = xapoints + dxx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
while (dst_clip_h--)
|
while (dst_clip_h--)
|
||||||
{
|
{
|
||||||
Cy = *yapp >> 16;
|
Cy = *yapp >> 16;
|
||||||
|
@ -165,3 +242,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -245,6 +245,61 @@
|
||||||
DATA8 p2r = 0, p2g = 0, p2b = 0;
|
DATA8 p2r = 0, p2g = 0, p2b = 0;
|
||||||
DATA32 *lptr1, *lptr2;
|
DATA32 *lptr1, *lptr2;
|
||||||
|
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!dc->mod.use) && (!dc->mul.use))
|
||||||
|
{
|
||||||
|
while (dst_clip_h--)
|
||||||
|
{
|
||||||
|
lptr1 = *rp;
|
||||||
|
lptr2 = lptr1 + src_w;
|
||||||
|
if (lptr2 > src_end) lptr2 = lptr1;
|
||||||
|
k = *iy;
|
||||||
|
dst_ptr = dptr;
|
||||||
|
|
||||||
|
lp = lin_ptr; ix = interp_x;
|
||||||
|
ptr = lptr1 + *lp;
|
||||||
|
ptr2 = lptr2 + *lp;
|
||||||
|
p2r = R_VAL(ptr) + ((k * (R_VAL(ptr2) - R_VAL(ptr))) >> 8);
|
||||||
|
p2g = G_VAL(ptr) + ((k * (G_VAL(ptr2) - G_VAL(ptr))) >> 8);
|
||||||
|
p2b = B_VAL(ptr) + ((k * (B_VAL(ptr2) - B_VAL(ptr))) >> 8);
|
||||||
|
px = -1;
|
||||||
|
while (dst_clip_w--)
|
||||||
|
{
|
||||||
|
if (px != *lp)
|
||||||
|
{
|
||||||
|
px = *lp;
|
||||||
|
|
||||||
|
ptr2 = lptr1 + px + 1;
|
||||||
|
ptr4 = lptr2 + px + 1;
|
||||||
|
if (px >= (src_w - 1))
|
||||||
|
{
|
||||||
|
ptr2--;
|
||||||
|
ptr4--;
|
||||||
|
}
|
||||||
|
p1r = p2r;
|
||||||
|
p1g = p2g;
|
||||||
|
p1b = p2b;
|
||||||
|
p2r = R_VAL(ptr2) + ((k * (R_VAL(ptr4) - R_VAL(ptr2))) >> 8);
|
||||||
|
p2g = G_VAL(ptr2) + ((k * (G_VAL(ptr4) - G_VAL(ptr2))) >> 8);
|
||||||
|
p2b = B_VAL(ptr2) + ((k * (B_VAL(ptr4) - B_VAL(ptr2))) >> 8);
|
||||||
|
}
|
||||||
|
i = *ix;
|
||||||
|
R_VAL(dst_ptr) = p1r + ((i * (p2r - p1r)) >> 8);
|
||||||
|
G_VAL(dst_ptr) = p1g + ((i * (p2g - p1g)) >> 8);
|
||||||
|
B_VAL(dst_ptr) = p1b + ((i * (p2b - p1b)) >> 8);
|
||||||
|
A_VAL(dst_ptr) = 0xff;
|
||||||
|
|
||||||
|
dst_ptr++; ix++; lp++;
|
||||||
|
}
|
||||||
|
dst_clip_w = w; ix = interp_x; lp = lin_ptr;
|
||||||
|
dptr += dst_w; iy++; rp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
while (dst_clip_h--)
|
while (dst_clip_h--)
|
||||||
{
|
{
|
||||||
lptr1 = *rp;
|
lptr1 = *rp;
|
||||||
|
@ -299,6 +354,7 @@
|
||||||
dptr += dst_w; iy++; rp++;
|
dptr += dst_w; iy++; rp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (src->flags & RGBA_IMAGE_HAS_ALPHA)
|
if (src->flags & RGBA_IMAGE_HAS_ALPHA)
|
||||||
{
|
{
|
||||||
|
@ -417,6 +473,107 @@
|
||||||
int k, px, i;
|
int k, px, i;
|
||||||
DATA32 *lptr1, *lptr2;
|
DATA32 *lptr1, *lptr2;
|
||||||
|
|
||||||
|
#ifdef DIRECT_SCALE
|
||||||
|
if ((!(src->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!(dst->flags & RGBA_IMAGE_HAS_ALPHA)) &&
|
||||||
|
(!dc->mod.use) && (!dc->mul.use))
|
||||||
|
{
|
||||||
|
while (dst_clip_h--)
|
||||||
|
{
|
||||||
|
lptr1 = *rp;
|
||||||
|
lptr2 = lptr1 + src_w;
|
||||||
|
if (lptr2 > src_end) lptr2 = lptr1;
|
||||||
|
k = *iy / 2;
|
||||||
|
dst_ptr = dptr;
|
||||||
|
|
||||||
|
/* mm5 = k */
|
||||||
|
movd_m2r(k, mm5);
|
||||||
|
punpcklwd_r2r(mm5, mm5);
|
||||||
|
punpckldq_r2r(mm5, mm5);
|
||||||
|
|
||||||
|
lp = lin_ptr; ix = interp_x;
|
||||||
|
ptr = lptr1 + *lp;
|
||||||
|
ptr2 = lptr2 + *lp;
|
||||||
|
/* right edge */
|
||||||
|
movd_m2r(*ptr, mm1);
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm7, mm1);
|
||||||
|
|
||||||
|
movd_m2r(*ptr2, mm2);
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm7, mm2);
|
||||||
|
|
||||||
|
psubsw_r2r(mm1, mm2);
|
||||||
|
pmullw_r2r(mm5, mm2);
|
||||||
|
psraw_i2r(7, mm2);
|
||||||
|
|
||||||
|
paddsw_r2r(mm2, mm1);
|
||||||
|
/* mm1 = right edge */
|
||||||
|
|
||||||
|
px = -1;
|
||||||
|
while (dst_clip_w--)
|
||||||
|
{
|
||||||
|
/* if we have a new pair of horizontal pixels to */
|
||||||
|
/* interpolate between them vertically */
|
||||||
|
if (px != *lp)
|
||||||
|
{
|
||||||
|
px = *lp;
|
||||||
|
|
||||||
|
ptr2 = lptr1 + px + 1;
|
||||||
|
ptr4 = lptr2 + px + 1;
|
||||||
|
if (px >= (src_w - 1))
|
||||||
|
{
|
||||||
|
ptr2--;
|
||||||
|
ptr4--;
|
||||||
|
}
|
||||||
|
movq_r2r(mm1, mm0);
|
||||||
|
|
||||||
|
/* right edge */
|
||||||
|
movd_m2r(*ptr2, mm1);
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm7, mm1);
|
||||||
|
|
||||||
|
movd_m2r(*ptr4, mm2);
|
||||||
|
pxor_r2r(mm7, mm7);
|
||||||
|
punpcklbw_r2r(mm7, mm2);
|
||||||
|
|
||||||
|
psubsw_r2r(mm1, mm2);
|
||||||
|
pmullw_r2r(mm5, mm2);
|
||||||
|
psraw_i2r(7, mm2);
|
||||||
|
|
||||||
|
paddsw_r2r(mm2, mm1);
|
||||||
|
/* mm1 = right edge */
|
||||||
|
}
|
||||||
|
|
||||||
|
i = *ix / 2;
|
||||||
|
|
||||||
|
movq_r2r(mm1, mm4);
|
||||||
|
|
||||||
|
movd_m2r(i, mm2);
|
||||||
|
punpcklwd_r2r(mm2, mm2);
|
||||||
|
punpckldq_r2r(mm2, mm2);
|
||||||
|
|
||||||
|
movq_r2r(mm0, mm3);
|
||||||
|
|
||||||
|
psubsw_r2r(mm3, mm4);
|
||||||
|
pmullw_r2r(mm2, mm4);
|
||||||
|
psraw_i2r(7, mm4);
|
||||||
|
paddsw_r2r(mm4, mm3);
|
||||||
|
|
||||||
|
packuswb_r2r(mm3, mm3);
|
||||||
|
/* blend mm3... */
|
||||||
|
movd_r2m(mm3, *dst_ptr);
|
||||||
|
|
||||||
|
dst_ptr++; ix++; lp++;
|
||||||
|
}
|
||||||
|
/* * blend here [clip_w *] buf -> dptr * */
|
||||||
|
dst_clip_w = w; ix = interp_x; lp = lin_ptr;
|
||||||
|
dptr += dst_w; iy++; rp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
while (dst_clip_h--)
|
while (dst_clip_h--)
|
||||||
{
|
{
|
||||||
lptr1 = *rp;
|
lptr1 = *rp;
|
||||||
|
@ -516,6 +673,7 @@
|
||||||
dptr += dst_w; iy++; rp++;
|
dptr += dst_w; iy++; rp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
done_scale_up:
|
done_scale_up:
|
||||||
|
|
|
@ -65,4 +65,6 @@
|
||||||
# define _GNU_SOURCE
|
# define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DIRECT_SCALE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#define EVAS_ENGINE_BUFFER_DEPTH_BGRA32 1
|
#define EVAS_ENGINE_BUFFER_DEPTH_BGRA32 1
|
||||||
#define EVAS_ENGINE_BUFFER_DEPTH_RGB24 2
|
#define EVAS_ENGINE_BUFFER_DEPTH_RGB24 2
|
||||||
#define EVAS_ENGINE_BUFFER_DEPTH_BGR24 3
|
#define EVAS_ENGINE_BUFFER_DEPTH_BGR24 3
|
||||||
|
#define EVAS_ENGINE_BUFFER_DEPTH_RGB32 4
|
||||||
|
|
||||||
typedef struct _Evas_Engine_Info_Buffer Evas_Engine_Info_Buffer;
|
typedef struct _Evas_Engine_Info_Buffer Evas_Engine_Info_Buffer;
|
||||||
|
|
||||||
|
|
|
@ -290,6 +290,8 @@ evas_engine_buffer_output_setup(int w,
|
||||||
|
|
||||||
dep = OUTBUF_DEPTH_BGR_24BPP_888_888;
|
dep = OUTBUF_DEPTH_BGR_24BPP_888_888;
|
||||||
if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_ARGB32)
|
if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_ARGB32)
|
||||||
|
dep = OUTBUF_DEPTH_ARGB_32BPP_8888_8888;
|
||||||
|
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_RGB32)
|
||||||
dep = OUTBUF_DEPTH_RGB_32BPP_888_8888;
|
dep = OUTBUF_DEPTH_RGB_32BPP_888_8888;
|
||||||
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGRA32)
|
else if (depth_type == EVAS_ENGINE_BUFFER_DEPTH_BGRA32)
|
||||||
dep = OUTBUF_DEPTH_BGR_32BPP_888_8888;
|
dep = OUTBUF_DEPTH_BGR_32BPP_888_8888;
|
||||||
|
|
|
@ -8,6 +8,7 @@ typedef enum _Outbuf_Depth Outbuf_Depth;
|
||||||
enum _Outbuf_Depth
|
enum _Outbuf_Depth
|
||||||
{
|
{
|
||||||
OUTBUF_DEPTH_NONE,
|
OUTBUF_DEPTH_NONE,
|
||||||
|
OUTBUF_DEPTH_ARGB_32BPP_8888_8888,
|
||||||
OUTBUF_DEPTH_RGB_32BPP_888_8888,
|
OUTBUF_DEPTH_RGB_32BPP_888_8888,
|
||||||
OUTBUF_DEPTH_BGR_32BPP_888_8888,
|
OUTBUF_DEPTH_BGR_32BPP_888_8888,
|
||||||
OUTBUF_DEPTH_RGB_24BPP_888_888,
|
OUTBUF_DEPTH_RGB_24BPP_888_888,
|
||||||
|
|
|
@ -42,7 +42,7 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
|
||||||
buf->func.new_update_region = new_update_region;
|
buf->func.new_update_region = new_update_region;
|
||||||
buf->func.free_update_region = free_update_region;
|
buf->func.free_update_region = free_update_region;
|
||||||
|
|
||||||
if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) &&
|
if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) &&
|
||||||
(buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
|
(buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
|
||||||
{
|
{
|
||||||
buf->priv.back_buf = evas_common_image_new();
|
buf->priv.back_buf = evas_common_image_new();
|
||||||
|
@ -53,6 +53,16 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
|
||||||
buf->priv.back_buf->image->no_free = 1;
|
buf->priv.back_buf->image->no_free = 1;
|
||||||
buf->priv.back_buf->flags |= RGBA_IMAGE_HAS_ALPHA;
|
buf->priv.back_buf->flags |= RGBA_IMAGE_HAS_ALPHA;
|
||||||
}
|
}
|
||||||
|
else if ((buf->depth == OUTBUF_DEPTH_RGB_32BPP_888_8888) &&
|
||||||
|
(buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
|
||||||
|
{
|
||||||
|
buf->priv.back_buf = evas_common_image_new();
|
||||||
|
buf->priv.back_buf->image = evas_common_image_surface_new(buf->priv.back_buf);
|
||||||
|
buf->priv.back_buf->image->w = w;
|
||||||
|
buf->priv.back_buf->image->h = h;
|
||||||
|
buf->priv.back_buf->image->data = buf->dest;
|
||||||
|
buf->priv.back_buf->image->no_free = 1;
|
||||||
|
}
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -84,11 +94,14 @@ evas_buffer_outbuf_buf_new_region_for_update(Outbuf *buf, int x, int y, int w, i
|
||||||
*cx = 0; *cy = 0; *cw = w; *ch = h;
|
*cx = 0; *cy = 0; *cw = w; *ch = h;
|
||||||
im = evas_common_image_create(w, h);
|
im = evas_common_image_create(w, h);
|
||||||
if (im)
|
if (im)
|
||||||
|
{
|
||||||
|
if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888))
|
||||||
{
|
{
|
||||||
im->flags |= RGBA_IMAGE_HAS_ALPHA;
|
im->flags |= RGBA_IMAGE_HAS_ALPHA;
|
||||||
memset(im->image->data, 0, w * h * sizeof(DATA32));
|
memset(im->image->data, 0, w * h * sizeof(DATA32));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue