1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-23 04:53:12 -08:00

Fix disabling double buffering on Haiku

* src/haikufns.c (haiku_set_inhibit_double_buffering): Garbage
frame correctly after changing double buffering.
* src/haikuterm.c (haiku_calculate_relief_colors)
(haiku_draw_relief_rect, haiku_draw_underwave): Clean up coding
style.
This commit is contained in:
Po Lu 2022-04-24 02:55:19 +00:00
parent 9b6580ccb7
commit ddbf2e8ab7
2 changed files with 15 additions and 20 deletions

View file

@ -1749,17 +1749,14 @@ haiku_set_inhibit_double_buffering (struct frame *f,
{
#ifndef USE_BE_CAIRO
if (NILP (new_value))
{
#endif
EmacsView_set_up_double_buffering (FRAME_HAIKU_VIEW (f));
if (!NILP (old_value))
expose_frame (f, 0, 0, 0, 0);
EmacsView_set_up_double_buffering (FRAME_HAIKU_VIEW (f));
#ifndef USE_BE_CAIRO
}
else
EmacsView_disable_double_buffering (FRAME_HAIKU_VIEW (f));
#endif
SET_FRAME_GARBAGED (f);
}
unblock_input ();
}

View file

@ -621,18 +621,17 @@ haiku_calculate_relief_colors (struct glyph_string *s, uint32_t *rgbout_w,
uint32_t *rgbout_b)
{
struct face *face = s->face;
double h, cs, l;
uint32_t rgbin;
prepare_face_for_display (s->f, s->face);
uint32_t rgbin = face->use_box_color_for_shadows_p
? face->box_color : face->background;
rgbin = (face->use_box_color_for_shadows_p
? face->box_color : face->background);
if (s->hl == DRAW_CURSOR)
rgbin = FRAME_CURSOR_COLOR (s->f).pixel;
double h, cs, l;
rgb_color_hsl (rgbin, &h, &cs, &l);
hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 0.6), rgbout_b);
hsl_color_rgb (h, cs, fmin (1.0, fmax (0.2, l) * 1.2), rgbout_w);
}
@ -640,16 +639,16 @@ haiku_calculate_relief_colors (struct glyph_string *s, uint32_t *rgbout_w,
static void
haiku_draw_relief_rect (struct glyph_string *s,
int left_x, int top_y, int right_x, int bottom_y,
int hwidth, int vwidth, bool raised_p, bool top_p, bool bot_p,
bool left_p, bool right_p,
int hwidth, int vwidth, bool raised_p, bool top_p,
bool bot_p, bool left_p, bool right_p,
struct haiku_rect *clip_rect, bool fancy_p)
{
uint32_t color_white;
uint32_t color_black;
uint32_t color_white, color_black;
void *view;
haiku_calculate_relief_colors (s, &color_white, &color_black);
void *view = FRAME_HAIKU_VIEW (s->f);
view = FRAME_HAIKU_VIEW (s->f);
BView_SetHighColor (view, raised_p ? color_white : color_black);
if (clip_rect)
{
@ -726,15 +725,14 @@ haiku_draw_underwave (struct glyph_string *s, int width, int x)
{
int wave_height = 3, wave_length = 2;
int y, dx, dy, odd, xmax;
float ax, ay, bx, by;
void *view = FRAME_HAIKU_VIEW (s->f);
dx = wave_length;
dy = wave_height - 1;
y = s->ybase - wave_height + 3;
float ax, ay, bx, by;
xmax = x + width;
void *view = FRAME_HAIKU_VIEW (s->f);
BView_StartClip (view);
haiku_clip_to_string (s);
BView_ClipToRect (view, x, y, width, wave_height);