Skip to content

Commit 2ad411d

Browse files
committed
NonCompositedWebGL: don't use an ANGLE sharing context cause it's not needed.
Also, destroy the ANGLE context before making it not current, as the previous order fails to release the resources on the rpi.
1 parent 39e5423 commit 2ad411d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ GraphicsContextGLANGLE::~GraphicsContextGLANGLE()
6868
if (m_rendersToHostWindow) {
6969
// When rendering to the host window, destroy the context only, not the surface, as it's the static one.
7070
if (m_contextObj) {
71-
EGL_MakeCurrent(m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
7271
EGL_DestroyContext(m_displayObj, m_contextObj);
72+
EGL_MakeCurrent(m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
7373
s_windowSurfaceUsers--;
7474
if (!s_windowSurfaceUsers) {
7575
EGL_DestroySurface(m_displayObj, s_windowSurfaceObj);
@@ -312,10 +312,12 @@ bool GraphicsContextGLTextureMapperANGLE::platformInitializeContext()
312312
}
313313
eglContextAttributes.append(EGL_NONE);
314314

315-
m_angleSharingContextObj = sharedDisplay.angleSharingGLContext();
316-
if (m_angleSharingContextObj == EGL_NO_CONTEXT) {
317-
LOG(WebGL, "ANGLE sharing EGLContext Initialization failed.");
318-
return false;
315+
if (!m_rendersToHostWindow) {
316+
m_angleSharingContextObj = sharedDisplay.angleSharingGLContext();
317+
if (m_angleSharingContextObj == EGL_NO_CONTEXT) {
318+
LOG(WebGL, "ANGLE sharing EGLContext Initialization failed.");
319+
return false;
320+
}
319321
}
320322

321323
m_contextObj = EGL_CreateContext(m_displayObj, m_configObj, m_angleSharingContextObj, eglContextAttributes.data());

0 commit comments

Comments
 (0)