diff options
| author | Alexander Gramiak | 2019-05-08 21:40:24 -0600 |
|---|---|---|
| committer | Alexander Gramiak | 2019-05-10 17:26:12 -0600 |
| commit | 6bfc5fc6c4dfbed4b07528b64414fb04675cdf79 (patch) | |
| tree | 5af86da74727a0de4eeb190d634aa7b172d42242 /src/xfont.c | |
| parent | 655634808ad3b324ab844c53006e648b45713364 (diff) | |
| download | emacs-6bfc5fc6c4dfbed4b07528b64414fb04675cdf79.tar.gz emacs-6bfc5fc6c4dfbed4b07528b64414fb04675cdf79.zip | |
Remove display member of glyph_string
This member has little value even on X, and it leaks internal backend
details to the glyph_string struct.
* src/dispextern.h (glyph_string): Remove X display member.
* src/xdisp.c (init_glyph_string): Remove initialization of display.
* src/xfont.c (xfont_draw):
* src/xterm.c: Use FRAME_X_DISPLAY (s->f) instead of display member.
Diffstat (limited to 'src/xfont.c')
| -rw-r--r-- | src/xfont.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/xfont.c b/src/xfont.c index 5ecbd6de33b..ff80df407d7 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -1000,6 +1000,7 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1000 | bool with_background) | 1000 | bool with_background) |
| 1001 | { | 1001 | { |
| 1002 | XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont; | 1002 | XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont; |
| 1003 | Display *display = FRAME_X_DISPLAY (s->f); | ||
| 1003 | int len = to - from; | 1004 | int len = to - from; |
| 1004 | GC gc = s->gc; | 1005 | GC gc = s->gc; |
| 1005 | int i; | 1006 | int i; |
| @@ -1007,7 +1008,7 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1007 | if (s->gc != s->face->gc) | 1008 | if (s->gc != s->face->gc) |
| 1008 | { | 1009 | { |
| 1009 | block_input (); | 1010 | block_input (); |
| 1010 | XSetFont (s->display, gc, xfont->fid); | 1011 | XSetFont (display, gc, xfont->fid); |
| 1011 | unblock_input (); | 1012 | unblock_input (); |
| 1012 | } | 1013 | } |
| 1013 | 1014 | ||
| @@ -1022,20 +1023,20 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1022 | { | 1023 | { |
| 1023 | if (s->padding_p) | 1024 | if (s->padding_p) |
| 1024 | for (i = 0; i < len; i++) | 1025 | for (i = 0; i < len; i++) |
| 1025 | XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1026 | XDrawImageString (display, FRAME_X_DRAWABLE (s->f), |
| 1026 | gc, x + i, y, str + i, 1); | 1027 | gc, x + i, y, str + i, 1); |
| 1027 | else | 1028 | else |
| 1028 | XDrawImageString (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1029 | XDrawImageString (display, FRAME_X_DRAWABLE (s->f), |
| 1029 | gc, x, y, str, len); | 1030 | gc, x, y, str, len); |
| 1030 | } | 1031 | } |
| 1031 | else | 1032 | else |
| 1032 | { | 1033 | { |
| 1033 | if (s->padding_p) | 1034 | if (s->padding_p) |
| 1034 | for (i = 0; i < len; i++) | 1035 | for (i = 0; i < len; i++) |
| 1035 | XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1036 | XDrawString (display, FRAME_X_DRAWABLE (s->f), |
| 1036 | gc, x + i, y, str + i, 1); | 1037 | gc, x + i, y, str + i, 1); |
| 1037 | else | 1038 | else |
| 1038 | XDrawString (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1039 | XDrawString (display, FRAME_X_DRAWABLE (s->f), |
| 1039 | gc, x, y, str, len); | 1040 | gc, x, y, str, len); |
| 1040 | } | 1041 | } |
| 1041 | unblock_input (); | 1042 | unblock_input (); |
| @@ -1048,20 +1049,20 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 1048 | { | 1049 | { |
| 1049 | if (s->padding_p) | 1050 | if (s->padding_p) |
| 1050 | for (i = 0; i < len; i++) | 1051 | for (i = 0; i < len; i++) |
| 1051 | XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1052 | XDrawImageString16 (display, FRAME_X_DRAWABLE (s->f), |
| 1052 | gc, x + i, y, s->char2b + from + i, 1); | 1053 | gc, x + i, y, s->char2b + from + i, 1); |
| 1053 | else | 1054 | else |
| 1054 | XDrawImageString16 (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1055 | XDrawImageString16 (display, FRAME_X_DRAWABLE (s->f), |
| 1055 | gc, x, y, s->char2b + from, len); | 1056 | gc, x, y, s->char2b + from, len); |
| 1056 | } | 1057 | } |
| 1057 | else | 1058 | else |
| 1058 | { | 1059 | { |
| 1059 | if (s->padding_p) | 1060 | if (s->padding_p) |
| 1060 | for (i = 0; i < len; i++) | 1061 | for (i = 0; i < len; i++) |
| 1061 | XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1062 | XDrawString16 (display, FRAME_X_DRAWABLE (s->f), |
| 1062 | gc, x + i, y, s->char2b + from + i, 1); | 1063 | gc, x + i, y, s->char2b + from + i, 1); |
| 1063 | else | 1064 | else |
| 1064 | XDrawString16 (FRAME_X_DISPLAY (s->f), FRAME_X_DRAWABLE (s->f), | 1065 | XDrawString16 (display, FRAME_X_DRAWABLE (s->f), |
| 1065 | gc, x, y, s->char2b + from, len); | 1066 | gc, x, y, s->char2b + from, len); |
| 1066 | } | 1067 | } |
| 1067 | unblock_input (); | 1068 | unblock_input (); |