summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs/api/qeglfscontext.cpp')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscontext.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfscontext.cpp b/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
index a17b567b24..9c10c1a998 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfscontext.cpp
@@ -22,10 +22,19 @@ QEglFSContext::QEglFSContext(const QSurfaceFormat &format, QPlatformOpenGLContex
EGLSurface QEglFSContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
- if (surface->surface()->surfaceClass() == QSurface::Window)
- return static_cast<QEglFSWindow *>(surface)->surface();
- else
+ if (surface->surface()->surfaceClass() == QSurface::Window) {
+
+ QEglFSWindow *w = static_cast<QEglFSWindow *>(surface);
+ EGLSurface s = w->surface();
+ if (s == EGL_NO_SURFACE) {
+ w->resetSurface();
+ s = w->surface();
+ }
+ return s;
+
+ } else {
return static_cast<QEGLPbuffer *>(surface)->pbuffer();
+ }
}
EGLSurface QEglFSContext::createTemporaryOffscreenSurface()