aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2006-06-07 06:37:23 +0000
committerKenichi Handa2006-06-07 06:37:23 +0000
commit322f867173440a026fa2147aa8501716ff56bfd4 (patch)
treeaafc3c048b5bd0b9f1f04b0f88f55c102e565832
parent88649c623d4aff55d9dac408b3848af8b1ec40e6 (diff)
downloademacs-322f867173440a026fa2147aa8501716ff56bfd4.tar.gz
emacs-322f867173440a026fa2147aa8501716ff56bfd4.zip
(xftfont_default_fid): Set fid_known to 1.
(struct xftdraw_list, xftdraw_list): Delete them. (register_xftdraw, check_xftdraw): Delete them. (xftfont_prepare_face): Don't call register_xftdraw. (xftfont_done_face): Don't call check_xftdraw. (xftfont_draw): Get backroudn color only when with_background is nonzero.
-rw-r--r--src/xftfont.c53
1 files changed, 2 insertions, 51 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index dd2b95ccd14..f06bf6bd41e 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -147,6 +147,7 @@ xftfont_default_fid (f)
147 if (! fid) 147 if (! fid)
148 abort (); 148 abort ();
149 } 149 }
150 fid_known = 1;
150 } 151 }
151 return fid; 152 return fid;
152} 153}
@@ -336,53 +337,6 @@ xftfont_close (f, font)
336 FRAME_X_DISPLAY_INFO (f)->n_fonts--; 337 FRAME_X_DISPLAY_INFO (f)->n_fonts--;
337} 338}
338 339
339struct xftdraw_list
340{
341 XftDraw *xftdraw;
342 struct xftdraw_list *next;
343};
344
345static struct xftdraw_list *xftdraw_list;
346
347static void
348register_xftdraw (xftdraw)
349 XftDraw *xftdraw;
350{
351 struct xftdraw_list *list = malloc (sizeof (struct xftdraw_list));
352
353 list->xftdraw = xftdraw;
354 list->next = xftdraw_list;
355 xftdraw_list = list;
356}
357
358static void
359check_xftdraw (xftdraw)
360 XftDraw *xftdraw;
361{
362 struct xftdraw_list *list, *prev;
363
364 for (list = xftdraw_list, prev = NULL; list; prev = list, list = list->next)
365 {
366 if (list->xftdraw == xftdraw)
367 {
368 if (! prev)
369 {
370 list = xftdraw_list->next;
371 free (xftdraw_list);
372 xftdraw_list = list;
373 }
374 else
375 {
376 prev->next = list->next;
377 free (list);
378 list = prev;
379 }
380 return;
381 }
382 }
383 abort ();
384}
385
386static int 340static int
387xftfont_prepare_face (f, face) 341xftfont_prepare_face (f, face)
388 FRAME_PTR f; 342 FRAME_PTR f;
@@ -398,8 +352,6 @@ xftfont_prepare_face (f, face)
398 FRAME_X_WINDOW (f), 352 FRAME_X_WINDOW (f),
399 FRAME_X_VISUAL (f), 353 FRAME_X_VISUAL (f),
400 FRAME_X_COLORMAP (f)); 354 FRAME_X_COLORMAP (f));
401 register_xftdraw (xftface_info->xft_draw);
402
403 xftfont_get_colors (f, face, face->gc, NULL, 355 xftfont_get_colors (f, face, face->gc, NULL,
404 &xftface_info->xft_fg, &xftface_info->xft_bg); 356 &xftface_info->xft_fg, &xftface_info->xft_bg);
405 UNBLOCK_INPUT; 357 UNBLOCK_INPUT;
@@ -418,7 +370,6 @@ xftfont_done_face (f, face)
418 if (xftface_info) 370 if (xftface_info)
419 { 371 {
420 BLOCK_INPUT; 372 BLOCK_INPUT;
421 check_xftdraw (xftface_info->xft_draw);
422 XftDrawDestroy (xftface_info->xft_draw); 373 XftDrawDestroy (xftface_info->xft_draw);
423 UNBLOCK_INPUT; 374 UNBLOCK_INPUT;
424 free (xftface_info); 375 free (xftface_info);
@@ -479,7 +430,7 @@ xftfont_draw (s, from, to, x, y, with_background)
479 int i; 430 int i;
480 431
481 xftfont_get_colors (f, face, s->gc, xftface_info, 432 xftfont_get_colors (f, face, s->gc, xftface_info,
482 &fg, s->width ? &bg : NULL); 433 &fg, with_background ? &bg : NULL);
483 BLOCK_INPUT; 434 BLOCK_INPUT;
484 if (s->clip_width) 435 if (s->clip_width)
485 { 436 {