diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2012-03-16 22:50:30 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-13 08:33:37 +0200 |
commit | 01b54bcd84d9a2129f2db4fe03a5f331f9eec203 (patch) | |
tree | 47976e5066c03643ee36b4323c7a795fb4b48fd3 /src/plugins/platforms/directfb/qdirectfb_egl.cpp | |
parent | d1329e43cbb243f3b28d172569befc0c28f49b8b (diff) |
device: Introduce hooks for the directfb plugin and use them
The EGL integration is vendor specific, add platform hooks to the
DirectFB plugin and implement them for the Broadcom 97425. The hook
interface is internal and there are no ABI/API gurantees.
Change-Id: I33359830c51f16895e771837fccb71e03c81cf18
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/plugins/platforms/directfb/qdirectfb_egl.cpp')
-rw-r--r-- | src/plugins/platforms/directfb/qdirectfb_egl.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp index ee0cbbae95..ac9142c0f4 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp +++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp @@ -42,6 +42,7 @@ #include "qdirectfb_egl.h" #include "qdirectfbwindow.h" #include "qdirectfbscreen.h" +#include "qdirectfbeglhooks.h" #include <QtGui/QOpenGLContext> #include <QtGui/QPlatformOpenGLContext> @@ -54,6 +55,13 @@ QT_BEGIN_NAMESPACE +#ifdef DIRECTFB_PLATFORM_HOOKS +extern QDirectFBEGLHooks platform_hook; +static QDirectFBEGLHooks *hooks = &platform_hook; +#else +static QDirectFBEGLHooks *hooks = 0; +#endif + /** * This provides OpenGL ES 2.0 integration with DirectFB. It assumes that * one can adapt a DirectFBSurface as a EGLSurface. It might need some vendor @@ -137,12 +145,14 @@ void QDirectFbScreenEGL::initializeEGL() void QDirectFbScreenEGL::platformInit() { - // Place vendor init code here. + if (hooks) + hooks->platformInit(); } void QDirectFbScreenEGL::platformDestroy() { - // Place vendor finalize code here. + if (hooks) + hooks->platformDestroy(); } QDirectFbWindowEGL::QDirectFbWindowEGL(QWindow *tlw, QDirectFbInput *input) @@ -209,4 +219,12 @@ void QDirectFbIntegrationEGL::initializeScreen() screenAdded(m_primaryScreen.data()); } +bool QDirectFbIntegrationEGL::hasCapability(QPlatformIntegration::Capability cap) const +{ + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + return QDirectFbIntegration::hasCapability(cap); +} + QT_END_NAMESPACE |