Back to Clutter/Apocalypses
or Give me 60 fps or give me death.
The paint sequence must never block the main loop.
All painting goes through "primitives", which are built up while painting; no direct submission of geometry or pipeline directives during the scene graph traversal: everything is deferred.
Primitives are provided by Clutter, as wrappers around the Cogl 2.0 API.
Pipeline primitives only serve to set up the CoglPipeline.
Geometry primitives will set up a set of CoglAttributes.
Primitives can only be instantiated by Clutter, and instances will be provided to the Content implementation; application code set up the pipeline state needed to paint the content, and provides the geometry for the fill operation. Dropping into raw GL, or directly drawing on the framebuffer with Cogl is not allowed.
At the end of the frame cycle, the master clock will take the set of primitives, eventually reorganize them in an efficient way, then take the lock on the GL context, fire off a thread, submit the whole set of primitives to the GPU without blocking the main loop. the swap buffers command can be performed in a synchronization point through a scheduled job within the main loop, or performed in the same thread that submitted the primitives.
Compatibility may be retained by having two GL context - one for access from within the main thread, and the other only used by the rendering thread.