[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100587: Take account of periodic
From: |
YAMAMOTO Mitsuharu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100587: Take account of periodic fringe bitmap's dependency on y-position in redrawing. |
Date: |
Wed, 25 May 2011 12:06:05 +0900 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 100587
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: emacs-23
timestamp: Wed 2011-05-25 12:06:05 +0900
message:
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.
modified:
src/ChangeLog
src/dispextern.h
src/dispnew.c
src/fringe.c
src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-05-25 01:26:35 +0000
+++ b/src/ChangeLog 2011-05-25 03:06:05 +0000
@@ -1,3 +1,20 @@
+2011-05-25 YAMAMOTO Mitsuharu <address@hidden>
+
+ * 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 <address@hidden>
* xdisp.c (get_next_display_element): Set correct it->face_id for
=== modified file 'src/dispextern.h'
--- a/src/dispextern.h 2011-04-13 11:50:12 +0000
+++ b/src/dispextern.h 2011-05-25 03:06:05 +0000
@@ -786,6 +786,10 @@
/* 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;
=== modified file 'src/dispnew.c'
--- a/src/dispnew.c 2011-05-21 01:56:45 +0000
+++ b/src/dispnew.c 2011-05-25 03:06:05 +0000
@@ -1012,6 +1012,8 @@
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 @@
|| 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 @@
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;
=== modified file 'src/fringe.c'
--- a/src/fringe.c 2011-05-09 09:59:23 +0000
+++ b/src/fringe.c 2011-05-25 03:06:05 +0000
@@ -541,6 +541,20 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
|| 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 @@
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 @@
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;
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2011-05-25 01:26:35 +0000
+++ b/src/xdisp.c 2011-05-25 03:06:05 +0000
@@ -14255,7 +14255,8 @@
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 @@
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. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100587: Take account of periodic fringe bitmap's dependency on y-position in redrawing.,
YAMAMOTO Mitsuharu <=