• YAMAMOTO Mitsuharu's avatar
    Avoid triple buffering with Xdbe in cairo · b87e5eea
    YAMAMOTO Mitsuharu authored
    * src/xterm.h (struct x_output): Remove member cr_surface.
    Add members cr_surface_desired_width and cr_surface_desired_height.
    (x_cr_destroy_frame_context) [USE_CAIRO]: Add extern.
    
    * src/xterm.c (x_free_cr_resources): Remove function.
    (FRAME_CR_SURFACE) [USE_CAIRO]: Remove macro.
    (FRAME_CR_SURFACE_DESIRED_WIDTH, FRAME_CR_SURFACE_DESIRED_HEIGHT) [USE_CAIRO]:
    New macros.
    (x_cr_destroy_frame_context) [USE_CAIRO]: Rename from x_cr_destroy_surface.
    All Uses changed.  Don't use FRAME_CR_SURFACE.  Make non-static.
    (x_cr_update_surface_desired_size) [USE_CAIRO]: New function.
    (x_begin_cr_clip) [USE_CAIRO]: Create Xlib surface if Xdbe is in use.
    Use FRAME_CR_SURFACE_DESIRED_WIDTH and FRAME_CR_SURFACE_DESIRED_HEIGHT.
    (x_end_cr_clip) [USE_CAIRO]: Call x_mark_frame_dirty if Xdbe is in use.
    (x_cr_draw_frame, x_cr_export_frames) [USE_CAIRO]: Save and restore cairo
    context instead of freeing and clearing it.
    (x_update_begin) [USE_CAIRO]: Don't create cairo surface here.
    (show_back_buffer) [USE_CAIRO]: Call cairo_surface_flush before swapping.
    (x_update_end) [USE_CAIRO]: Don't copy image surface if Xdbe is in use.
    Get image surface by cairo_get_target instead of FRAME_CR_SURFACE.
    (x_scroll_run) [USE_CAIRO]: Use XCopyArea if Xdbe is in use.
    (handle_one_xevent) [USE_CAIRO] <ConfigureNotify>: Call
    x_cr_update_surface_desired_size instead of x_cr_destroy_surface.
    (x_free_frame_resources) [USE_CAIRO]: Call x_cr_destroy_frame_context instead
    of x_free_cr_resources.
    
    * src/xfns.c (set_up_x_back_buffer, tear_down_x_back_buffer) [USE_CAIRO]:
    Call x_cr_destroy_frame_context.
    b87e5eea
xterm.c 396 KB