diff options
| author | Jaesup Kwak | 2017-11-24 11:33:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-11-24 11:33:32 +0200 |
| commit | e5dbeb77f4da2fe8b13e13bfe8d5ce4565b83f56 (patch) | |
| tree | 337441c7bce8c77fad23fdbca986521a0c80e010 /src | |
| parent | ed36c71a1e36b919c57cd9f1ab73210e64810fcb (diff) | |
| download | emacs-e5dbeb77f4da2fe8b13e13bfe8d5ce4565b83f56.tar.gz emacs-e5dbeb77f4da2fe8b13e13bfe8d5ce4565b83f56.zip | |
Avoid unnecessary xwidget_view creations
* src/xwidget.c (x_draw_xwidget_glyph_string): Don't create new
xwidget view if we have a usable one already.
Copyright-paperwork-exempt: yes
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwidget.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index a0c9e034775..a67dc0ecf4d 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -585,22 +585,20 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 585 | xwidget on screen. Moving and clipping is done here. Also view | 585 | xwidget on screen. Moving and clipping is done here. Also view |
| 586 | initialization. */ | 586 | initialization. */ |
| 587 | struct xwidget *xww = s->xwidget; | 587 | struct xwidget *xww = s->xwidget; |
| 588 | struct xwidget_view *xv; | 588 | struct xwidget_view *xv = xwidget_view_lookup (xww, s->w); |
| 589 | int clip_right; | 589 | int clip_right; |
| 590 | int clip_bottom; | 590 | int clip_bottom; |
| 591 | int clip_top; | 591 | int clip_top; |
| 592 | int clip_left; | 592 | int clip_left; |
| 593 | 593 | ||
| 594 | /* FIXME: The result of this call is discarded. | ||
| 595 | What if the lookup fails? */ | ||
| 596 | xwidget_view_lookup (xww, s->w); | ||
| 597 | |||
| 598 | int x = s->x; | 594 | int x = s->x; |
| 599 | int y = s->y + (s->height / 2) - (xww->height / 2); | 595 | int y = s->y + (s->height / 2) - (xww->height / 2); |
| 600 | 596 | ||
| 601 | /* Do initialization here in the display loop because there is no | 597 | /* Do initialization here in the display loop because there is no |
| 602 | other time to know things like window placement etc. */ | 598 | other time to know things like window placement etc. Do not |
| 603 | xv = xwidget_init_view (xww, s, x, y); | 599 | create a new view if we have found one that is usable. */ |
| 600 | if (!xv) | ||
| 601 | xv = xwidget_init_view (xww, s, x, y); | ||
| 604 | 602 | ||
| 605 | int text_area_x, text_area_y, text_area_width, text_area_height; | 603 | int text_area_x, text_area_y, text_area_width, text_area_height; |
| 606 | 604 | ||