[cairo] [cairo-xlib] Cache standard xrender formats

Karl Tomlinson cairo at karlt.net
Tue Jul 15 22:33:02 PDT 2008

This change implemented caching of standard XRender formats:


The reason given was:

  XRender performs a round-trip in order to query the available formats on
  the xserver, before searching for a matching format. In order to save
  that round-trip and to avoid the short-lived allocation of the array of
  available formats, we cache the result on the display.

AFAICT XRenderQueryFormats only performs that round trip once per process (in
libXrender-0.9.2 at least), and caches the necessary information.


That LockDisplay(dpy) is just for thread safety within the process,
right (i.e no round trip)?

Or am I missing a round trip somewhere else?

The reason I'm interested is that I want to find the Visual
corresponding to a XRenderPictFormat (when there is one), and the
simplest way to do that is to use the inverse
XRenderFindVisualFormat(), but that would suffer the same issues
as XRenderFindStandardFormat (if there are any such issues).


More information about the cairo mailing list