[cairo] [cairo-xlib] Cache standard xrender formats
chris at chris-wilson.co.uk
Wed Jul 16 01:44:24 PDT 2008
On Wed, 2008-07-16 at 17:33 +1200, Karl Tomlinson wrote:
> 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?
No. I wrote that patch some time ago to trim a few redundant calls from
an xtrace (and even the mallocs were apparent in the profiles). However,
it now appears to be entirely superfluous and can be dropped.
More information about the cairo