The thing that's really frustrating about implementing the accelerated canvas for Gnometris is that I don't get paid to work on Gnome and so I have little time to hack around on it. What makes the implementation mind-numbing is that I've hit roadblocks a couple of times that have caused me to start over. And it's happened again—maybe.
The first road-block was an experiment that I did with goocanvas that dead-ended when I realized features I needed weren't implemented and the goocanvas project was stalled.
The second road-block was my decision to throw out the GTK+ UI and the mass of angry people that hated that idea. Their arguments were convincing, so I scrapped that work.
So, I'm working on the third approach and I've basically run in to a dead-end. Or at least, I think it's a dead end.
My approach this time around was to make essentially as little changes to the Gnometris code-base as possible using a lot of #ifdef's and #ifndef's. Wherever a method used to render to the backing buffer, it would get redirected to a ClutterCairo context. Everything looked like it would work.
Now, I see that perhaps the only way to really make this work is to have two entirely different code paths in Gnometris: one for legacy support and one for clutter. On the plus side, that would mean some kind of start-up time rather than compile-time configurability. On the other hand, that means essentially two separate code-bases to maintain with two different theme engines, etc.
Anyway, I'm looking for suggestions that might come from a fresh set of eyes looking at my approach. It's really quite ugly due to all the #ifdef's. I put the code up on github. It compiles, however blocks aren't on the playing field yet (but the block rendering cache works) and my hacking has managed to kill off the preview window functionality.
I'm not opposed to throwing out legacy support since Mesa software rendering with these few number of objects would apparently still render around 30 FPS which would be faster than our current (legacy) Cairo-based renderer.