summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-21 20:23:13 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-05-21 20:26:45 +0200
commit4542cfcbea6f8e2fe53185534cbc9d2be2ca42ee (patch)
treec26c0687ebe0266fe7d45949ed32a257111f1283 /src
parent03fffc3bdce0d16b2b5646aaa3eebf63bca7d70c (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_scale_sample.c59
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
403 row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h) 403 row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
404 + src_region_y) * src_w); 404 + src_region_y) * src_w);
405 405
406 /* scale to dst */
407 dptr = dst_ptr;
408
409 /* a scanline buffer */
410 buf = alloca(dst_clip_w * sizeof(DATA32));
411
412 /* image masking */
413 if (mask_ie) 406 if (mask_ie)
414 { 407 _evas_common_scale_rgba_sample_scale_mask(0,
415 for (y = 0; y < dst_clip_h; y++) 408 dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h,
416 { 409 dst_w, mask_x, mask_y,
417 dst_ptr = buf; 410 row_ptr, lin_ptr,
418 mask = mask_ie->image.data8 411 mask_ie, dst_ptr,
419 + ((dst_clip_y - mask_y + y) * mask_ie->cache_entry.w) 412 func, func2, mul_col);
420 + (dst_clip_x - mask_x);
421
422 for (x = 0; x < dst_clip_w; x++)
423 {
424 ptr = row_ptr[y] + lin_ptr[x];
425 *dst_ptr = *ptr;
426 dst_ptr++;
427 }
428
429 /* * blend here [clip_w *] buf -> dptr * */
430 if (mul_col != 0xffffffff)
431 func2(buf, NULL, mul_col, buf, dst_clip_w);
432 func(buf, mask, 0, dptr, dst_clip_w);
433
434 dptr += dst_w;
435 }
436 }
437 else 413 else
438 { 414 _evas_common_scale_rgba_sample_scale_nomask(0,
439 for (y = 0; y < dst_clip_h; y++) 415 dst_clip_w, dst_clip_h, dst_w,
440 { 416 row_ptr, lin_ptr,
441 dst_ptr = buf; 417 dst_ptr,
442 418 func, mul_col);
443 for (x = 0; x < dst_clip_w; x++)
444 {
445 ptr = row_ptr[y] + lin_ptr[x];
446 *dst_ptr = *ptr;
447 dst_ptr++;
448 }
449
450 /* * blend here [clip_w *] buf -> dptr * */
451 func(buf, NULL, mul_col, dptr, dst_clip_w);
452
453 dptr += dst_w;
454 }
455 }
456 } 419 }
457} 420}
458 421