summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2011-05-25 12:06:05 +0900
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>2011-05-25 12:06:05 +0900
commite61124cd850ad6e0fc511dc995031db77b3535cd (patch)
tree6c43a8bbdecf4dce4f8c815af831e46a4a503a57 /src
parent964b0e76b0c609ddd0dd71b7ab7c7c44627ec044 (diff)
downloademacs-e61124cd850ad6e0fc511dc995031db77b3535cd.tar.gz
Take account of periodic fringe bitmap's dependency on y-position in redrawing.
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog17
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c13
-rw-r--r--src/fringe.c39
-rw-r--r--src/xdisp.c6
5 files changed, 56 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cdc8ed8999c..3f53eabb5d1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
+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
diff --git a/src/dispextern.h b/src/dispextern.h
index 8ae5e23fa97..5f9f7824361 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -786,6 +786,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;
diff --git a/src/dispnew.c b/src/dispnew.c
index 5fd29e2d591..4c460abd636 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1012,6 +1012,8 @@ shift_glyph_matrix (w, matrix, start, end, dy)
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;
}
}
@@ -1533,8 +1535,11 @@ row_equal_p (w, a, b, 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
@@ -5226,13 +5231,7 @@ scrolling_window (w, 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;
diff --git a/src/fringe.c b/src/fringe.c
index 880fe2c6e42..e160353914e 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -541,6 +541,20 @@ get_fringe_bitmap_name (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
@@ -593,10 +607,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
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;
@@ -1075,12 +1086,8 @@ update_window_fringes (w, 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;
@@ -1134,12 +1141,8 @@ update_window_fringes (w, 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;
@@ -1175,6 +1178,7 @@ update_window_fringes (w, 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;
@@ -1183,6 +1187,7 @@ update_window_fringes (w, 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)
@@ -1270,6 +1275,9 @@ update_window_fringes (w, 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
@@ -1279,6 +1287,7 @@ update_window_fringes (w, 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;
@@ -1291,6 +1300,7 @@ update_window_fringes (w, 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;
}
}
@@ -1309,6 +1319,7 @@ update_window_fringes (w, 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;
diff --git a/src/xdisp.c b/src/xdisp.c
index 0f21c82e1f1..1f42e427428 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14255,7 +14255,8 @@ try_window_reusing_current_matrix (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;
@@ -14417,7 +14418,8 @@ try_window_reusing_current_matrix (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. */