[cairo] drawlist type functionality in Cairo

dirk.schoenberger at sz-online.de dirk.schoenberger at sz-online.de
Tue Apr 5 07:15:54 PDT 2005


> What we should be using are vertex arrays and VBOs. Glitz already
> support this perfectly, we just need to make cairo utilize it.
>
>
> I don't think we need a cairo display list or similar at all.
>

I believe drawlists would be needed for the following two uses

- complex drop shadows, where the same path is rendered multiple times
- "vector fill pattern", where the fill area is filled with (multiple)
calls to the rendering API.

It should be possible to implement this with cached references to a
pattern, but this sound not really "natural" to me.
Additionally, such a vector fill pattern could consist out of multiple
sub-patchs which are rendered differently, so it is possibly not enough to
store one path only.

> I think it's all about caching. An application that likes to use a
> pattern more than once shouldn't create a new pattern every time. It
> should create the pattern once, keep a reference to it and use it
> whenever it likes. Backends can be smart and cache this pattern in
> appropriate form. e.g. if you'd create a pattern from an image surface
> and use it draw onto a glitz surface the glitz backend would cache a
> glitz surface in this pattern.

A cache implies that you have a key and a value. How do you want to cache
path which is created dynamically with calls to cairo, but which is not
given a key / name? You could build some kind of "checksum" out of
primitives, the path is built from, but I don't really think this is a
good solution.

If you use an opaque path type, you still have to make sure that the
referenced back end specific representation is used, otherwise the path
has to be rebuilt again and again and again.


Regards
Dirk





More information about the cairo mailing list