diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-06-22 13:18:03 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-06-22 13:55:40 +0200 |
commit | d9a260eabe4a3bd4f4e1e69f0430af2589d45a4f (patch) | |
tree | 320124d9f81582177aeed5d01ab23f67713337c6 | |
parent | f5c132ef28da5afb92d141e683b2910b4480f0ed (diff) |
Use global share context in QRhiGles2
Needed for using native textures in WebEngine.
Task-number: QTBUG-78682
Change-Id: I8458b17767bb992357064d85f159781ea24e61dc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/gui/rhi/qrhigles2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index 139375fbec..9a311101e1 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -413,6 +413,10 @@ bool QRhiGles2::create(QRhi::Flags flags) if (!importedContext) { ctx = new QOpenGLContext; ctx->setFormat(requestedFormat); + if (QOpenGLContext *shareContext = qt_gl_global_share_context()) { + ctx->setShareContext(shareContext); + ctx->setScreen(shareContext->screen()); + } if (!ctx->create()) { qWarning("QRhiGles2: Failed to create context"); delete ctx; |