From 01b54bcd84d9a2129f2db4fe03a5f331f9eec203 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 16 Mar 2012 22:50:30 +0100 Subject: 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 --- src/plugins/platforms/directfb/qdirectfb_egl.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/directfb/qdirectfb_egl.cpp') 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 #include @@ -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 -- cgit v1.2.3