diff options
author | fvogel <fvogelnew1@free.fr> | 2023-07-16 13:31:17 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-07-16 13:31:17 (GMT) |
commit | 27f929b144bffb44ff31e2fc34627df4c268f890 (patch) | |
tree | a2ada2a01a00125917187c84b301917fb5753182 /xlib | |
parent | 81da7830cb098eaccd1d444a8bd5defa37a25b84 (diff) | |
download | tk-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |