[cairo] Lander Game

Eric Anholt eric at anholt.net
Mon Jan 8 15:14:15 PST 2007

On Mon, 2007-01-08 at 23:07 +0000, Alex Mac wrote:
> On 08/01/07, 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.
> I've added in some code to render the background once to an Image
> surface, but my goal is to have animated backgrounds so I dont really
> want to have to do that.
> Anyway, rendering to an image surface only seems to provide a small
> improvement in performance, It's still slower than Qt4.

If you're doing your final drawing to an xlib surface, having the
surfaces you're compositing together for the final drawing also be xlib
surfaces will give X a chance to do hardware acceleration on drivers
where that's available (xf86-video-ati with EXA, xf86-video-intel
modesetting branch with EXA).

Unfortunately, X rendering using XAA (that is, without EXA) is pretty
much doomed to poor performance.

Eric Anholt                             anholt at FreeBSD.org
eric at anholt.net                         eric.anholt at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070108/b4250cdb/attachment.pgp

More information about the cairo mailing list