summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-09-13 11:02:57 +0200
committerMichal Klocek <michal.klocek@qt.io>2019-02-15 10:28:02 +0000
commitaf30e7857e205990057735a07fe0974af9db8733 (patch)
tree2fdbb25f77db2212bab889ff30212a57d080de65
parenta8a3ff9574806a5591413445b5a94338ceb0d701 (diff)
Support offscreen plugin with glx backend
Task-number: QTBUG-63346 Change-Id: Id475c6c88f79af8cf82610a40d07eaa3f6588d7d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/core/content_browser_client_qt.cpp2
-rw-r--r--src/core/ozone/gl_context_qt.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 3eb224797..7440771cb 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -163,7 +163,7 @@ public:
{
QString platform = qApp->platformName().toLower();
QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
- if (platform == QLatin1String("xcb")) {
+ if (platform == QLatin1String("xcb") || platform == QLatin1String("offscreen")) {
if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2)
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
else
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 7e913817e..c4a075544 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -130,9 +130,10 @@ void* GLContextHelper::getEGLDisplay()
void* GLContextHelper::getXDisplay()
{
- if (QGuiApplication::platformName() != QLatin1String("xcb"))
- return nullptr;
- return qApp->platformNativeInterface()->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen());
+ QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
+ if (pni)
+ return pni->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen());
+ return nullptr;
}
void* GLContextHelper::getNativeDisplay()