]> git.eshelyaron.com Git - emacs.git/commit
Cache XParseColor results in the X display info structure.
authorKen Raeburn <raeburn@raeburn.org>
Sat, 3 Oct 2015 04:15:54 +0000 (00:15 -0400)
committerKen Raeburn <raeburn@raeburn.org>
Thu, 8 Oct 2015 05:19:49 +0000 (01:19 -0400)
commitb8eea1d7b1485a147f112127c0ca58cb1a0a8ebb
tree215730e1b1fc26ea26a37f4b454c6da138be4c28
parent0360b7f2c4f0358106e229de4dfe91a67445a50c
Cache XParseColor results in the X display info structure.

With repeated lookups of foreground and background colors for multiple
faces per frame, we issue a lot of redundant color name lookups to the
X server, waiting every time for the response.  On a remote network
with, say, 30ms round-trip time, this can add nearly a full second to
creation of a new frame.

* src/gtkutil.c (xg_check_special_colors): Call x_parse_color.
* src/image.c (get_spec_bg_or_alpha_as_argb):
(xpm_init_color_cache, xpm_lookup_color):
* src/xfns.c (x_defined_color):
* src/xterm.c (x_parse_color): New function; caches color names not
starting with "#" in the display-info structure.
(x_delete_display): Delete the cache content.
* src/xterm.h (struct color_name_cache_entry): New type.
(x_parse_color): Declare.
(struct x_display_info): Add a new field for the cache.
src/gtkutil.c
src/image.c
src/xfns.c
src/xterm.c
src/xterm.h