]> git.eshelyaron.com Git - emacs.git/commit
Reduce color allocation/query traffic in the TrueColor case.
authorKen Raeburn <raeburn@raeburn.org>
Sat, 3 Oct 2015 04:18:50 +0000 (00:18 -0400)
committerKen Raeburn <raeburn@raeburn.org>
Thu, 8 Oct 2015 05:44:42 +0000 (01:44 -0400)
commite23ed19ff933c35111f3a806b4104fee8ef42f55
treedca1de3b389da477befb537c46a3a7992c02b1ea
parentb8eea1d7b1485a147f112127c0ca58cb1a0a8ebb
Reduce color allocation/query traffic in the TrueColor case.

When working with an X visual with TrueColor class, pixel values can
be generated from the RGB values according to mask value provided by
the server on connection.  Some of the image-handling code was already
doing this.

* src/xterm.h (x_make_truecolor_pixel): New function; code taken from
lookup_rgb_color.
(x_mutable_colormap): New function.
* src/image.c (lookup_rgb_color): Move pixel composition code to
x_make_truecolor_pixel.
(x_kill_gs_process): Call x_mutable_colormap.
* src/xfaces.c (x_free_colors, x_free_dpy_colors): Call
x_mutable_colormap.
* src/xftfont.c (xftfont_get_colors): Call x_query_colors.
* src/xterm.c (x_query_colors): For a TrueColor display, decompose the
pixel value into RGB values directly, and don't send a request to the
server.
(x_alloc_nearest_color): For a TrueColor display, construct the pixel
value with x_make_truecolor_pixel.
(x_copy_color): For an immutable color map, just return the provided
pixel value.
src/image.c
src/xfaces.c
src/xftfont.c
src/xterm.c
src/xterm.h