[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android cb4ea3e7fb3 2/2: Update Android port
From: |
Po Lu |
Subject: |
feature/android cb4ea3e7fb3 2/2: Update Android port |
Date: |
Fri, 14 Jul 2023 03:44:07 -0400 (EDT) |
branch: feature/android
commit cb4ea3e7fb36d942dd9d495462fc591f54707b40
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Update Android port
* src/android.c (android_blit_copy): Don't check for overflow
where not required.
---
src/android.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/android.c b/src/android.c
index f8ad78a2b39..acc49219b35 100644
--- a/src/android.c
+++ b/src/android.c
@@ -4382,13 +4382,16 @@ android_blit_copy (int src_x, int src_y, int width, int
height,
overlap. Calculate the coordinate of the last pixel of the
last row in both src and dst. */
- overflow = ckd_mul (&start, src_y + height - 1,
- src_info->stride);
- if (mask) /* If a mask is set, put the pointers before the end
- of the row. */
+ overflow = ckd_mul (&start, src_y + height - 1,
+ src_info->stride);
+
+ if (mask)
+ /* If a mask is set, put the pointers before the end of the
+ row. */
overflow |= ckd_mul (&end, src_x + width - 1, pixel);
else
- overflow |= ckd_mul (&end, src_x, pixel);
+ end = src_x * pixel;
+
overflow |= ckd_add (&start, start, end);
overflow |= ckd_add (&start, (uintptr_t) src, start);
@@ -4397,13 +4400,16 @@ android_blit_copy (int src_x, int src_y, int width, int
height,
src_current = (unsigned char *) start;
- overflow = ckd_mul (&start, dst_y + height - 1,
- dst_info->stride);
- if (mask) /* If a mask is set, put the pointers before the end
- of the row. */
+ overflow = ckd_mul (&start, dst_y + height - 1,
+ dst_info->stride);
+
+ if (mask)
+ /* If a mask is set, put the pointers before the end of the
+ row. */
overflow |= ckd_mul (&end, dst_x + width - 1, pixel);
else
- overflow |= ckd_mul (&end, dst_x, pixel);
+ end = dst_x * pixel;
+
overflow |= ckd_add (&start, start, end);
overflow |= ckd_add (&start, (uintptr_t) dst, start);