EGLSurface QAndroidPlatformOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface) { if (surface->surface()->surfaceClass() == QSurface::Window) return static_cast<QAndroidPlatformOpenGLWindow *>(surface)->eglSurface(eglConfig()); else return static_cast<QEGLPbuffer *>(surface)->pbuffer(); }
QMirClientOpenGLContext::QMirClientOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(format, share, display, 0) { if (mirclientGraphics().isDebugEnabled()) { printEglConfig(display, eglConfig()); } }
void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface) { if (surface->surface()->surfaceClass() == QSurface::Window && static_cast<QAndroidPlatformOpenGLWindow *>(surface)->checkNativeSurface(eglConfig())) { QEGLPlatformContext::makeCurrent(surface); } QEGLPlatformContext::swapBuffers(surface); }
bool QWindowsEGLContext::makeCurrent(QPlatformSurface *surface) { bool ok = false; QWindowsWindow *window = static_cast<QWindowsWindow *>(surface); if (EGLSurface eglSurface = window->ensureEglSurfaceHandle(m_staticContext, eglConfig())) { ok = eglMakeCurrent(eglDisplay(), eglSurface, eglSurface, eglContext()); if (!ok) qWarning("%s: eglMakeCurrent() failed, eglError: 0x%x, this: %p \n", Q_FUNC_INFO, eglGetError(), this); } return ok; }