In bug 1868825 we encountered crashes on a specific device when
calling eglTerminate. As a workaround, we avoided calling eglTerminate
and instead deliberately leaked the EGLDisplay. As we had only
encountered this crash on a specific device, we limited the workaround
to just that device.
We are now seeing the same crash on a range of devices, all with
Samsung Xclipse GPUs. This patch therefore makes us leak the
EGLDisplays on all devices with an Xclipse GPU.
As the GPU model is not available in EglDisplay code, we instead set a
flag on the EglDisplay object when the GLContext is initialized. Prior
to terminating the display we check whether this flag has been set.
Terminating a display which has not had a context created does not
reproduce the crash, so this is sufficient.
Original Revision: https://phabricator.services.mozilla.com/D214539
Differential Revision: https://phabricator.services.mozilla.com/D214800