Mercurial > hg > xemacs-beta
comparison src/redisplay-x.c @ 34:d620409f5eb8 r19-15b100
Import from CVS: tag r19-15b100
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:53:20 +0200 |
parents | 0293115a14e9 |
children | 8b8b7f3559a2 |
comparison
equal
deleted
inserted
replaced
33:9ee3cade837d | 34:d620409f5eb8 |
---|---|
1118 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); | 1118 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); |
1119 | 1119 |
1120 GC gc; | 1120 GC gc; |
1121 XGCValues gcv; | 1121 XGCValues gcv; |
1122 unsigned long pixmap_mask; | 1122 unsigned long pixmap_mask; |
1123 int need_clipping = (clip_x || clip_y); | |
1123 | 1124 |
1124 if (!override_gc) | 1125 if (!override_gc) |
1125 { | 1126 { |
1126 memset (&gcv, ~0, sizeof (XGCValues)); | 1127 memset (&gcv, ~0, sizeof (XGCValues)); |
1127 gcv.graphics_exposures = False; | 1128 gcv.graphics_exposures = False; |
1135 gcv.clip_mask = IMAGE_INSTANCE_X_MASK (p); | 1136 gcv.clip_mask = IMAGE_INSTANCE_X_MASK (p); |
1136 gcv.clip_x_origin = x; | 1137 gcv.clip_x_origin = x; |
1137 gcv.clip_y_origin = y - pixmap_offset; | 1138 gcv.clip_y_origin = y - pixmap_offset; |
1138 pixmap_mask |= (GCFunction | GCClipMask | GCClipXOrigin | | 1139 pixmap_mask |= (GCFunction | GCClipMask | GCClipXOrigin | |
1139 GCClipYOrigin); | 1140 GCClipYOrigin); |
1141 /* Can't set a clip rectangle below because we already have a mask. | |
1142 We could conceivably create a new clipmask by zeroing out | |
1143 everything outside the clip region. Is it worth it? | |
1144 Is it possible to get an equivalent effect by changing the | |
1145 args to XCopyArea below rather than messing with a clip box? | |
1146 - dkindred@cs.cmu.edu */ | |
1147 need_clipping = 0; | |
1140 } | 1148 } |
1141 | 1149 |
1142 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, pixmap_mask); | 1150 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, pixmap_mask); |
1143 } | 1151 } |
1144 else | 1152 else |
1145 gc = override_gc; | 1153 { |
1146 | 1154 gc = override_gc; |
1147 if (clip_x || clip_y) | 1155 /* override_gc might have a mask already--we don't want to nuke it. |
1156 Maybe we can insist that override_gc have no mask, or use | |
1157 one of the suggestions above. */ | |
1158 need_clipping = 0; | |
1159 } | |
1160 | |
1161 if (need_clipping) | |
1148 { | 1162 { |
1149 XRectangle clip_box[1]; | 1163 XRectangle clip_box[1]; |
1150 | 1164 |
1151 clip_box[0].x = clip_x; | 1165 clip_box[0].x = clip_x; |
1152 clip_box[0].y = clip_y; | 1166 clip_box[0].y = clip_y; |
1177 ? y - pixmap_offset | 1191 ? y - pixmap_offset |
1178 : y), | 1192 : y), |
1179 1L); | 1193 1L); |
1180 } | 1194 } |
1181 | 1195 |
1182 if (clip_x || clip_y) | 1196 if (need_clipping) |
1183 { | 1197 { |
1184 XSetClipMask (dpy, gc, None); | 1198 XSetClipMask (dpy, gc, None); |
1185 XSetClipOrigin (dpy, gc, 0, 0); | 1199 XSetClipOrigin (dpy, gc, 0, 0); |
1186 } | 1200 } |
1187 } | 1201 } |