Commit graph

3 commits

Author SHA1 Message Date
Chris Wilson
38c4bcc2da [test/solid-pattern-cache-stress] Do what it says on the tin.
Actually draw to the surface after setting the source in order to
trigger use of the solid surface cache.
2008-06-19 12:24:30 +01:00
Chris Wilson
9ae4b219e1 [test/solid-pattern-cache-stress] Check for drand48().
Apply an alternative rand() function if drand48() is not available for
the platform.
2008-01-10 14:47:16 +00:00
Chris Wilson
9b53bc7c65 Cache solid patterns
We use a small cache of size 16 for patterns created from solid colors,
e.g. cairo_set_source_rgb(). This helps with toolkits that draw many
widgets using the same colour scheme.

The cache uses a static index variable, which itself acts like a cache
of size 1, remembering the most recently used colour. So repeated
lookups for the same colour hit immediately. If that fails, the cache
is searched linearly, and if that fails too, a new pattern is created
and a random member of the cache is evicted.
2007-03-20 18:21:53 -04:00