~macslow/cairo-gl-test/cairo-gl-test

1
2
3
4
5
6
7
8
9
This is my playground for experimenting with cairo's new OpenGL backend "cairo-gl". In order to compile and run this, you need to have a cairo 1.13.1 compiled with --enable-gl.

On a Nvidia GeForce GTX 580 (using nvidia's binary driver) I get around 150 fps and I'm not using any surface-buffering. Doing that would speed things up even more. The scarab/cairo-logo in the lower left corner, is a SVG-file rendered as is each frame. I can remember time when this would make a machine come to a halt :)

There are some drawing operations which hit slow paths, e.g. trying to draw any italic/oblique text kills the framerate, if you render your text with pango_cairo_show_layout(). Don't do that, but instead use pango_cairo_layout_path()/cairo_fill().

Also using cairo_push_group(), cairo_pop_group_to_source() followed by a cairo_paint() kills rendering-performance with the "cairo-gl" backend.

There are still a lot of things I need to try out, but this is looking very promising and the boiler-plate code needed is ok-ish. Using this with cairo-gl compiled against OpenGL|ES 2.0 is another thing I want to try out and then deploy it my UbuntuTouch-devices Nexus4 and Nexus10.