From a2eb83d037b36f43a124426a120af432b94b5b4e Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 26 Jan 2022 06:05:35 +0000 Subject: [PATCH] Simplify Haiku scrolling code * src/haikuterm.c (haiku_scroll_run): Remove code that can never be reached since Cairo frames are always double buffered. --- src/haikuterm.c | 46 +++++----------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/src/haikuterm.c b/src/haikuterm.c index 90d6f926c82..b9eb1d2fc5e 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2325,50 +2325,14 @@ haiku_scroll_run (struct window *w, struct run *run) height = run->height; } - if (!height) - return; - block_input (); gui_clear_cursor (w); + BView_draw_lock (view); -#ifdef USE_BE_CAIRO - if (EmacsView_double_buffered_p (view)) - { -#endif - BView_StartClip (view); - BView_CopyBits (view, x, from_y, width, height, - x, to_y, width, height); - BView_EndClip (view); -#ifdef USE_BE_CAIRO - } - else - { - EmacsWindow_begin_cr_critical_section (FRAME_HAIKU_WINDOW (f)); - cairo_surface_t *surface = FRAME_CR_SURFACE (f); - cairo_surface_t *s - = cairo_surface_create_similar (surface, - cairo_surface_get_content (surface), - width, height); - cairo_t *cr = cairo_create (s); - if (surface) - { - cairo_set_source_surface (cr, surface, -x, -from_y); - cairo_paint (cr); - cairo_destroy (cr); - - cr = haiku_begin_cr_clip (f, NULL); - cairo_save (cr); - cairo_set_source_surface (cr, s, x, to_y); - cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); - cairo_rectangle (cr, x, to_y, width, height); - cairo_fill (cr); - cairo_restore (cr); - cairo_surface_destroy (s); - haiku_end_cr_clip (cr); - } - EmacsWindow_end_cr_critical_section (FRAME_HAIKU_WINDOW (f)); - } -#endif + BView_StartClip (view); + BView_CopyBits (view, x, from_y, width, height, + x, to_y, width, height); + BView_EndClip (view); BView_draw_unlock (view); unblock_input (); -- 2.39.2