smithay
smithay copied to clipboard
gles: Define a `GlesContext`, with a `CurrentGlesContext` guard
Still working through issues to use this everywhere. The goal is to prevent things like https://github.com/Smithay/smithay/pull/1748.
In particular, GlesFrame needs to be updated to hold a CurrentGlesContext. Things like blit_to/bllit_from are a little funny here since they call a function that makes a different context current, then restore the context.
I guess EGLContext::wait() should also require a current context.
Edit: For modularity the egl module could define an ActiveContext trait, and require that for create/wait instead of the requirement being in the doc comment but not enforced in any way.