diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-01-06 14:51:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-17 14:30:48 +0100 |
commit | 328f2f9c35f3cc5e7049a060a608c3f72876484a (patch) | |
tree | 984f0f52446b95da5d7240122dcfbec02b0933b5 /src/plugins/platforms/eglfs/qeglfsintegration.h | |
parent | 93154216ca7c7a46836716150fe70987d28d6f3c (diff) |
eglfs: Move reusable functionality to eglconvenience
The cursor implementation is generic GL(ES) code that should be shared
by all the present and future egl-based embedded platform
plugins. Follow the pattern of QEGLPlatformContext and move this class
into eglconvenience as QEGLPlatformCursor.
Similarly, the common bits from the context implementation context are
moved back to EGLPlatformContext.
eglconvenience has now base classes for integration, screen, window,
etc. too. By using these, eglfs becomes much smaller and cleaner. This
also paves the way for creating new, separate EGL-based platform
plugins for Android, embedded Linux, etc.
Also added some documentation to each of the base classes.
devicediscovery is now fixed to be usable on any platform. The
implementation in this case is naturally a dummy one. This finally
allows using it from anywhere without myriads of ugly ifdefs.
Change-Id: I02946e360c04e02de7fe234a23a08320eff4ccf5
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.h')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.h | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index 12c8158bd1..581b523c76 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -42,61 +42,36 @@ #ifndef QEGLFSINTEGRATION_H #define QEGLFSINTEGRATION_H -#include "qeglfsscreen.h" - -#include <qpa/qplatformintegration.h> -#include <qpa/qplatformnativeinterface.h> +#include <QtPlatformSupport/private/qeglplatformintegration_p.h> #include <qpa/qplatformscreen.h> +#include <EGL/egl.h> QT_BEGIN_NAMESPACE -class QEglFSIntegration : public QPlatformIntegration, public QPlatformNativeInterface +class QEglFSIntegration : public QEGLPlatformIntegration { public: QEglFSIntegration(); ~QEglFSIntegration(); - bool hasCapability(QPlatformIntegration::Capability cap) const; - - QPlatformWindow *createPlatformWindow(QWindow *window) const; - QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; - QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; - QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const; - QPlatformNativeInterface *nativeInterface() const; - - QPlatformFontDatabase *fontDatabase() const; - QPlatformServices *services() const; - - QAbstractEventDispatcher *createEventDispatcher() const; - void initialize(); + QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE; + QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE; - QVariant styleHint(QPlatformIntegration::StyleHint hint) const; + void initialize() Q_DECL_OVERRIDE; - // QPlatformNativeInterface - void *nativeResourceForIntegration(const QByteArray &resource); - void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE; - void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); + bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE; + QVariant styleHint(QPlatformIntegration::StyleHint hint) const Q_DECL_OVERRIDE; - NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) Q_DECL_OVERRIDE; - - QPlatformScreen *screen() const { return mScreen; } static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format); - EGLDisplay display() const { return mDisplay; } - - QPlatformInputContext *inputContext() const { return mInputContext; } - protected: - virtual QEglFSScreen *createScreen() const; + QEGLPlatformScreen *createScreen() const Q_DECL_OVERRIDE; + QEGLPlatformWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE; + EGLNativeDisplayType nativeDisplay() const Q_DECL_OVERRIDE; private: void createInputHandlers(); - EGLDisplay mDisplay; - QScopedPointer<QPlatformFontDatabase> mFontDb; - QScopedPointer<QPlatformServices> mServices; - QEglFSScreen *mScreen; - QPlatformInputContext *mInputContext; bool mDisableInputHandlers; }; |