From 55eec6829e8e673e348b015ad4c22da971807933 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Mon, 10 Mar 2014 14:43:08 +0100 Subject: [PATCH] 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 --- .../eglconvenience/qeglplatformintegration.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp index b48f9934366..820c433a2cb 100644 --- a/src/platformsupport/eglconvenience/qeglplatformintegration.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformintegration.cpp @@ -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(nativeDisplay()); + break; default: break; }