~eliasnaur/gio

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] ui/app/egl.go: on failure, try again without sRGB

Details
Message ID
<20190918163131.65480-1-sir@cmpwn.com>
DKIM signature
missing
Download raw message
Patch: +6 -0
Signed-off-by: Drew DeVault <sir@cmpwn.com>
---
I spent some time looking for ways to detect if EGL_COLORSPACE_SRGB_KHR
is missing even when EGL_KHR_gl_colorspace is present, but couldn't find
anything. Also tried to determine if EGL_KHR_gl_colorspace being present
requried EGL_COLORSPACE_SRGB_KHR support, implying a bug in the EGL
implementation, but I had no conclusive answers there, either.

 ui/app/egl.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ui/app/egl.go b/ui/app/egl.go
index ee07993..ab0b7f4 100644
--- a/ui/app/egl.go
+++ b/ui/app/egl.go
@@ -256,6 +256,12 @@ func createSurfaceAndMakeCurrent(eglCtx *eglContext, win _EGLNativeWindowType) (
	}
	surfAttribs = append(surfAttribs, _EGL_NONE)
	eglSurf := eglCreateWindowSurface(eglCtx.disp, eglCtx.config, win, surfAttribs)
	if eglSurf == nilEGLSurface && eglCtx.srgb {
		// Try again without sRGB
		eglCtx.sRGB = false
		surfAttribs = []_EGLint{_EGL_NONE}
		eglSurf = eglCreateWindowSurface(eglCtx.disp, eglCtx.config, win, surfAttribs)
	}
	if eglSurf == nilEGLSurface {
		return nilEGLSurface, fmt.Errorf("newContext: eglCreateWindowSurface failed 0x%x (sRGB=%v)", eglGetError(), eglCtx.srgb)
	}
-- 
2.23.0
Reply to thread Export thread (mbox)