[cairo] Lander Game

Travis Griggs tgriggs at cincom.com
Mon Jan 8 17:13:25 PST 2007


On Jan 8, 2007, at 14:19, Simon Burton wrote:

> On Mon, 8 Jan 2007 13:19:45 -0800
> "Daniel Amelang" <daniel.amelang at gmail.com> wrote:
>
>>
>> On 1/8/07, Alex Mac <lots.of.mailing.lists at gmail.com> wrote:
>>> I'm guessing that rsvg does no caching and simply re-parses the svg
>>> file every time? that would explain why its so slow.
>>>
>>> I saw something like this mentioned in another thread but I'll  
>>> mention
>>> it again here. It would be really useful if cairo had something like
>>> OpenGL's display lists so that sequences of commands can be recorded
>>> and then later replayed to a surface.
>>
>> You don't necessarily need display lists in this case to get that
>> behavior. You can cache all that complex drawing in an intermediate
>> cairo surface that you keep around to paint onto your destination
>> surface as needed. That way, you only need to use rsvg to render the
>> SVG once. If/when you need to draw the SVG at a different resolution,
>> you'll probably want to re-render it for that resolution.
>
> Is this a generic technique ?
>
> I'm using cairo from python.
> Although I haven't hit performance problems yet, I know I will,
> and i've also been wondering about some kind of display list thing
> for cairo.
>
> hmm, sounds like an FAQ.

Maybe I'm missing what is being asked. But as said, you can "record"  
the result of the display list and reuse that. I did an Akamaru port  
to Smalltalk for a Cairo demo. It was flickery. I simply added a  
push_group; pop_group_to_source; paint sequence around the code and  
suddenly it was all nice and smooth.

Seems you could use pop_group to grab it as a pattern, and then shove  
that as the source to your target.

--
Travis Griggs
Objologist
"HTTP. It's like a bike pretending to be a bus, a bulldozer, and a  
cup of coffee at the same time." - Martin Kobetic


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070108/62d1f7f1/attachment.html


More information about the cairo mailing list