Add QQnxNativeInterface::nativeResourceForContext
This mechanism is used by QtWebEngine to extract the platform GL context. In the QNX case, the platform context is an EGL context, so the resource you need to ask for is the "eglcontext". Compare to the xcb native interface which has a similar implementation already. Change-Id: I873eaadf96898abb24de347ac624c88cd54254cb Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
This commit is contained in:
parent
f3a4bc17ab
commit
711d0a1658
@ -75,6 +75,8 @@ public:
|
||||
|
||||
static EGLDisplay getEglDisplay();
|
||||
EGLConfig getEglConfig() const { return m_eglConfig;}
|
||||
EGLContext getEglContext() const { return m_eglContext; }
|
||||
|
||||
private:
|
||||
//Can be static because different displays returne the same handle
|
||||
static EGLDisplay ms_eglDisplay;
|
||||
|
@ -41,9 +41,11 @@
|
||||
|
||||
#include "qqnxnativeinterface.h"
|
||||
|
||||
#include "qqnxglcontext.h"
|
||||
#include "qqnxscreen.h"
|
||||
#include "qqnxwindow.h"
|
||||
|
||||
#include <QtGui/QOpenGLContext>
|
||||
#include <QtGui/QScreen>
|
||||
#include <QtGui/QWindow>
|
||||
|
||||
@ -71,6 +73,14 @@ void *QQnxNativeInterface::nativeResourceForScreen(const QByteArray &resource, Q
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
|
||||
{
|
||||
if (resource == "eglcontext" && context)
|
||||
return static_cast<QQnxGLContext*>(context->handle())->getEglContext();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value)
|
||||
{
|
||||
if (name == QStringLiteral("mmRendererWindowName")) {
|
||||
|
@ -51,6 +51,7 @@ class QQnxNativeInterface : public QPlatformNativeInterface
|
||||
public:
|
||||
void *nativeResourceForWindow(const QByteArray &resource, QWindow *window);
|
||||
void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen);
|
||||
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context);
|
||||
void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user