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>
bb10
Donald Carr 2012-04-10 17:20:31 +00:00 committed by Qt by Nokia
parent 127c431e25
commit 42f3bf772b
6 changed files with 35 additions and 7 deletions

View File

@ -92,4 +92,9 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window)
delete window;
}
bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const
{
return false;
}
QEglFSHooks platform_hooks;

View File

@ -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;

View File

@ -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

View File

@ -88,3 +88,8 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window)
XDestroyWindow(display, window);
}
bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const
{
return false;
}

View File

@ -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;

View File

@ -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