From 1c3e8684c8b1d5f53e9eff05f0ea2a38b4207dd7 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sat, 15 Jun 2019 12:44:56 +0900 Subject: [PATCH] Remove non-Xdbe double-buffering code on cairo * src/xterm.c (x_begin_cr_clip, x_update_end) [USE_CAIRO]: Don't do handcrafted double-buffering with image surface. --- src/xterm.c | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 1608621fc49..bc56e99513d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -385,15 +385,12 @@ x_begin_cr_clip (struct frame *f, GC gc) { int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f); int height = FRAME_CR_SURFACE_DESIRED_HEIGHT (f); - cairo_surface_t *surface; - if (FRAME_X_DOUBLE_BUFFERED_P (f)) - surface = cairo_xlib_surface_create (FRAME_X_DISPLAY (f), - FRAME_X_RAW_DRAWABLE (f), - FRAME_X_VISUAL (f), - width, height); - else - surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - width, height); + cairo_surface_t *surface + = cairo_xlib_surface_create (FRAME_X_DISPLAY (f), + FRAME_X_RAW_DRAWABLE (f), + FRAME_X_VISUAL (f), + width, height); + cr = FRAME_CR_CONTEXT (f) = cairo_create (surface); cairo_surface_destroy (surface); } @@ -1243,38 +1240,6 @@ x_update_end (struct frame *f) /* Mouse highlight may be displayed again. */ MOUSE_HL_INFO (f)->mouse_face_defer = false; -#ifdef USE_CAIRO - if (!FRAME_X_DOUBLE_BUFFERED_P (f)) - { - block_input (); - cairo_surface_t *source_surface = cairo_get_target (FRAME_CR_CONTEXT (f)); - if (source_surface) - { - cairo_t *cr; - cairo_surface_t *surface; - int width, height; - - width = FRAME_PIXEL_WIDTH (f); - height = FRAME_PIXEL_HEIGHT (f); - if (! FRAME_EXTERNAL_TOOL_BAR (f)) - height += FRAME_TOOL_BAR_HEIGHT (f); - if (! FRAME_EXTERNAL_MENU_BAR (f)) - height += FRAME_MENU_BAR_HEIGHT (f); - surface = cairo_xlib_surface_create (FRAME_X_DISPLAY (f), - FRAME_X_DRAWABLE (f), - FRAME_X_VISUAL (f), - width, height); - cr = cairo_create (surface); - cairo_surface_destroy (surface); - - cairo_set_source_surface (cr, source_surface, 0, 0); - cairo_paint (cr); - cairo_destroy (cr); - } - unblock_input (); - } -#endif - #ifndef XFlush block_input (); XFlush (FRAME_X_DISPLAY (f)); -- 2.39.5