I have a third_party shared library, and in this, I am trying to use the current GL context. It does not seem to be able to get the current context, so I am now thinking maybe there is in fact no current context in Chromium.
So I am wondering, how can I make my GL context current?
I have this function to get GL context:
scoped_refptr<viz::ContextProvider> GetContextProvider() {
return aura::Env::GetInstance()
->context_factory()
->SharedMainThreadContextProvider();
}
I use it like this:
auto context_provider = GetContextProvider();
gpu::gles2::GLES2Interface* gl = GetContextProvider()->ContextGL();
Can anyone suggest how I can make sure this gl context is current so that when I call into my third_party shared library I am sure there is a current GL context?
thanks!