diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/dispextern.h | 4 | ||||
| -rw-r--r-- | src/dispnew.c | 13 | ||||
| -rw-r--r-- | src/fringe.c | 39 | ||||
| -rw-r--r-- | src/xdisp.c | 6 |
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 @@ | |||
| 1 | 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p. | ||
| 4 | |||
| 5 | * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row | ||
| 6 | for fringe update if it has periodic bitmap. | ||
| 7 | (row_equal_p): Also compare left_fringe_offset, right_fringe_offset, | ||
| 8 | and fringe_bitmap_periodic_p. | ||
| 9 | |||
| 10 | * fringe.c (get_fringe_bitmap_data): New function. | ||
| 11 | (draw_fringe_bitmap_1, update_window_fringes): Use it. | ||
| 12 | (update_window_fringes): Record periodicity of fringe bitmap in glyph | ||
| 13 | row. Mark glyph row for fringe update if periodicity changed. | ||
| 14 | |||
| 15 | * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row | ||
| 16 | for fringe update unless it has periodic bitmap. | ||
| 17 | |||
| 1 | 2011-05-25 Kenichi Handa <handa@m17n.org> | 18 | 2011-05-25 Kenichi Handa <handa@m17n.org> |
| 2 | 19 | ||
| 3 | * xdisp.c (get_next_display_element): Set correct it->face_id for | 20 | * 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 | |||
| 786 | /* Vertical offset of the right fringe bitmap. */ | 786 | /* Vertical offset of the right fringe bitmap. */ |
| 787 | signed right_fringe_offset : FRINGE_HEIGHT_BITS; | 787 | signed right_fringe_offset : FRINGE_HEIGHT_BITS; |
| 788 | 788 | ||
| 789 | /* 1 means that at least one of the left and right fringe bitmaps is | ||
| 790 | periodic and thus depends on the y-position of the row. */ | ||
| 791 | unsigned fringe_bitmap_periodic_p : 1; | ||
| 792 | |||
| 789 | /* 1 means that we must draw the bitmaps of this row. */ | 793 | /* 1 means that we must draw the bitmaps of this row. */ |
| 790 | unsigned redraw_fringe_bitmaps_p : 1; | 794 | unsigned redraw_fringe_bitmaps_p : 1; |
| 791 | 795 | ||
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) | |||
| 1012 | row->visible_height -= min_y - row->y; | 1012 | row->visible_height -= min_y - row->y; |
| 1013 | if (row->y + row->height > max_y) | 1013 | if (row->y + row->height > max_y) |
| 1014 | row->visible_height -= row->y + row->height - max_y; | 1014 | row->visible_height -= row->y + row->height - max_y; |
| 1015 | if (row->fringe_bitmap_periodic_p) | ||
| 1016 | row->redraw_fringe_bitmaps_p = 1; | ||
| 1015 | } | 1017 | } |
| 1016 | } | 1018 | } |
| 1017 | 1019 | ||
| @@ -1533,8 +1535,11 @@ row_equal_p (w, a, b, mouse_face_p) | |||
| 1533 | || a->cursor_in_fringe_p != b->cursor_in_fringe_p | 1535 | || a->cursor_in_fringe_p != b->cursor_in_fringe_p |
| 1534 | || a->left_fringe_bitmap != b->left_fringe_bitmap | 1536 | || a->left_fringe_bitmap != b->left_fringe_bitmap |
| 1535 | || a->left_fringe_face_id != b->left_fringe_face_id | 1537 | || a->left_fringe_face_id != b->left_fringe_face_id |
| 1538 | || a->left_fringe_offset != b->left_fringe_offset | ||
| 1536 | || a->right_fringe_bitmap != b->right_fringe_bitmap | 1539 | || a->right_fringe_bitmap != b->right_fringe_bitmap |
| 1537 | || a->right_fringe_face_id != b->right_fringe_face_id | 1540 | || a->right_fringe_face_id != b->right_fringe_face_id |
| 1541 | || a->right_fringe_offset != b->right_fringe_offset | ||
| 1542 | || a->fringe_bitmap_periodic_p != b->fringe_bitmap_periodic_p | ||
| 1538 | || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap | 1543 | || a->overlay_arrow_bitmap != b->overlay_arrow_bitmap |
| 1539 | || a->exact_window_width_line_p != b->exact_window_width_line_p | 1544 | || a->exact_window_width_line_p != b->exact_window_width_line_p |
| 1540 | || a->overlapped_p != b->overlapped_p | 1545 | || a->overlapped_p != b->overlapped_p |
| @@ -5226,13 +5231,7 @@ scrolling_window (w, header_line_p) | |||
| 5226 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); | 5231 | to = MATRIX_ROW (current_matrix, r->desired_vpos + j); |
| 5227 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); | 5232 | from = MATRIX_ROW (desired_matrix, r->desired_vpos + j); |
| 5228 | to_overlapped_p = to->overlapped_p; | 5233 | to_overlapped_p = to->overlapped_p; |
| 5229 | if (!from->mode_line_p && !w->pseudo_window_p | 5234 | from->redraw_fringe_bitmaps_p = from->fringe_bitmap_periodic_p; |
| 5230 | && (to->left_fringe_bitmap != from->left_fringe_bitmap | ||
| 5231 | || to->right_fringe_bitmap != from->right_fringe_bitmap | ||
| 5232 | || to->left_fringe_face_id != from->left_fringe_face_id | ||
| 5233 | || to->right_fringe_face_id != from->right_fringe_face_id | ||
| 5234 | || to->overlay_arrow_bitmap != from->overlay_arrow_bitmap)) | ||
| 5235 | from->redraw_fringe_bitmaps_p = 1; | ||
| 5236 | assign_row (to, from); | 5235 | assign_row (to, from); |
| 5237 | to->enabled_p = 1, from->enabled_p = 0; | 5236 | to->enabled_p = 1, from->enabled_p = 0; |
| 5238 | to->overlapped_p = to_overlapped_p; | 5237 | 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) | |||
| 541 | return num; | 541 | return num; |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /* Get fringe bitmap data for bitmap number BN. */ | ||
| 545 | |||
| 546 | static struct fringe_bitmap * | ||
| 547 | get_fringe_bitmap_data (int bn) | ||
| 548 | { | ||
| 549 | struct fringe_bitmap *fb; | ||
| 550 | |||
| 551 | fb = fringe_bitmaps[bn]; | ||
| 552 | if (fb == NULL) | ||
| 553 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 554 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 555 | |||
| 556 | return fb; | ||
| 557 | } | ||
| 544 | 558 | ||
| 545 | /* Draw the bitmap WHICH in one of the left or right fringes of | 559 | /* Draw the bitmap WHICH in one of the left or right fringes of |
| 546 | window W. ROW is the glyph row for which to display the bitmap; it | 560 | 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) | |||
| 593 | face_id = FRINGE_FACE_ID; | 607 | face_id = FRINGE_FACE_ID; |
| 594 | } | 608 | } |
| 595 | 609 | ||
| 596 | fb = fringe_bitmaps[which]; | 610 | fb = get_fringe_bitmap_data (which); |
| 597 | if (fb == NULL) | ||
| 598 | fb = &standard_bitmaps[which < MAX_STANDARD_FRINGE_BITMAPS | ||
| 599 | ? which : UNDEF_FRINGE_BITMAP]; | ||
| 600 | 611 | ||
| 601 | period = fb->period; | 612 | period = fb->period; |
| 602 | 613 | ||
| @@ -1075,12 +1086,8 @@ update_window_fringes (w, keep_current_p) | |||
| 1075 | 1086 | ||
| 1076 | if (bn != NO_FRINGE_BITMAP) | 1087 | if (bn != NO_FRINGE_BITMAP) |
| 1077 | { | 1088 | { |
| 1078 | struct fringe_bitmap *fb; | 1089 | struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); |
| 1079 | 1090 | ||
| 1080 | fb = fringe_bitmaps[bn]; | ||
| 1081 | if (fb == NULL) | ||
| 1082 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 1083 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 1084 | if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) | 1091 | if (fb->align == ALIGN_BITMAP_TOP && fb->period == 0) |
| 1085 | { | 1092 | { |
| 1086 | struct glyph_row *row1; | 1093 | struct glyph_row *row1; |
| @@ -1134,12 +1141,8 @@ update_window_fringes (w, keep_current_p) | |||
| 1134 | 1141 | ||
| 1135 | if (bn != NO_FRINGE_BITMAP) | 1142 | if (bn != NO_FRINGE_BITMAP) |
| 1136 | { | 1143 | { |
| 1137 | struct fringe_bitmap *fb; | 1144 | struct fringe_bitmap *fb = get_fringe_bitmap_data (bn); |
| 1138 | 1145 | ||
| 1139 | fb = fringe_bitmaps[bn]; | ||
| 1140 | if (fb == NULL) | ||
| 1141 | fb = &standard_bitmaps[bn < MAX_STANDARD_FRINGE_BITMAPS | ||
| 1142 | ? bn : UNDEF_FRINGE_BITMAP]; | ||
| 1143 | if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) | 1146 | if (fb->align == ALIGN_BITMAP_BOTTOM && fb->period == 0) |
| 1144 | { | 1147 | { |
| 1145 | struct glyph_row *row1; | 1148 | struct glyph_row *row1; |
| @@ -1175,6 +1178,7 @@ update_window_fringes (w, keep_current_p) | |||
| 1175 | int left, right; | 1178 | int left, right; |
| 1176 | unsigned left_face_id, right_face_id; | 1179 | unsigned left_face_id, right_face_id; |
| 1177 | int left_offset, right_offset; | 1180 | int left_offset, right_offset; |
| 1181 | int periodic_p; | ||
| 1178 | 1182 | ||
| 1179 | row = w->desired_matrix->rows + rn; | 1183 | row = w->desired_matrix->rows + rn; |
| 1180 | cur = w->current_matrix->rows + rn; | 1184 | cur = w->current_matrix->rows + rn; |
| @@ -1183,6 +1187,7 @@ update_window_fringes (w, keep_current_p) | |||
| 1183 | 1187 | ||
| 1184 | left_face_id = right_face_id = DEFAULT_FACE_ID; | 1188 | left_face_id = right_face_id = DEFAULT_FACE_ID; |
| 1185 | left_offset = right_offset = 0; | 1189 | left_offset = right_offset = 0; |
| 1190 | periodic_p = 0; | ||
| 1186 | 1191 | ||
| 1187 | /* Decide which bitmap to draw in the left fringe. */ | 1192 | /* Decide which bitmap to draw in the left fringe. */ |
| 1188 | if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) | 1193 | if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0) |
| @@ -1270,6 +1275,9 @@ update_window_fringes (w, keep_current_p) | |||
| 1270 | else | 1275 | else |
| 1271 | right = NO_FRINGE_BITMAP; | 1276 | right = NO_FRINGE_BITMAP; |
| 1272 | 1277 | ||
| 1278 | periodic_p = (get_fringe_bitmap_data (left)->period != 0 | ||
| 1279 | || get_fringe_bitmap_data (right)->period != 0); | ||
| 1280 | |||
| 1273 | if (row->y != cur->y | 1281 | if (row->y != cur->y |
| 1274 | || row->visible_height != cur->visible_height | 1282 | || row->visible_height != cur->visible_height |
| 1275 | || row->ends_at_zv_p != cur->ends_at_zv_p | 1283 | || row->ends_at_zv_p != cur->ends_at_zv_p |
| @@ -1279,6 +1287,7 @@ update_window_fringes (w, keep_current_p) | |||
| 1279 | || right_face_id != cur->right_fringe_face_id | 1287 | || right_face_id != cur->right_fringe_face_id |
| 1280 | || left_offset != cur->left_fringe_offset | 1288 | || left_offset != cur->left_fringe_offset |
| 1281 | || right_offset != cur->right_fringe_offset | 1289 | || right_offset != cur->right_fringe_offset |
| 1290 | || periodic_p != cur->fringe_bitmap_periodic_p | ||
| 1282 | || cur->redraw_fringe_bitmaps_p) | 1291 | || cur->redraw_fringe_bitmaps_p) |
| 1283 | { | 1292 | { |
| 1284 | redraw_p = row->redraw_fringe_bitmaps_p = 1; | 1293 | redraw_p = row->redraw_fringe_bitmaps_p = 1; |
| @@ -1291,6 +1300,7 @@ update_window_fringes (w, keep_current_p) | |||
| 1291 | cur->right_fringe_face_id = right_face_id; | 1300 | cur->right_fringe_face_id = right_face_id; |
| 1292 | cur->left_fringe_offset = left_offset; | 1301 | cur->left_fringe_offset = left_offset; |
| 1293 | cur->right_fringe_offset = right_offset; | 1302 | cur->right_fringe_offset = right_offset; |
| 1303 | cur->fringe_bitmap_periodic_p = periodic_p; | ||
| 1294 | } | 1304 | } |
| 1295 | } | 1305 | } |
| 1296 | 1306 | ||
| @@ -1309,6 +1319,7 @@ update_window_fringes (w, keep_current_p) | |||
| 1309 | row->right_fringe_face_id = right_face_id; | 1319 | row->right_fringe_face_id = right_face_id; |
| 1310 | row->left_fringe_offset = left_offset; | 1320 | row->left_fringe_offset = left_offset; |
| 1311 | row->right_fringe_offset = right_offset; | 1321 | row->right_fringe_offset = right_offset; |
| 1322 | row->fringe_bitmap_periodic_p = periodic_p; | ||
| 1312 | } | 1323 | } |
| 1313 | 1324 | ||
| 1314 | return redraw_p && !keep_current_p; | 1325 | 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) | |||
| 14255 | row->visible_height -= min_y - row->y; | 14255 | row->visible_height -= min_y - row->y; |
| 14256 | if (row->y + row->height > max_y) | 14256 | if (row->y + row->height > max_y) |
| 14257 | row->visible_height -= row->y + row->height - max_y; | 14257 | row->visible_height -= row->y + row->height - max_y; |
| 14258 | row->redraw_fringe_bitmaps_p = 1; | 14258 | if (row->fringe_bitmap_periodic_p) |
| 14259 | row->redraw_fringe_bitmaps_p = 1; | ||
| 14259 | 14260 | ||
| 14260 | it.current_y += row->height; | 14261 | it.current_y += row->height; |
| 14261 | 14262 | ||
| @@ -14417,7 +14418,8 @@ try_window_reusing_current_matrix (w) | |||
| 14417 | row->visible_height -= min_y - row->y; | 14418 | row->visible_height -= min_y - row->y; |
| 14418 | if (row->y + row->height > max_y) | 14419 | if (row->y + row->height > max_y) |
| 14419 | row->visible_height -= row->y + row->height - max_y; | 14420 | row->visible_height -= row->y + row->height - max_y; |
| 14420 | row->redraw_fringe_bitmaps_p = 1; | 14421 | if (row->fringe_bitmap_periodic_p) |
| 14422 | row->redraw_fringe_bitmaps_p = 1; | ||
| 14421 | } | 14423 | } |
| 14422 | 14424 | ||
| 14423 | /* Scroll the current matrix. */ | 14425 | /* Scroll the current matrix. */ |