skia2/tools/gpu/gl
Michael Ludwig ecc555540b Only terminate egl display once
Unblocks angle roller into skia that was triggering an assert in
EGLImageTest. In that test, there were two egl contexts created that
shared the same egl display. The child context was destroyed first,
and ANGLEGLContext's destroyGLContext() implementation always called
eglTerminate on the display. According to the egl spec you're not
supposed to do anything with the terminated display other than call
makeCurrent() to release any active context.

In this case, the child context's termination would cause the display
to be deferred until the parent context was destroyed. This triggered
a bug in ANGLE's D3D backend, leading to the assert. However, with
that fixed, we then trigger critical error messages about calling
eglDestroySurface, etc. in the parent context's destroyGLContext()
function since the display was terminated out from beneath it.

This change adds a rudimentary ownership tracking mechanism to the
ANGLEGLContext so that when a child context is cleaned up it won't
call eglTerminate on its display. This happens to avoid the bug in
ANGLE's D3D backend as well as silencing the critical warnings if it
were fixed.

Bug: skia:12413
Change-Id: I31f64189315a1921adbee204d11138272d4b40af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446182
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-09-07 23:48:46 +00:00
..
angle Only terminate egl display once 2021-09-07 23:48:46 +00:00
command_buffer Add a cmdbuffer_es3 config 2021-06-28 18:30:56 +00:00
egl Remove wrapping of GL sync objects around EGL syncs in EGL test contexts 2021-06-02 16:21:43 +00:00
glx Clean up remaining NVPR bits & bobs 2021-03-23 19:12:12 +00:00
interface Reland "Prefer the NV_framebuffer_blit extension over ANGLE" 2021-07-23 16:20:36 +00:00
iOS Reland "Remove ARC from tools lib." 2021-02-22 17:55:52 +00:00
mac Reland "Set up eGPU/discrete support for MacOS." 2020-03-18 19:27:41 +00:00
none rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
win Clean up remaining NVPR bits & bobs 2021-03-23 19:12:12 +00:00
GLTestContext.cpp Fix skia_use_gl = false build 2021-08-05 21:34:04 +00:00
GLTestContext.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00