[Sugar-devel] Cairo-ized activity performance

Walter Bender walter.bender at gmail.com
Tue Nov 1 21:09:00 EDT 2011


On Tue, Nov 1, 2011 at 8:57 PM, C. Scott Ananian <cscott at laptop.org> wrote:
> Walter -- is the source code for the cairo-ized version available?  I
> made a decent start at GTK3-izing TurtleArt
> (http://git.sugarlabs.org/~cscott/turtleart/cscott-gtk3/commits/gtk3)
> and the missing piece is to replace a lot of GdkPixmap stuff with
> cairo calls.  If that code is already written, finishing the GTK3 port
> should be a snap!

I made a cairo clone
(http://git.sugarlabs.org/~walter/turtleart/walters-cairo) which is
95% complete. From there, a gtk-3 version is pretty straight-forward.
But I will look at your branch to see how you do the runs anywhere
version -- that's be very nice.

The 5% is to clean up rotation for image; caching the cairo surfaces
in the sprite library; figuring out how to read pixels from a cairo
surface for the get_pixel call.

I am thinking of a slight refactoring: making the TurtleArtWindow
class into a subclass of gtk.DrawingArea and then using a do_release
call to create the surface I use for the canvas... seems cleaner than
what I have now.

-walter
>
> (If you look at the code, note that I've taken great care to end up
> with a version which runs in *either* GTK2 or GTK3, so TurtleArt is
> still "run anywhere".)
>  --scott
>
> --
>       ( http://cscott.net )
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Sugar-devel mailing list