#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
return QPlatformIntegration::styleHint(hint);
}
+QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const
+{
+ return const_cast<QEglFSIntegration *>(this);
+}
+
+void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource)
+{
+ QByteArray lowerCaseResource = resource.toLower();
+
+ if (lowerCaseResource == "egldisplay")
+ return static_cast<QEglFSScreen *>(mScreen)->display();
+
+ return 0;
+}
+
+void *QEglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
+{
+ QByteArray lowerCaseResource = resource.toLower();
+
+ QEGLPlatformContext *handle = static_cast<QEGLPlatformContext *>(context->handle());
+
+ if (!handle)
+ return 0;
+
+ if (lowerCaseResource == "eglcontext")
+ return handle->eglContext();
+
+ return 0;
+}
+
QT_END_NAMESPACE
#include "qeglfsscreen.h"
#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformscreen.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QEglFSIntegration : public QPlatformIntegration
+class QEglFSIntegration : public QPlatformIntegration, public QPlatformNativeInterface
{
public:
QEglFSIntegration();
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+ QPlatformNativeInterface *nativeInterface() const;
QPlatformFontDatabase *fontDatabase() const;
QVariant styleHint(QPlatformIntegration::StyleHint hint) const;
+ // QPlatformNativeInterface
+ void *nativeResourceForIntegration(const QByteArray &resource);
+ void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
+
private:
QPlatformFontDatabase *mFontDb;
QPlatformScreen *mScreen;
QPlatformOpenGLContext *platformContext() const;
EGLSurface surface() const { return m_surface; }
+ EGLDisplay display() const { return m_dpy; }
private:
void createAndSetPlatformContext() const;