]> git.eshelyaron.com Git - emacs.git/commit
Avoid triple buffering with Xdbe in cairo
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 18 May 2019 23:35:40 +0000 (08:35 +0900)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sat, 18 May 2019 23:35:40 +0000 (08:35 +0900)
commitb87e5eea1dd7c7345d0a9f82759eedfd7c9a8099
tree1da68babb2bf8cbf738766506c23283bf6ec486b
parent5f9671e57ee99cfe4653b2cb6aca16d52f9a5c53
Avoid triple buffering with Xdbe in cairo

* 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.
src/xfns.c
src/xterm.c
src/xterm.h