vispy/vispy — pull request #529 by almarklein (2014-09-03 20:57:34+00:00)
Title: WIP: Refactoring context and CanvasBackend

The goal of this PR is to make the context more explicit, to associate one context object with each Canvas (or one context object can be shared), and to make this context object active upon drawing so that gloo can be made context aware.

As I changed the code, I also started refactoring CanvasBackend, since it seemed overly complex to me. Before I proceed, we should probably discuss whether this is going in the right direction. cc @Eric89GXL

My main question is this: the only place where a CanvasBackend is created is from inside the Canvas. Nevertheless, the code seems to jump to hoops to make it possible to set the `_vispy_canvas` object at a later time. Why is that?