How can I make GL context current?

7 views
Skip to first unread message

Eat Sponsors

unread,
Jan 31, 2023, 12:37:53 PM1/31/23
to Chromium-dev
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!


Reply all
Reply to author
Forward
0 new messages