Attachment "0006-Optimize-XSetClipRectangles.patch" to
ticket [f9eddb54]
added by
chrstphrchvz
2023-07-16 12:04:00.
From 93888b10ab15e88e90fb7ffb3e0f10e98ebd5088 Mon Sep 17 00:00:00 2001
From: Christopher Chavez <[email protected]>
Date: Sun, 16 Jul 2023 00:28:43 -0500
Subject: [PATCH 6/6] Optimize XSetClipRectangles()
---
xlib/xgc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git xlib/xgc.c xlib/xgc.c
index 0562982a5..a4dfd7dc2 100644
--- xlib/xgc.c
+++ xlib/xgc.c
@@ -491,7 +491,7 @@ XSetClipMask(
int
XSetClipRectangles(
- Display *d,
+ TCL_UNUSED(Display *),
GC gc,
int clip_x_origin,
int clip_y_origin,
@@ -500,6 +500,9 @@ XSetClipRectangles(
TCL_UNUSED(int))
{
TkRegion clipRgn = TkCreateRegion();
+ TkpClipMask *clip_mask = AllocClipMask(gc);
+ clip_mask->type = TKP_CLIP_REGION;
+ clip_mask->value.region = clipRgn;
while (n--) {
XRectangle rect = *rectangles;
@@ -509,8 +512,6 @@ XSetClipRectangles(
TkUnionRectWithRegion(&rect, clipRgn, clipRgn);
rectangles++;
}
- TkSetRegion(d, gc, clipRgn);
- TkDestroyRegion(clipRgn);
return 1;
}
--
2.39.2 (Apple Git-144)