diff options
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfscontext.cpp | 18 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.h | 1 |
3 files changed, 21 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); } diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 9c48ba1575..dd212c80a0 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -51,6 +51,7 @@ #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qeglconvenience_p.h> #include <QtPlatformSupport/private/qeglplatformcontext_p.h> +#include <QtPlatformSupport/private/qeglpbuffer_p.h> #if !defined(QT_NO_EVDEV) #include <QtPlatformSupport/private/qevdevmousemanager_p.h> @@ -62,6 +63,7 @@ #include <QtGui/QSurfaceFormat> #include <QtGui/QOpenGLContext> #include <QtGui/QScreen> +#include <QtGui/QOffscreenSurface> #include <qpa/qplatformcursor.h> #include "qeglfscontext.h" @@ -154,6 +156,12 @@ QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLCo return new QEglFSContext(hooks->surfaceFormatFor(context->format()), context->shareHandle(), mDisplay); } +QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const +{ + QEglFSScreen *screen = static_cast<QEglFSScreen *>(surface->screen()->handle()); + return new QEGLPbuffer(screen->display(), hooks->surfaceFormatFor(surface->requestedFormat()), surface); +} + QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const { return mFontDb; diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 9eae8d2703..e048c5d310 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -61,6 +61,7 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; QPlatformNativeInterface *nativeInterface() const; QPlatformFontDatabase *fontDatabase() const; |