summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-11-22 13:43:29 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-11-22 13:43:29 -0800
commit8df6d0dfae8c2f1ef617058217c417357258f04e (patch)
treec6b93e163972219bb40fb69448ec2aae51dcd1f5 /src
parentf84f3672f17f0e52abb894129446d71084b64a0b (diff)
til_fb: remove asserts from til_fb_fragment_copy()
If a caller wants to rely heavily on til_fb_fragment_copy() for clipping, it'll be normal for situations like zero or negative W/H of the clipped area. Those would just be zero copy scenarios, so simply return instead of asserting.
Diffstat (limited to 'src')
-rw-r--r--src/til_fb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/til_fb.h b/src/til_fb.h
index 9daef63..af17025 100644
--- a/src/til_fb.h
+++ b/src/til_fb.h
@@ -142,7 +142,8 @@ static inline void til_fb_fragment_copy(til_fb_fragment_t *dest, uint32_t flags,
int W = MIN(MIN(dest->x + dest->width, src->x + src->width), x + width) - X;
int H = MIN(MIN(dest->y + dest->height, src->y + src->height), y + height) - Y;
- assert(W >= 0 && H >= 0);
+ if (W <= 0 || H <= 0)
+ return;
/* XXX FIXME TODO */
/* XXX FIXME TODO */
© All Rights Reserved