emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a2eb83d037: Simplify Haiku scrolling code


From: Po Lu
Subject: master a2eb83d037: Simplify Haiku scrolling code
Date: Wed, 26 Jan 2022 01:09:22 -0500 (EST)

branch: master
commit a2eb83d037b36f43a124426a120af432b94b5b4e
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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 90d6f926c8..b9eb1d2fc5 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 ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]