summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfscontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfscontext.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp
index 1f0c373818..06db4e02db 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp
@@ -45,6 +45,8 @@
#include "qeglfshooks.h"
#include "qeglfsintegration.h"
+#include <QtPlatformSupport/private/qeglpbuffer_p.h>
+#include <QtGui/QSurface>
#include <QtDebug>
QT_BEGIN_NAMESPACE
@@ -62,16 +64,20 @@ bool QEglFSContext::makeCurrent(QPlatformSurface *surface)
EGLSurface QEglFSContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
- QEglFSWindow *window = static_cast<QEglFSWindow *>(surface);
- return window->surface();
+ if (surface->surface()->surfaceClass() == QSurface::Window)
+ return static_cast<QEglFSWindow *>(surface)->surface();
+ else
+ return static_cast<QEGLPbuffer *>(surface)->pbuffer();
}
void QEglFSContext::swapBuffers(QPlatformSurface *surface)
{
- QEglFSWindow *window = static_cast<QEglFSWindow *>(surface);
- // draw the cursor
- if (QEglFSCursor *cursor = static_cast<QEglFSCursor *>(window->screen()->cursor()))
- cursor->paintOnScreen();
+ if (surface->surface()->surfaceClass() == QSurface::Window) {
+ QEglFSWindow *window = static_cast<QEglFSWindow *>(surface);
+ // draw the cursor
+ if (QEglFSCursor *cursor = static_cast<QEglFSCursor *>(window->screen()->cursor()))
+ cursor->paintOnScreen();
+ }
QEGLPlatformContext::swapBuffers(surface);
}