summaryrefslogtreecommitdiffstats
path: root/xlib
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-16 13:31:17 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-16 13:31:17 (GMT)
commit27f929b144bffb44ff31e2fc34627df4c268f890 (patch)
treea2ada2a01a00125917187c84b301917fb5753182 /xlib
parent81da7830cb098eaccd1d444a8bd5defa37a25b84 (diff)
downloadtk-27f929b144bffb44ff31e2fc34627df4c268f890.zip
tk-27f929b144bffb44ff31e2fc34627df4c268f890.tar.gz
tk-27f929b144bffb44ff31e2fc34627df4c268f890.tar.bz2
Bug [f9eddb541a] (TkSetRegion(), XSetClipRectangles): Patch 6 from Christopher Chavez - Optimize XSetClipRectangles() by letting it set clip_mask->value.region directly, rather than creating a temporary region and relying on TkSetRegion() to copy it.
Diffstat (limited to 'xlib')
-rw-r--r--xlib/xgc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 1a5dd81..d897bed 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -490,7 +490,7 @@ XSetClipMask(
int
XSetClipRectangles(
- Display* d,
+ TCL_UNUSED(Display*),
GC gc,
int clip_x_origin,
int clip_y_origin,
@@ -499,6 +499,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;
@@ -508,8 +511,6 @@ XSetClipRectangles(
TkUnionRectWithRegion(&rect, clipRgn, clipRgn);
rectangles++;
}
- TkSetRegion(d, gc, clipRgn);
- TkDestroyRegion(clipRgn);
return 1;
}