diff options
| author | Joakim Verona | 2013-08-23 05:16:38 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-08-23 05:16:38 +0200 |
| commit | 9d72cbde8b1a6b9b391a1966fe54def9b56c9746 (patch) | |
| tree | 2502c9e0c691cba14202a39f06a2e7916b204390 /src | |
| parent | fffcc46aabbe28b6f2ef8427f858abe58d3b615e (diff) | |
| parent | 7f780da621d462afa3c6e0374590a86de513f863 (diff) | |
| download | emacs-9d72cbde8b1a6b9b391a1966fe54def9b56c9746.tar.gz emacs-9d72cbde8b1a6b9b391a1966fe54def9b56c9746.zip | |
merge from trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/dispextern.h | 25 | ||||
| -rw-r--r-- | src/dispnew.c | 58 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
4 files changed, 59 insertions, 55 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ebd41a61203..aadaae24e98 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Redesign redisplay interface to drop updated_row and updated_area. | ||
| 4 | * dispextern.h (updated_row, updated_area): Remove declaration. | ||
| 5 | (struct redisplay_interface): Pass glyph row and row area parameters | ||
| 6 | to write_glyphs, insert_glyphs and clear_end_of_line functions. | ||
| 7 | (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line): | ||
| 8 | Adjust prototypes. | ||
| 9 | * dispnew.c (updated_row, updated_area): Remove. | ||
| 10 | (redraw_overlapped_rows, update_window_line): Adjust user. | ||
| 11 | (update_marginal_area, update_text_area): Likewise. Pass updated row | ||
| 12 | as a parameter. Prefer enum glyph_row_area to int where appropriate. | ||
| 13 | * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line): | ||
| 14 | Adjust users. | ||
| 15 | |||
| 1 | 2013-08-22 Paul Eggert <eggert@cs.ucla.edu> | 16 | 2013-08-22 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 17 | ||
| 3 | * process.c (flush_pending_output): Remove stub. | 18 | * process.c (flush_pending_output): Remove stub. |
diff --git a/src/dispextern.h b/src/dispextern.h index 6a34bc81c6a..7123587c596 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1204,11 +1204,6 @@ extern bool fonts_changed_p; | |||
| 1204 | 1204 | ||
| 1205 | extern struct glyph space_glyph; | 1205 | extern struct glyph space_glyph; |
| 1206 | 1206 | ||
| 1207 | /* Glyph row and area updated by update_window_line. */ | ||
| 1208 | |||
| 1209 | extern struct glyph_row *updated_row; | ||
| 1210 | extern int updated_area; | ||
| 1211 | |||
| 1212 | /* Non-zero means last display completed. Zero means it was | 1207 | /* Non-zero means last display completed. Zero means it was |
| 1213 | preempted. */ | 1208 | preempted. */ |
| 1214 | 1209 | ||
| @@ -2741,12 +2736,17 @@ struct redisplay_interface | |||
| 2741 | 2736 | ||
| 2742 | /* Write or insert LEN glyphs from STRING at the nominal output | 2737 | /* Write or insert LEN glyphs from STRING at the nominal output |
| 2743 | position. */ | 2738 | position. */ |
| 2744 | void (*write_glyphs) (struct window *w, struct glyph *string, int len); | 2739 | void (*write_glyphs) (struct window *w, struct glyph_row *row, |
| 2745 | void (*insert_glyphs) (struct window *w, struct glyph *start, int len); | 2740 | struct glyph *string, enum glyph_row_area area, |
| 2741 | int len); | ||
| 2742 | void (*insert_glyphs) (struct window *w, struct glyph_row *row, | ||
| 2743 | struct glyph *start, enum glyph_row_area area, | ||
| 2744 | int len); | ||
| 2746 | 2745 | ||
| 2747 | /* Clear from nominal output position to X. X < 0 means clear | 2746 | /* Clear from nominal output position to X. X < 0 means clear |
| 2748 | to right end of display. */ | 2747 | to right end of display. */ |
| 2749 | void (*clear_end_of_line) (struct window *w, int x); | 2748 | void (*clear_end_of_line) (struct window *w, struct glyph_row *row, |
| 2749 | enum glyph_row_area area, int x); | ||
| 2750 | 2750 | ||
| 2751 | /* Function to call to scroll the display as described by RUN on | 2751 | /* Function to call to scroll the display as described by RUN on |
| 2752 | window W. */ | 2752 | window W. */ |
| @@ -3206,9 +3206,12 @@ extern void x_get_glyph_overhangs (struct glyph *, struct frame *, | |||
| 3206 | int *, int *); | 3206 | int *, int *); |
| 3207 | extern void x_produce_glyphs (struct it *); | 3207 | extern void x_produce_glyphs (struct it *); |
| 3208 | 3208 | ||
| 3209 | extern void x_write_glyphs (struct window *, struct glyph *, int); | 3209 | extern void x_write_glyphs (struct window *, struct glyph_row *, |
| 3210 | extern void x_insert_glyphs (struct window *, struct glyph *, int len); | 3210 | struct glyph *, enum glyph_row_area, int); |
| 3211 | extern void x_clear_end_of_line (struct window *, int); | 3211 | extern void x_insert_glyphs (struct window *, struct glyph_row *, |
| 3212 | struct glyph *, enum glyph_row_area, int); | ||
| 3213 | extern void x_clear_end_of_line (struct window *, struct glyph_row *, | ||
| 3214 | enum glyph_row_area, int); | ||
| 3212 | 3215 | ||
| 3213 | extern struct cursor_pos output_cursor; | 3216 | extern struct cursor_pos output_cursor; |
| 3214 | 3217 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index 54d7a7461a0..be518b18706 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -138,11 +138,6 @@ struct frame *last_nonminibuf_frame; | |||
| 138 | 138 | ||
| 139 | static bool delayed_size_change; | 139 | static bool delayed_size_change; |
| 140 | 140 | ||
| 141 | /* Glyph row updated in update_window_line, and area that is updated. */ | ||
| 142 | |||
| 143 | struct glyph_row *updated_row; | ||
| 144 | int updated_area; | ||
| 145 | |||
| 146 | /* A glyph for a space. */ | 141 | /* A glyph for a space. */ |
| 147 | 142 | ||
| 148 | struct glyph space_glyph; | 143 | struct glyph space_glyph; |
| @@ -3232,14 +3227,12 @@ redraw_overlapped_rows (struct window *w, int yb) | |||
| 3232 | 3227 | ||
| 3233 | for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) | 3228 | for (area = LEFT_MARGIN_AREA; area < LAST_AREA; ++area) |
| 3234 | { | 3229 | { |
| 3235 | updated_row = row; | ||
| 3236 | updated_area = area; | ||
| 3237 | FRAME_RIF (f)->cursor_to (w, i, 0, row->y, | 3230 | FRAME_RIF (f)->cursor_to (w, i, 0, row->y, |
| 3238 | area == TEXT_AREA ? row->x : 0); | 3231 | area == TEXT_AREA ? row->x : 0); |
| 3239 | if (row->used[area]) | 3232 | if (row->used[area]) |
| 3240 | FRAME_RIF (f)->write_glyphs (w, row->glyphs[area], | 3233 | FRAME_RIF (f)->write_glyphs (w, row, row->glyphs[area], |
| 3241 | row->used[area]); | 3234 | area, row->used[area]); |
| 3242 | FRAME_RIF (f)->clear_end_of_line (w, -1); | 3235 | FRAME_RIF (f)->clear_end_of_line (w, row, area, -1); |
| 3243 | } | 3236 | } |
| 3244 | 3237 | ||
| 3245 | row->overlapped_p = 0; | 3238 | row->overlapped_p = 0; |
| @@ -3516,22 +3509,20 @@ update_window (struct window *w, bool force_p) | |||
| 3516 | AREA can be either LEFT_MARGIN_AREA or RIGHT_MARGIN_AREA. */ | 3509 | AREA can be either LEFT_MARGIN_AREA or RIGHT_MARGIN_AREA. */ |
| 3517 | 3510 | ||
| 3518 | static void | 3511 | static void |
| 3519 | update_marginal_area (struct window *w, int area, int vpos) | 3512 | update_marginal_area (struct window *w, struct glyph_row *updated_row, |
| 3513 | enum glyph_row_area area, int vpos) | ||
| 3520 | { | 3514 | { |
| 3521 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); | 3515 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); |
| 3522 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3516 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3523 | 3517 | ||
| 3524 | /* Let functions in xterm.c know what area subsequent X positions | ||
| 3525 | will be relative to. */ | ||
| 3526 | updated_area = area; | ||
| 3527 | |||
| 3528 | /* Set cursor to start of glyphs, write them, and clear to the end | 3518 | /* Set cursor to start of glyphs, write them, and clear to the end |
| 3529 | of the area. I don't think that something more sophisticated is | 3519 | of the area. I don't think that something more sophisticated is |
| 3530 | necessary here, since marginal areas will not be the default. */ | 3520 | necessary here, since marginal areas will not be the default. */ |
| 3531 | rif->cursor_to (w, vpos, 0, desired_row->y, 0); | 3521 | rif->cursor_to (w, vpos, 0, desired_row->y, 0); |
| 3532 | if (desired_row->used[area]) | 3522 | if (desired_row->used[area]) |
| 3533 | rif->write_glyphs (w, desired_row->glyphs[area], desired_row->used[area]); | 3523 | rif->write_glyphs (w, updated_row, desired_row->glyphs[area], |
| 3534 | rif->clear_end_of_line (w, -1); | 3524 | area, desired_row->used[area]); |
| 3525 | rif->clear_end_of_line (w, updated_row, area, -1); | ||
| 3535 | } | 3526 | } |
| 3536 | 3527 | ||
| 3537 | 3528 | ||
| @@ -3539,17 +3530,13 @@ update_marginal_area (struct window *w, int area, int vpos) | |||
| 3539 | Value is true if display has changed. */ | 3530 | Value is true if display has changed. */ |
| 3540 | 3531 | ||
| 3541 | static bool | 3532 | static bool |
| 3542 | update_text_area (struct window *w, int vpos) | 3533 | update_text_area (struct window *w, struct glyph_row *updated_row, int vpos) |
| 3543 | { | 3534 | { |
| 3544 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); | 3535 | struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos); |
| 3545 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); | 3536 | struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos); |
| 3546 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3537 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3547 | bool changed_p = 0; | 3538 | bool changed_p = 0; |
| 3548 | 3539 | ||
| 3549 | /* Let functions in xterm.c know what area subsequent X positions | ||
| 3550 | will be relative to. */ | ||
| 3551 | updated_area = TEXT_AREA; | ||
| 3552 | |||
| 3553 | /* If rows are at different X or Y, or rows have different height, | 3540 | /* If rows are at different X or Y, or rows have different height, |
| 3554 | or the current row is marked invalid, write the entire line. */ | 3541 | or the current row is marked invalid, write the entire line. */ |
| 3555 | if (!current_row->enabled_p | 3542 | if (!current_row->enabled_p |
| @@ -3572,11 +3559,11 @@ update_text_area (struct window *w, int vpos) | |||
| 3572 | rif->cursor_to (w, vpos, 0, desired_row->y, desired_row->x); | 3559 | rif->cursor_to (w, vpos, 0, desired_row->y, desired_row->x); |
| 3573 | 3560 | ||
| 3574 | if (desired_row->used[TEXT_AREA]) | 3561 | if (desired_row->used[TEXT_AREA]) |
| 3575 | rif->write_glyphs (w, desired_row->glyphs[TEXT_AREA], | 3562 | rif->write_glyphs (w, updated_row, desired_row->glyphs[TEXT_AREA], |
| 3576 | desired_row->used[TEXT_AREA]); | 3563 | TEXT_AREA, desired_row->used[TEXT_AREA]); |
| 3577 | 3564 | ||
| 3578 | /* Clear to end of window. */ | 3565 | /* Clear to end of window. */ |
| 3579 | rif->clear_end_of_line (w, -1); | 3566 | rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1); |
| 3580 | changed_p = 1; | 3567 | changed_p = 1; |
| 3581 | 3568 | ||
| 3582 | /* This erases the cursor. We do this here because | 3569 | /* This erases the cursor. We do this here because |
| @@ -3713,7 +3700,8 @@ update_text_area (struct window *w, int vpos) | |||
| 3713 | } | 3700 | } |
| 3714 | 3701 | ||
| 3715 | rif->cursor_to (w, vpos, start_hpos, desired_row->y, start_x); | 3702 | rif->cursor_to (w, vpos, start_hpos, desired_row->y, start_x); |
| 3716 | rif->write_glyphs (w, start, i - start_hpos); | 3703 | rif->write_glyphs (w, updated_row, start, |
| 3704 | TEXT_AREA, i - start_hpos); | ||
| 3717 | changed_p = 1; | 3705 | changed_p = 1; |
| 3718 | } | 3706 | } |
| 3719 | } | 3707 | } |
| @@ -3722,7 +3710,8 @@ update_text_area (struct window *w, int vpos) | |||
| 3722 | if (i < desired_row->used[TEXT_AREA]) | 3710 | if (i < desired_row->used[TEXT_AREA]) |
| 3723 | { | 3711 | { |
| 3724 | rif->cursor_to (w, vpos, i, desired_row->y, x); | 3712 | rif->cursor_to (w, vpos, i, desired_row->y, x); |
| 3725 | rif->write_glyphs (w, desired_glyph, desired_row->used[TEXT_AREA] - i); | 3713 | rif->write_glyphs (w, updated_row, desired_glyph, |
| 3714 | TEXT_AREA, desired_row->used[TEXT_AREA] - i); | ||
| 3726 | changed_p = 1; | 3715 | changed_p = 1; |
| 3727 | } | 3716 | } |
| 3728 | 3717 | ||
| @@ -3744,7 +3733,7 @@ update_text_area (struct window *w, int vpos) | |||
| 3744 | if (i >= desired_row->used[TEXT_AREA]) | 3733 | if (i >= desired_row->used[TEXT_AREA]) |
| 3745 | rif->cursor_to (w, vpos, i, desired_row->y, | 3734 | rif->cursor_to (w, vpos, i, desired_row->y, |
| 3746 | desired_row->pixel_width); | 3735 | desired_row->pixel_width); |
| 3747 | rif->clear_end_of_line (w, -1); | 3736 | rif->clear_end_of_line (w, updated_row, TEXT_AREA, -1); |
| 3748 | changed_p = 1; | 3737 | changed_p = 1; |
| 3749 | } | 3738 | } |
| 3750 | else if (desired_row->pixel_width < current_row->pixel_width) | 3739 | else if (desired_row->pixel_width < current_row->pixel_width) |
| @@ -3772,7 +3761,7 @@ update_text_area (struct window *w, int vpos) | |||
| 3772 | } | 3761 | } |
| 3773 | else | 3762 | else |
| 3774 | xlim = current_row->pixel_width; | 3763 | xlim = current_row->pixel_width; |
| 3775 | rif->clear_end_of_line (w, xlim); | 3764 | rif->clear_end_of_line (w, updated_row, TEXT_AREA, xlim); |
| 3776 | changed_p = 1; | 3765 | changed_p = 1; |
| 3777 | } | 3766 | } |
| 3778 | } | 3767 | } |
| @@ -3791,10 +3780,6 @@ update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) | |||
| 3791 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3780 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3792 | bool changed_p = 0; | 3781 | bool changed_p = 0; |
| 3793 | 3782 | ||
| 3794 | /* Set the row being updated. This is important to let xterm.c | ||
| 3795 | know what line height values are in effect. */ | ||
| 3796 | updated_row = desired_row; | ||
| 3797 | |||
| 3798 | /* A row can be completely invisible in case a desired matrix was | 3783 | /* A row can be completely invisible in case a desired matrix was |
| 3799 | built with a vscroll and then make_cursor_line_fully_visible shifts | 3784 | built with a vscroll and then make_cursor_line_fully_visible shifts |
| 3800 | the matrix. Make sure to make such rows current anyway, since | 3785 | the matrix. Make sure to make such rows current anyway, since |
| @@ -3808,7 +3793,7 @@ update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) | |||
| 3808 | if (!desired_row->full_width_p && w->left_margin_cols > 0) | 3793 | if (!desired_row->full_width_p && w->left_margin_cols > 0) |
| 3809 | { | 3794 | { |
| 3810 | changed_p = 1; | 3795 | changed_p = 1; |
| 3811 | update_marginal_area (w, LEFT_MARGIN_AREA, vpos); | 3796 | update_marginal_area (w, desired_row, LEFT_MARGIN_AREA, vpos); |
| 3812 | /* Setting this flag will ensure the vertical border, if | 3797 | /* Setting this flag will ensure the vertical border, if |
| 3813 | any, between this window and the one on its left will be | 3798 | any, between this window and the one on its left will be |
| 3814 | redrawn. This is necessary because updating the left | 3799 | redrawn. This is necessary because updating the left |
| @@ -3817,7 +3802,7 @@ update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) | |||
| 3817 | } | 3802 | } |
| 3818 | 3803 | ||
| 3819 | /* Update the display of the text area. */ | 3804 | /* Update the display of the text area. */ |
| 3820 | if (update_text_area (w, vpos)) | 3805 | if (update_text_area (w, desired_row, vpos)) |
| 3821 | { | 3806 | { |
| 3822 | changed_p = 1; | 3807 | changed_p = 1; |
| 3823 | if (current_row->mouse_face_p) | 3808 | if (current_row->mouse_face_p) |
| @@ -3828,7 +3813,7 @@ update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) | |||
| 3828 | if (!desired_row->full_width_p && w->right_margin_cols > 0) | 3813 | if (!desired_row->full_width_p && w->right_margin_cols > 0) |
| 3829 | { | 3814 | { |
| 3830 | changed_p = 1; | 3815 | changed_p = 1; |
| 3831 | update_marginal_area (w, RIGHT_MARGIN_AREA, vpos); | 3816 | update_marginal_area (w, desired_row, RIGHT_MARGIN_AREA, vpos); |
| 3832 | } | 3817 | } |
| 3833 | 3818 | ||
| 3834 | /* Draw truncation marks etc. */ | 3819 | /* Draw truncation marks etc. */ |
| @@ -3847,7 +3832,6 @@ update_window_line (struct window *w, int vpos, bool *mouse_face_overwritten_p) | |||
| 3847 | 3832 | ||
| 3848 | /* Update current_row from desired_row. */ | 3833 | /* Update current_row from desired_row. */ |
| 3849 | make_current (w->desired_matrix, w->current_matrix, vpos); | 3834 | make_current (w->desired_matrix, w->current_matrix, vpos); |
| 3850 | updated_row = NULL; | ||
| 3851 | return changed_p; | 3835 | return changed_p; |
| 3852 | } | 3836 | } |
| 3853 | 3837 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 5faa2abd72a..3439ce617c4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -26010,12 +26010,12 @@ x_produce_glyphs (struct it *it) | |||
| 26010 | 26010 | ||
| 26011 | /* EXPORT for RIF: | 26011 | /* EXPORT for RIF: |
| 26012 | Output LEN glyphs starting at START at the nominal cursor position. | 26012 | Output LEN glyphs starting at START at the nominal cursor position. |
| 26013 | Advance the nominal cursor over the text. The global variable | 26013 | Advance the nominal cursor over the text. UPDATED_ROW is the glyph row |
| 26014 | updated_row is the glyph row being updated, and updated_area is the | 26014 | being updated, and UPDATED_AREA is the area of that row being updated. */ |
| 26015 | area of that row being updated. */ | ||
| 26016 | 26015 | ||
| 26017 | void | 26016 | void |
| 26018 | x_write_glyphs (struct window *w, struct glyph *start, int len) | 26017 | x_write_glyphs (struct window *w, struct glyph_row *updated_row, |
| 26018 | struct glyph *start, enum glyph_row_area updated_area, int len) | ||
| 26019 | { | 26019 | { |
| 26020 | int x, hpos, chpos = w->phys_cursor.hpos; | 26020 | int x, hpos, chpos = w->phys_cursor.hpos; |
| 26021 | 26021 | ||
| @@ -26058,7 +26058,8 @@ x_write_glyphs (struct window *w, struct glyph *start, int len) | |||
| 26058 | Insert LEN glyphs from START at the nominal cursor position. */ | 26058 | Insert LEN glyphs from START at the nominal cursor position. */ |
| 26059 | 26059 | ||
| 26060 | void | 26060 | void |
| 26061 | x_insert_glyphs (struct window *w, struct glyph *start, int len) | 26061 | x_insert_glyphs (struct window *w, struct glyph_row *updated_row, |
| 26062 | struct glyph *start, enum glyph_row_area updated_area, int len) | ||
| 26062 | { | 26063 | { |
| 26063 | struct frame *f; | 26064 | struct frame *f; |
| 26064 | int line_height, shift_by_width, shifted_region_width; | 26065 | int line_height, shift_by_width, shifted_region_width; |
| @@ -26110,11 +26111,12 @@ x_insert_glyphs (struct window *w, struct glyph *start, int len) | |||
| 26110 | (inclusive) to pixel column TO_X (exclusive). The idea is that | 26111 | (inclusive) to pixel column TO_X (exclusive). The idea is that |
| 26111 | everything from TO_X onward is already erased. | 26112 | everything from TO_X onward is already erased. |
| 26112 | 26113 | ||
| 26113 | TO_X is a pixel position relative to updated_area of currently | 26114 | TO_X is a pixel position relative to UPDATED_AREA of currently |
| 26114 | updated window W. TO_X == -1 means clear to the end of this area. */ | 26115 | updated window W. TO_X == -1 means clear to the end of this area. */ |
| 26115 | 26116 | ||
| 26116 | void | 26117 | void |
| 26117 | x_clear_end_of_line (struct window *w, int to_x) | 26118 | x_clear_end_of_line (struct window *w, struct glyph_row *updated_row, |
| 26119 | enum glyph_row_area updated_area, int to_x) | ||
| 26118 | { | 26120 | { |
| 26119 | struct frame *f; | 26121 | struct frame *f; |
| 26120 | int max_x, min_y, max_y; | 26122 | int max_x, min_y, max_y; |