Bug 1449205 - Share OpenGL contexts between WebRender windows on macOS. r=sotaro

Differential Revision: https://phabricator.services.mozilla.com/D53121
This commit is contained in:
Markus Stange
2019-11-19 17:46:39 +00:00
parent 6a1e2d4716
commit 350c98c65b
2 changed files with 21 additions and 5 deletions

View File

@@ -952,6 +952,16 @@ static already_AddRefed<gl::GLContext> CreateGLContextEGL() {
}
#endif
#ifdef XP_MACOSX
static already_AddRefed<gl::GLContext> CreateGLContextCGL() {
nsCString failureUnused;
return gl::GLContextProvider::CreateHeadless(
gl::CreateContextFlags::ALLOW_OFFLINE_RENDERER |
gl::CreateContextFlags::FORCE_ENABLE_HARDWARE,
&failureUnused);
}
#endif
static already_AddRefed<gl::GLContext> CreateGLContext() {
#ifdef XP_WIN
if (gfx::gfxVars::UseWebRenderANGLE()) {
@@ -966,8 +976,11 @@ static already_AddRefed<gl::GLContext> CreateGLContext() {
return CreateGLContextEGL();
}
#endif
// We currently only support a shared GLContext
// with ANGLE.
#ifdef XP_MACOSX
return CreateGLContextCGL();
#endif
return nullptr;
}