diff options
6 files changed, 35 insertions, 7 deletions
diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp index 06cb424e4f..40fb2a336b 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp @@ -92,4 +92,9 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) delete window; } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + return false; +} + QEglFSHooks platform_hooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp index 2cbd297a90..f17af55947 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp @@ -140,4 +140,17 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) delete eglWindow; } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedPixmaps: + case QPlatformIntegration::OpenGL: + case QPlatformIntegration::ThreadedOpenGL: + case QPlatformIntegration::BufferQueueingOpenGL: + return true; + default: + return false; + } +} + QEglFSHooks platform_hooks; diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks.h b/src/plugins/platforms/eglfs/qeglfs_hooks.h index a30af9409f..628ef1f33b 100644 --- a/src/plugins/platforms/eglfs/qeglfs_hooks.h +++ b/src/plugins/platforms/eglfs/qeglfs_hooks.h @@ -54,8 +54,16 @@ struct QEglFSHooks { QSize screenSize() const; EGLNativeWindowType createNativeWindow(const QSize &size); void destroyNativeWindow(EGLNativeWindowType window); + bool hasCapability(QPlatformIntegration::Capability cap) const; }; +#ifdef EGLFS_PLATFORM_HOOKS +extern QEglFSHooks platform_hooks; +static QEglFSHooks *hooks = &platform_hooks; +#else +static QEglFSHooks *hooks = 0; +#endif + QT_END_NAMESPACE #endif diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp index baba3be492..594614e7a0 100644 --- a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp +++ b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp @@ -88,3 +88,8 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) XDestroyWindow(display, window); } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + return false; +} + diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index d9214f87fe..b1f5a69570 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -74,6 +74,10 @@ QEglFSIntegration::~QEglFSIntegration() bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const { + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + switch (cap) { case ThreadedPixmaps: return true; case OpenGL: return true; diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index c7e983b0fb..3c2f4c580d 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -53,13 +53,6 @@ QT_BEGIN_NAMESPACE -#ifdef EGLFS_PLATFORM_HOOKS -extern QEglFSHooks platform_hooks; -static QEglFSHooks *hooks = &platform_hooks; -#else -static QEglFSHooks *hooks = 0; -#endif - // #define QEGL_EXTRA_DEBUG #ifdef QEGL_EXTRA_DEBUG |