aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.c
diff options
context:
space:
mode:
authorPo Lu2023-07-14 15:35:58 +0800
committerPo Lu2023-07-14 15:35:58 +0800
commitcb4ea3e7fb36d942dd9d495462fc591f54707b40 (patch)
tree1a63bc499aa09d8c6369b2ec2df3075189018936 /src/android.c
parent4f95ab3837d5ccd75a934148b3ea767791438934 (diff)
downloademacs-cb4ea3e7fb36d942dd9d495462fc591f54707b40.tar.gz
emacs-cb4ea3e7fb36d942dd9d495462fc591f54707b40.zip
Update Android port
* src/android.c (android_blit_copy): Don't check for overflow where not required.
Diffstat (limited to 'src/android.c')
-rw-r--r--src/android.c26
1 files 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,
4382 overlap. Calculate the coordinate of the last pixel of the 4382 overlap. Calculate the coordinate of the last pixel of the
4383 last row in both src and dst. */ 4383 last row in both src and dst. */
4384 4384
4385 overflow = ckd_mul (&start, src_y + height - 1, 4385 overflow = ckd_mul (&start, src_y + height - 1,
4386 src_info->stride); 4386 src_info->stride);
4387 if (mask) /* If a mask is set, put the pointers before the end 4387
4388 of the row. */ 4388 if (mask)
4389 /* If a mask is set, put the pointers before the end of the
4390 row. */
4389 overflow |= ckd_mul (&end, src_x + width - 1, pixel); 4391 overflow |= ckd_mul (&end, src_x + width - 1, pixel);
4390 else 4392 else
4391 overflow |= ckd_mul (&end, src_x, pixel); 4393 end = src_x * pixel;
4394
4392 overflow |= ckd_add (&start, start, end); 4395 overflow |= ckd_add (&start, start, end);
4393 overflow |= ckd_add (&start, (uintptr_t) src, start); 4396 overflow |= ckd_add (&start, (uintptr_t) src, start);
4394 4397
@@ -4397,13 +4400,16 @@ android_blit_copy (int src_x, int src_y, int width, int height,
4397 4400
4398 src_current = (unsigned char *) start; 4401 src_current = (unsigned char *) start;
4399 4402
4400 overflow = ckd_mul (&start, dst_y + height - 1, 4403 overflow = ckd_mul (&start, dst_y + height - 1,
4401 dst_info->stride); 4404 dst_info->stride);
4402 if (mask) /* If a mask is set, put the pointers before the end 4405
4403 of the row. */ 4406 if (mask)
4407 /* If a mask is set, put the pointers before the end of the
4408 row. */
4404 overflow |= ckd_mul (&end, dst_x + width - 1, pixel); 4409 overflow |= ckd_mul (&end, dst_x + width - 1, pixel);
4405 else 4410 else
4406 overflow |= ckd_mul (&end, dst_x, pixel); 4411 end = dst_x * pixel;
4412
4407 overflow |= ckd_add (&start, start, end); 4413 overflow |= ckd_add (&start, start, end);
4408 overflow |= ckd_add (&start, (uintptr_t) dst, start); 4414 overflow |= ckd_add (&start, (uintptr_t) dst, start);
4409 4415