#include "qkmsdevice.h"
#include "qscreen.h"
+#include "qkmscontext.h"
+#include <QOpenGLContext>
class QKmsResourceMap : public QMap<QByteArray, QKmsNativeInterface::ResourceType>
{
return result;
}
+QPlatformNativeInterface::NativeResourceForContextFunction QKmsNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource)
+{
+ QByteArray lowerCaseResource = resource.toLower();
+ if (lowerCaseResource == "get_egl_context") {
+ return eglContextForContext;
+ }
+ return 0;
+}
+
+
+
void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window)
{
QKmsScreen *screen = qPlatformScreenForWindow(window);
QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
return static_cast<QKmsScreen *>(screen->handle());
}
+
+void *QKmsNativeInterface::eglContextForContext(QOpenGLContext *context)
+{
+ Q_ASSERT(context);
+
+ QKmsContext *eglPlatformContext = static_cast<QKmsContext *>(context->handle());
+
+ return eglPlatformContext->eglContext();
+}
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
+ NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
+
void *eglDisplayForWindow(QWindow *window);
void *eglContextForWindow(QWindow *window);
+ static void *eglContextForContext(QOpenGLContext *context);
private:
static QKmsScreen *qPlatformScreenForWindow(QWindow *window);