mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-29 03:17:53 -04:00
Shorten add_chars. Do not call compare_fg_color and compare_bg_color.
Some sites while scrolling showed "artifacts". For example twojepc.pl.
This commit is contained in:
parent
66fa83f7b5
commit
8132c156dd
@ -1135,7 +1135,7 @@ add_char_true(struct string *screen, struct screen_driver *driver,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define add_chars(image_, term_, driver_, state_, ADD_CHAR, compare_bg_color, compare_fg_color) \
|
#define add_chars(image_, term_, driver_, state_, ADD_CHAR) \
|
||||||
{ \
|
{ \
|
||||||
struct terminal_screen *screen = (term_)->screen; \
|
struct terminal_screen *screen = (term_)->screen; \
|
||||||
int y = screen->dirty_from; \
|
int y = screen->dirty_from; \
|
||||||
@ -1145,7 +1145,7 @@ add_char_true(struct string *screen, struct screen_driver *driver,
|
|||||||
int ymax = (term_)->height - 1; \
|
int ymax = (term_)->height - 1; \
|
||||||
struct screen_char *current = &screen->last_image[ypos]; \
|
struct screen_char *current = &screen->last_image[ypos]; \
|
||||||
struct screen_char *pos = &screen->image[ypos]; \
|
struct screen_char *pos = &screen->image[ypos]; \
|
||||||
struct screen_char *prev_pos = NULL; /* Warning prevention. */ \
|
struct screen_char *prev_pos = pos; /* Warning prevention. */ \
|
||||||
\
|
\
|
||||||
int_upper_bound(&screen->dirty_to, ymax); \
|
int_upper_bound(&screen->dirty_to, ymax); \
|
||||||
\
|
\
|
||||||
@ -1166,20 +1166,6 @@ add_char_true(struct string *screen, struct screen_driver *driver,
|
|||||||
if (is_last_line && x == xmax) \
|
if (is_last_line && x == xmax) \
|
||||||
break; \
|
break; \
|
||||||
\
|
\
|
||||||
if (compare_bg_color(pos->c.color, current->c.color)) { \
|
|
||||||
/* No update for exact match. */ \
|
|
||||||
if (compare_fg_color(pos->c.color, current->c.color)\
|
|
||||||
&& pos->data == current->data \
|
|
||||||
&& pos->attr == current->attr) \
|
|
||||||
continue; \
|
|
||||||
\
|
|
||||||
/* Else if the color match and the data is
|
|
||||||
* ``space''. */ \
|
|
||||||
if (pos->data <= ' ' && current->data <= ' ' \
|
|
||||||
&& pos->attr == current->attr) \
|
|
||||||
continue; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
/* Move the cursor when @prev_pos is more than 10 chars
|
/* Move the cursor when @prev_pos is more than 10 chars
|
||||||
* away. */ \
|
* away. */ \
|
||||||
if (prev_y != y || prev_pos + 10 <= pos) { \
|
if (prev_y != y || prev_pos + 10 <= pos) { \
|
||||||
@ -1218,21 +1204,21 @@ redraw_screen(struct terminal *term)
|
|||||||
* use 16 colors. */
|
* use 16 colors. */
|
||||||
case COLOR_MODE_MONO:
|
case COLOR_MODE_MONO:
|
||||||
case COLOR_MODE_16:
|
case COLOR_MODE_16:
|
||||||
add_chars(&image, term, driver, &state, add_char16, compare_bg_color_16, compare_fg_color_16);
|
add_chars(&image, term, driver, &state, add_char16);
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_88_COLORS
|
#ifdef CONFIG_88_COLORS
|
||||||
case COLOR_MODE_88:
|
case COLOR_MODE_88:
|
||||||
add_chars(&image, term, driver, &state, add_char256, compare_bg_color_256, compare_fg_color_256);
|
add_chars(&image, term, driver, &state, add_char256);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_256_COLORS
|
#ifdef CONFIG_256_COLORS
|
||||||
case COLOR_MODE_256:
|
case COLOR_MODE_256:
|
||||||
add_chars(&image, term, driver, &state, add_char256, compare_bg_color_256, compare_fg_color_256);
|
add_chars(&image, term, driver, &state, add_char256);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_TRUE_COLOR
|
#ifdef CONFIG_TRUE_COLOR
|
||||||
case COLOR_MODE_TRUE_COLOR:
|
case COLOR_MODE_TRUE_COLOR:
|
||||||
add_chars(&image, term, driver, &state, add_char_true, compare_bg_color_true, compare_fg_color_true);
|
add_chars(&image, term, driver, &state, add_char_true);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case COLOR_MODES:
|
case COLOR_MODES:
|
||||||
|
Loading…
Reference in New Issue
Block a user