pixman: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 14 02:43:18 UTC 2024
pixman/pixman-region.c | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 5b8e92813950d2c83c0e3c2c0d1bedf067dba0ea
Author: Marco Trevisan <mail at 3v1n0.net>
Date: Wed May 29 11:50:01 2024 +0000
pixman-region: Make translate a no-op when using 0 offsets
This avoids callers to have to optimize this codepath, in case this scenario happens.
And definitely it may happen when the function is not explicitly called.
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 537d5fb..d75e519 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2229,6 +2229,10 @@ PREFIX (_translate) (region_type_t *region, int x, int y)
box_type_t * pbox;
GOOD (region);
+
+ if (x == 0 && y == 0)
+ return;
+
region->extents.x1 = x1 = region->extents.x1 + x;
region->extents.y1 = y1 = region->extents.y1 + y;
region->extents.x2 = x2 = region->extents.x2 + x;
More information about the xorg-commit
mailing list