[cairo] How to speed up CAIRO drawing to screen/gtk_drawing_area (buffering)?

Stefan Salewski mail at ssalewski.de
Mon Jul 19 10:27:51 PDT 2010


Hello,

some weeks ago I started with my first non trivial GTK application,
which includes drawing by cairo to a gtk_drawing_area. My task is
drawing measurement data, simulating a digital oscilloscope. So drawing
modes should include drawing with maximum refresh rates, only limited by
TFT hardware refresh (60 Hz). My first tests, based on code from
http://zetcode.com/tutorials/cairographicstutorial/
gave indeed fine results. (If you are curious, there is a picture of an
early draft available at the bottom of this page
http://www.ssalewski.de/DAD.html.en )

But for optimal performance on slow hardware I may consider something
like buffering. One idea is, that I draw slowly changing stuff like axis
with tics and text to a buffer, which I copy to screen and overwrite
with fast varying data plots.

I found this fine tutorial

http://cairographics.org/threaded_animation_with_cairo/

and a thread from this list.

http://lists.cairographics.org/archives/cairo/2009-March/016756.html

For me as a cairo beginner it is not easy to fully understand the
sketches from the above thread. So my question:

Are there examples for very fast cairo drawing (text and lines) with
buffering, back- and foreground, multiple layers, available?

And one related question: Does is make sense to disable
anti-aliased/smoothing cairo drawing mode for slow hardware and high
desired refresh rate?

Best regards

Stefan Salewski




More information about the cairo mailing list