I have a wrapper class `OffscreenGLCanvas` that creates a QOpenGLContext and a QOffscreenSurface for supporting offscreen rendering, multiple contexts, etc. After creating the context and the surface I normally check the validity of the offscreen surface with `isValid`.
However, while working on porting my application to Android I discovered that the isValid call would return false, causing an error in my application.
Eventually I tracked this down to code inside the `QEGLPbuffer` class. In the constructor there is an early return if the `EGL_KHR_surfaceless_context` extension is available. The QOffscreenSurface even calls this out as a possibility. However, it doesn't make sense to me that the `isValid` call would return false in this case. It leaves me with no way to determine whether a given QOffscreenSurface is reporting invalidity because I can't use it or because I don't need it.
It seems like the logic in the QEGLPbuffer constructor should populate a member like `m_surfaceless` instead of using a local variable in the constructor, and then the `isValid` call could be changed to `return m_surfaceless || m_pbuffer != EGL_NO_SURFACE;`
|For Gerrit Dashboard: QTBUG-65125|
|214213,2||Fix QEGLPbuffer::isValid() with surfaceless contexts||5.9||qt/qtbase||Status: MERGED||+2||0|