diff options
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfshooks_stub.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index 26d77a2abb..1b042a0743 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -32,9 +32,13 @@ ****************************************************************************/ #include "qeglfshooks.h" +#include "qeglfsintegration.h" +#include "qeglfsscreen.h" + #include <QtPlatformSupport/private/qeglplatformcursor_p.h> #include <QtPlatformSupport/private/qeglconvenience_p.h> #include <QtCore/QRegularExpression> +#include <QtGui/private/qguiapplication_p.h> #if defined(Q_OS_LINUX) #include <fcntl.h> @@ -96,6 +100,18 @@ EGLNativeDisplayType QEglFSHooks::platformDisplay() const return EGL_DEFAULT_DISPLAY; } +void QEglFSHooks::screenInit() +{ + QEglFSIntegration *integration = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration()); + integration->addScreen(new QEglFSScreen(integration->display())); +} + +void QEglFSHooks::screenDestroy() +{ + while (!qApp->screens().isEmpty()) + delete qApp->screens().last()->handle(); +} + QSizeF QEglFSHooks::physicalScreenSize() const { return q_physicalScreenSizeFromFb(framebuffer, screenSize()); @@ -139,7 +155,7 @@ QSurfaceFormat QEglFSHooks::surfaceFormatFor(const QSurfaceFormat &inputFormat) { QSurfaceFormat format = inputFormat; - static const bool force888 = qgetenv("QT_QPA_EGLFS_FORCE888").toInt(); + static const bool force888 = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCE888"); if (force888) { format.setRedBufferSize(8); format.setGreenBufferSize(8); @@ -164,6 +180,12 @@ EGLNativeWindowType QEglFSHooks::createNativeWindow(QPlatformWindow *platformWin return 0; } +EGLNativeWindowType QEglFSHooks::createNativeOffscreenWindow(const QSurfaceFormat &format) +{ + Q_UNUSED(format); + return 0; +} + void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) { Q_UNUSED(window); @@ -175,15 +197,17 @@ bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const return false; } -QEGLPlatformCursor *QEglFSHooks::createCursor(QPlatformScreen *screen) const +QPlatformCursor *QEglFSHooks::createCursor(QPlatformScreen *screen) const { return new QEGLPlatformCursor(screen); } -void QEglFSHooks::waitForVSync() const +void QEglFSHooks::waitForVSync(QPlatformSurface *surface) const { + Q_UNUSED(surface); + #if defined(FBIO_WAITFORVSYNC) - static const bool forceSync = qgetenv("QT_QPA_EGLFS_FORCEVSYNC").toInt(); + static const bool forceSync = qEnvironmentVariableIntValue("QT_QPA_EGLFS_FORCEVSYNC"); if (forceSync && framebuffer != -1) { int arg = 0; if (ioctl(framebuffer, FBIO_WAITFORVSYNC, &arg) == -1) @@ -192,6 +216,16 @@ void QEglFSHooks::waitForVSync() const #endif } +void QEglFSHooks::presentBuffer(QPlatformSurface *surface) +{ + Q_UNUSED(surface); +} + +bool QEglFSHooks::supportsPBuffers() const +{ + return true; +} + #ifndef EGLFS_PLATFORM_HOOKS QEglFSHooks stubHooks; #endif |