[cairo] [Patch] Surface cache
Jorn Baayen
jorn at openedhand.com
Wed Jan 31 05:43:34 PST 2007
Hi,
On Mon, 2007-01-29 at 16:10 -0500, Behdad Esfahbod wrote:
> On Mon, 2007-01-29 at 15:05 -0500, Carl Worth wrote:
> > On Mon, 29 Jan 2007 18:56:49 +0200, Jorn Baayen wrote:
> > > Attached patch adds a simple 16-entry static cache to
> > > _cairo_pattern_acquire_surface_for_solid(). It still needs work,
> > however
> >
> > Excellent! Thanks for providing this first step. What work is still
> > needed here? I know Behdad had expressed interest in doing this work,
> > so maybe he'll want to pickup your work and run with it.
>
> Excellent indeed. And look how short the patch is! The only things
> that immediately come to my mind are:
>
> - Needs locking around the cache. Then you can use a static cursor
> too, for faster lookup (a cache of one there in itself).
>
> - With just backend comparison, does this work with two different X
> displays? Guess not.
Attached patch should address these two, the second by adding an
is_similar method to cairo_surface_backend. xlib-surface implements this
and checks that the displays match. (implementations would need to be
written for other backends as well)
> - We have a faster random() implementation in cairo. Lets use that.
You mean lfsr_random()? Isn't that very specialized? I see rand() being
used elsewhere, for example in _cairo_hash_table_random_entry().
Thanks,
Jorn
--
OpenedHand Ltd.
http://o-hand.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-surface-cache-2.patch
Type: text/x-patch
Size: 6509 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070131/665769cc/cairo-surface-cache-2.bin
More information about the cairo
mailing list