diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2011-11-27 20:42:22 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-02 00:08:32 +0100 |
commit | 6534898cc69e22115cf158f71a1e0edd7f13877b (patch) | |
tree | 32aa4982f28f47365dc84ff09094e8cd8c6d02b2 /src/plugins/platforms/directfb/main.cpp | |
parent | 614bb9c0851eb1fe21ff7a998191d551ceed6a22 (diff) |
directfb: Introduce EGL integration for DirectFB
Introduce a new platform called 'directfbegl' that allows platform
integration with EGL. Change the QDirectFbIntegration to make it more
easy to hook up in the creation process, introduce an EGL integration
with custom screen, window and EGL Platform Context.
Vendors might need to add custom code to initialize EGL to be used with
DirectFB, this can be done in QDirectFbScreenEGL::platformInit.
Change-Id: I7bee277ede27c72437cd7c5977fa6ed85e65f538
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins/platforms/directfb/main.cpp')
-rw-r--r-- | src/plugins/platforms/directfb/main.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/plugins/platforms/directfb/main.cpp b/src/plugins/platforms/directfb/main.cpp index 312fc411ac..1a254e4fe7 100644 --- a/src/plugins/platforms/directfb/main.cpp +++ b/src/plugins/platforms/directfb/main.cpp @@ -41,9 +41,20 @@ #include <QtGui/QPlatformIntegrationPlugin> #include "qdirectfbintegration.h" +#include "qdirectfb_egl.h" QT_BEGIN_NAMESPACE +#ifdef DIRECTFB_GL_EGL +#define QT_EGL_BACKEND_STRING(list) list << "directfbegl"; +#define QT_EGL_BACKEND_CREATE(list, out) \ + if (list.toLower() == "directfbegl") \ + out = new QDirectFbIntegrationEGL; +#else +#define QT_EGL_BACKEND_STRING(list) +#define QT_EGL_BACKEND_CREATE(system, out) +#endif + class QDirectFbIntegrationPlugin : public QPlatformIntegrationPlugin { public: @@ -55,16 +66,24 @@ QStringList QDirectFbIntegrationPlugin::keys() const { QStringList list; list << "directfb"; + QT_EGL_BACKEND_STRING(list); return list; } QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); + QDirectFbIntegration *integration = 0; + if (system.toLower() == "directfb") - return new QDirectFbIntegration; + integration = new QDirectFbIntegration; + QT_EGL_BACKEND_CREATE(system, integration) + + if (!integration) + return 0; - return 0; + integration->initialize(); + return integration; } Q_EXPORT_PLUGIN2(directfb, QDirectFbIntegrationPlugin) |