Merge from emacs-23; up to 2010-06-12T08:59:37Z!albinus@detlef.

This commit is contained in:
Glenn Morris 2011-05-24 20:45:04 -07:00
commit b9345dfd4b
5 changed files with 77 additions and 27 deletions

View file

@ -1,3 +1,25 @@
2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
* dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
for fringe update if it has periodic bitmap.
(row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
and fringe_bitmap_periodic_p.
* fringe.c (get_fringe_bitmap_data): New function.
(draw_fringe_bitmap_1, update_window_fringes): Use it.
(update_window_fringes): Record periodicity of fringe bitmap in glyph
row. Mark glyph row for fringe update if periodicity changed.
* xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
for fringe update unless it has periodic bitmap.
2011-05-25 Kenichi Handa <handa@m17n.org>
* xdisp.c (get_next_display_element): Set correct it->face_id for
a static composition.
2011-05-24 Leo Liu <sdl.web@gmail.com>
* deps.mk (fns.o):

View file

@ -845,6 +845,10 @@ struct glyph_row
/* Vertical offset of the right fringe bitmap. */
signed right_fringe_offset : FRINGE_HEIGHT_BITS;
/* 1 means that at least one of the left and right fringe bitmaps is
periodic and thus depends on the y-position of the row. */
unsigned fringe_bitmap_periodic_p : 1;
/* 1 means that we must draw the bitmaps of this row. */
unsigned redraw_fringe_bitmaps_p : 1;

View file

@ -861,6 +861,8 @@ shift_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int start, in
row->visible_height -= min_y - row->y;
if (row->y + row->height > max_y)
row->visible_height -= row->y + row->height - max_y;
if (row->fringe_bitmap_periodic_p)
row->redraw_fringe_bitmaps_p = 1;
}
}
@ -1339,8 +1341,11 @@ row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p)
|| a->cursor_in_fringe_p != b->cursor_in_fringe_p
|| a->left_fringe_bitmap != b->left_fringe_bitmap
|| a->left_fringe_face_id != b->left_fringe_face_id
|| a->left_fringe_offset != b->left_fringe_offset
|| a->right_fringe_bitmap != b->right_fringe_bitmap
|| a->right_fringe_face_id != b->right_fringe_face_id
|| a->right_fringe_offset != b->right_fringe_offset
|| a->fringe_bitmap_periodic_p != b->fringe_bitmap_periodic_p
|| a->overlay_arrow_bitmap != b->overlay_arrow_bitmap
|| a->exact_window_width_line_p != b->exact_window_width_line_p
|| a->overlapped_p != b->overlapped_p
@ -4565,13 +4570,7 @@ scrolling_window (struct window *w, int header_line_p)
to = MATRIX_ROW (current_matrix, r->desired_vpos + j);
from = MATRIX_ROW (desired_matrix, r->desired_vpos + j);
to_overlapped_p = to->overlapped_p;
if (!from->mode_line_p && !w->pseudo_window_p
&& (to->left_fringe_bitmap != from->left_fringe_bitmap
|| to->right_fringe_bitmap != from->right_fringe_bitmap
|| to->left_fringe_face_id != from->left_fringe_face_id
|| to->right_fringe_face_id != from->right_fringe_face_id
|| to->overlay_arrow_bitmap != from->overlay_arrow_bitmap))
from->redraw_fringe_bitmaps_p = 1;
from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p;
assign_row (to, from);
to->enabled_p = 1, from->enabled_p = 0;
to->overlapped_p = to_overlapped_p;

View file

