Expose the EGLNativeDisplay through nativeResourceForIntegration.

This is necessary to allow QtWebEngine to create a separate display
connection through eglGetDisplay to the same display as Qt is
working on.

Change-Id: I3635888bd5e41239ef18b197d24683dcea68f6ee
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Zeno Albisser 2014-03-10 14:43:08 +01:00 committed by The Qt Project
parent e819e47b42
commit 55eec6829e

View File

@ -189,7 +189,8 @@ QPlatformNativeInterface *QEGLPlatformIntegration::nativeInterface() const
enum ResourceType {
EglDisplay,
EglWindow,
EglContext
EglContext,
NativeDisplay
};
static int resourceType(const QByteArray &key)
@ -197,7 +198,8 @@ static int resourceType(const QByteArray &key)
static const QByteArray names[] = { // match ResourceType
QByteArrayLiteral("egldisplay"),
QByteArrayLiteral("eglwindow"),
QByteArrayLiteral("eglcontext")
QByteArrayLiteral("eglcontext"),
QByteArrayLiteral("nativedisplay")
};
const QByteArray *end = names + sizeof(names) / sizeof(names[0]);
const QByteArray *result = std::find(names, end, key);
@ -214,6 +216,9 @@ void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &re
case EglDisplay:
result = m_screen->display();
break;
case NativeDisplay:
result = reinterpret_cast<void*>(nativeDisplay());
break;
default:
break;
}