forked from enlightenment/efl
evas/scale_sample: deduplicate masking code
Summary: these functions provide identical functionality to the inline blocks no functional changes Depends on D8841 Reviewers: Hermet Reviewed By: Hermet Subscribers: Hermet, cedric, #reviewers, #committers Tags: #efl_rendering Differential Revision: https://phab.enlightenment.org/D8846
This commit is contained in:
parent
03fffc3bdc
commit
4542cfcbea
|
@ -403,56 +403,19 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
|
||||||
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
|
row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
|
||||||
+ src_region_y) * src_w);
|
+ src_region_y) * src_w);
|
||||||
|
|
||||||
/* scale to dst */
|
|
||||||
dptr = dst_ptr;
|
|
||||||
|
|
||||||
/* a scanline buffer */
|
|
||||||
buf = alloca(dst_clip_w * sizeof(DATA32));
|
|
||||||
|
|
||||||
/* image masking */
|
|
||||||
if (mask_ie)
|
if (mask_ie)
|
||||||
{
|
_evas_common_scale_rgba_sample_scale_mask(0,
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
|
||||||
{
|
dst_w, mask_x, mask_y,
|
||||||
dst_ptr = buf;
|
row_ptr, lin_ptr,
|
||||||
mask = mask_ie->image.data8
|
mask_ie, dst_ptr,
|
||||||
+ ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w)
|
func, func2, mul_col);
|
||||||
+ (dst_clip_x - mask_x);
|
|
||||||
|
|
||||||
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 * */
|
|
||||||
if (mul_col != 0xffffffff)
|
|
||||||
func2(buf, NULL, mul_col, buf, dst_clip_w);
|
|
||||||
func(buf, mask, 0, dptr, dst_clip_w);
|
|
||||||
|
|
||||||
dptr += dst_w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
_evas_common_scale_rgba_sample_scale_nomask(0,
|
||||||
for (y = 0; y < dst_clip_h; y++)
|
dst_clip_w, dst_clip_h, dst_w,
|
||||||
{
|
row_ptr, lin_ptr,
|
||||||
dst_ptr = buf;
|
dst_ptr,
|
||||||
|
func, mul_col);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue