17QEglFSContext::QEglFSContext(
const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
19 : QEGLPlatformContext(format, share, display, config,
20 qt_egl_device_integration()->supportsSurfacelessContexts() ? Flags() : QEGLPlatformContext::NoSurfaceless)
24EGLSurface QEglFSContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
26 if (surface->surface()->surfaceClass() == QSurface::Window) {
28 QEglFSWindow *w =
static_cast<QEglFSWindow *>(surface);
29 EGLSurface s = w->surface();
30 if (s == EGL_NO_SURFACE) {
37 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
41EGLSurface QEglFSContext::createTemporaryOffscreenSurface()
43 if (qt_egl_device_integration()->supportsPBuffers())
44 return QEGLPlatformContext::createTemporaryOffscreenSurface();
47 m_tempWindow = qt_egl_device_integration()->createNativeOffscreenWindow(format());
49 qWarning(
"QEglFSContext: Failed to create temporary native window");
50 return EGL_NO_SURFACE;
53 EGLConfig config = q_configFromGLFormat(eglDisplay(), format());
54 return eglCreateWindowSurface(eglDisplay(), config, m_tempWindow,
nullptr);
57void QEglFSContext::destroyTemporaryOffscreenSurface(EGLSurface surface)
59 if (qt_egl_device_integration()->supportsPBuffers()) {
60 QEGLPlatformContext::destroyTemporaryOffscreenSurface(surface);
62 eglDestroySurface(eglDisplay(), surface);
63 qt_egl_device_integration()->destroyNativeWindow(m_tempWindow);
78void QEglFSContext::swapBuffers(QPlatformSurface *surface)
81 if (surface->surface()->surfaceClass() == QSurface::Window) {
82 QPlatformWindow *window =
static_cast<QPlatformWindow *>(surface);
83 if (QPlatformScreen *screen = window->screen()) {
84 if (QEglFSCursor *cursor = qobject_cast<QEglFSCursor *>(screen->cursor()))
85 cursor->paintOnScreen();
89 qt_egl_device_integration()->waitForVSync(surface);
90 QEGLPlatformContext::swapBuffers(surface);
91 qt_egl_device_integration()->presentBuffer(surface);