diff options
author | Donald Carr <donald.carr@nokia.com> | 2012-04-10 17:20:31 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-11 09:22:23 +0200 |
commit | 42f3bf772bab75d639b9211d66a0e085538526e2 (patch) | |
tree | 3a8620b60d41425ebe9206bafb5fb7f464157693 | |
parent | 127c431e25208e98304a1e9dc1140fdfba078be8 (diff) |
Extend eglhooks to include hasCapability
Add BufferQueueingOpenGL to Raspberry PI's numerous capabilities
Change-Id: I1197c28a0c82df3ae2f6d5360791010e17373555
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
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 |