@ -521,6 +521,20 @@ get_fringe_bitmap_name (int bn)
return num;
}
/* Get fringe bitmap data for bitmap number BN. */
static struct fringe_bitmap *
get_fringe_bitmap_data (int bn)
{
struct fringe_bitmap *fb;
fb = fringe_bitmaps[bn];
if (fb == NULL)
fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
? bn : UNDEF_FRINGE_BITMAP];
return fb;
}
/* Draw the bitmap WHICH in one of the left or right fringes of
window W. ROW is the glyph row for which to display the bitmap; it
@ -568,10 +582,7 @@ draw_fringe_bitmap_1 (struct window *w, struct glyph_row *row, int left_p, int o
face_id = FRINGE_FACE_ID;
}
fb = fringe_bitmaps[which];
if (fb == NULL)
fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS
? which : UNDEF_FRINGE_BITMAP];
fb = get_fringe_bitmap_data (which);
period = fb->period;
@ -1041,12 +1052,8 @@ update_window_fringes (struct window *w, int keep_current_p)
if (bn != NO_FRINGE_BITMAP)
{
struct fringe_bitmap *fb;
struct fringe_bitmap *fb = get_fringe_bitmap_data (bn);
fb = fringe_bitmaps[bn];
if (fb == NULL)
fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
? bn : UNDEF_FRINGE_BITMAP];
if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0)
{
struct glyph_row *row1;
@ -1100,12 +1107,8 @@ update_window_fringes (struct window *w, int keep_current_p)
if (bn != NO_FRINGE_BITMAP)
{
struct fringe_bitmap *fb;
struct fringe_bitmap *fb = get_fringe_bitmap_data (bn);
fb = fringe_bitmaps[bn];
if (fb == NULL)
fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS
? bn : UNDEF_FRINGE_BITMAP];
if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0)
{
struct glyph_row *row1;
@ -1141,6 +1144,7 @@ update_window_fringes (struct window *w, int keep_current_p)
int left, right;
unsigned left_face_id, right_face_id;
int left_offset, right_offset;
int periodic_p;
row = w->desired_matrix->rows + rn;
cur = w->current_matrix->rows + rn;
@ -1149,6 +1153,7 @@ update_window_fringes (struct window *w, int keep_current_p)
left_face_id = right_face_id = DEFAULT_FACE_ID;
left_offset = right_offset = 0;
periodic_p = 0;
/* Decide which bitmap to draw in the left fringe. */
if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
@ -1240,6 +1245,9 @@ update_window_fringes (struct window *w, int keep_current_p)
else
right = NO_FRINGE_BITMAP;
periodic_p = (get_fringe_bitmap_data (left)->period != 0
|| get_fringe_bitmap_data (right)->period != 0);
if (row->y != cur->y
|| row->visible_height != cur->visible_height
|| row->ends_at_zv_p != cur->ends_at_zv_p
@ -1249,6 +1257,7 @@ update_window_fringes (struct window *w, int keep_current_p)
|| right_face_id != cur->right_fringe_face_id
|| left_offset != cur->left_fringe_offset
|| right_offset != cur->right_fringe_offset
|| periodic_p != cur->fringe_bitmap_periodic_p
|| cur->redraw_fringe_bitmaps_p)
{
redraw_p = row->redraw_fringe_bitmaps_p = 1;
@ -1261,6 +1270,7 @@ update_window_fringes (struct window *w, int keep_current_p)
cur->right_fringe_face_id = right_face_id;
cur->left_fringe_offset = left_offset;
cur->right_fringe_offset = right_offset;
cur->fringe_bitmap_periodic_p = periodic_p;
}
}
@ -1279,6 +1289,7 @@ update_window_fringes (struct window *w, int keep_current_p)
row->right_fringe_face_id = right_face_id;
row->left_fringe_offset = left_offset;
row->right_fringe_offset = right_offset;
row->fringe_bitmap_periodic_p = periodic_p;
}
return redraw_p && !keep_current_p;

View file

@ -5890,11 +5890,23 @@ get_next_display_element (struct it *it)
else
{
EMACS_INT pos = (it->s ? -1
: STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
: IT_CHARPOS (*it));
: STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
: IT_CHARPOS (*it));
int c;
it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos,
it->string);
if (it->what == IT_CHARACTER)
c = it->char_to_display;
else
{
struct composition *cmp = composition_table[it->cmp_it.id];
int i;
c = ' ';
for (i = 0; i < cmp->glyph_len; i++)
if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t')
break;
}
it->face_id = FACE_FOR_CHAR (it->f, face, c, pos, it->string);
}
}
@ -14817,7 +14829,8 @@ try_window_reusing_current_matrix (struct window *w)
row->visible_height -= min_y - row->y;
if (row->y + row->height > max_y)
row->visible_height -= row->y + row->height - max_y;
row->redraw_fringe_bitmaps_p = 1;
if (row->fringe_bitmap_periodic_p)
row->redraw_fringe_bitmaps_p = 1;
it.current_y += row->height;
@ -14979,7 +14992,8 @@ try_window_reusing_current_matrix (struct window *w)
row->visible_height -= min_y - row->y;
if (row->y + row->height > max_y)
row->visible_height -= row->y + row->height - max_y;
row->redraw_fringe_bitmaps_p = 1;
if (row->fringe_bitmap_periodic_p)
row->redraw_fringe_bitmaps_p = 1;
}
/* Scroll the current matrix. */