[cairo] Re: Lander Game

Alex Mac lots.of.mailing.lists at gmail.com
Fri Jan 26 01:53:56 PST 2007


On 26/01/07, Carl Worth <cworth at cworth.org> wrote:
> On Thu, 25 Jan 2007 23:50:41 +0000, "Alex Mac" wrote:
> > I've revamped the whole app now and release 0.2.1 now caches the
> > background and the ship. Also I've stopped it from updating the whole
> > screen every frame.
>
> Yes, much nicer. (Though Owen's point still stands that it would be
> nice to have the whole cairo/Render/X driver stack "finished" and
> taking full advantage of video card capabilities so that no caching
> would even be necessary here.)

yes, all my work so far proves is that for the simple case of flinging
one raster and some circles about software rendering is going to be
just as fast as doing it in hardware, but if I ever start having loads
of things all bouncing around animating deforming and changing in ways
I can't cache then hardware acceleration is the only way it will work.

> > try running 0.2.1 and then run it again with "--native-surfaces" this
> > causes the background to be cached as an xlib surface rather than an
> > image surface. Although not as noticeable now the xlib surface does
> > cause the occasional jerk... I'll try and get a test to replicate it
> > properly
>
> OK, so we're seeing different behavior. My (extremely unscientific)
> investigation suggests less jerkiness with --native-surfaces. Here are
> some numbers (as reported by the program itself and top):
>
> without --native-surfaces: 70 fps (python: 50% CPU, X: 40% CPU)
>   with --natives-surfaces: 80 fps (python: 50% CPU, X: 15% CPU)

the difference is not as noticeable for me, maybe thats just the
effect of a faster pc... since both you and thomas have better
performance with xlib surfaces I'll make that the default in future

> It looks like a lot of the client-side CPU usage left is with
> cairo_stroke computing those cute little thrust circles over and over
> again.

yeah, watching the little gnome-panel cpu thingy I can see it spike
whenever I press a button :)

So lets say I rasterise some different sized circles at the start how
would I then composite them with different colours? Does cairo do
masking or would that be too slow? should I create a doughnut shaped
path rather than try stroking a circle?

> -Carl
>
>
>


More information about the cairo mailing list