[cairo] Solid pattern caching revisited

Owen Taylor otaylor at redhat.com
Wed Apr 18 13:56:37 PDT 2007


On Wed, 2007-04-18 at 15:11 -0400, Behdad Esfahbod wrote:
> On Wed, 2007-04-18 at 10:00 -0400, Owen Taylor wrote:
> > 
> > Can we back up here and discuss why it wouldn't be simpler and better
> > to use a per-display solid-surface cache? 
> 
> That may be easier, yes, but that would need either a new backend
> function, or special-casing on pattern type in the xlib/xcb backends.
> 
> But a better answer to your question is that we need the workqueue
> anyway.  For the scaled-font global cache for example.  Or for freeing
> server resources when a surface is destroyed (which may be from another
> thread at a much later time...).  So it's not like we are introducing it
> just for solid-surface cache.

Well, my take would generally be that 

 - All caches of X specific objects should be stored per-display

 - If the cached object is a backend-specific instantiation of a
   non-backend-specific object (like a cached glyph), then when
   the non-backend-specific object is deleted, you "unlink" the
   element in the cache from it

 - But the object is not freed until it is evicted by the cache
   and replaced by something else (or when the display is closed
   and the cache is deleted)

I don't know if there is a big practical difference between that and
the work-queue approach. The memory utilization should be similar
either way. It seems conceptually easier to manage to me without
a work queue, but if Chris now has tested, working work queue code, 
then that may not matter much...

					- Owen


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070418/4441c1bf/attachment.pgp


More information about the cairo mailing list