diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-05-21 20:23:13 +0200 |
---|---|---|
committer | Xavi Artigas <xavierartigas@yahoo.es> | 2019-05-21 20:26:45 +0200 |
commit | 4542cfcbea6f8e2fe53185534cbc9d2be2ca42ee (patch) | |
tree | c26c0687ebe0266fe7d45949ed32a257111f1283 | |
parent | 03fffc3bdce0d16b2b5646aaa3eebf63bca7d70c (diff) | |
download | efl-4542cfcbea6f8e2fe53185534cbc9d2be2ca42ee.tar.gz |
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
-rw-r--r-- | src/lib/evas/common/evas_scale_sample.c | 59 |
1 files changed, 11 insertions, 48 deletions
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c index d043ba3414..1af814a1f7 100644 --- a/src/lib/evas/common/evas_scale_sample.c +++ b/src/lib/evas/common/evas_scale_sample.c @@ -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) + 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) - { - for (y = 0; y < dst_clip_h; y++) - { - dst_ptr = buf; - mask = mask_ie->image.data8 - + ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w) - + (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; - } - } + _evas_common_scale_rgba_sample_scale_mask(0, + dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h, + dst_w, mask_x, mask_y, + row_ptr, lin_ptr, + mask_ie, dst_ptr, + func, func2, mul_col); else - { - 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; - } - } + _evas_common_scale_rgba_sample_scale_nomask(0, + dst_clip_w, dst_clip_h, dst_w, + row_ptr, lin_ptr, + dst_ptr, + func, mul_col); } } |