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>
This commit is contained in:
parent
f5c132ef28
commit
d9a260eabe
@ -413,6 +413,10 @@ bool QRhiGles2::create(QRhi::Flags flags)
|
|||||||
if (!importedContext) {
|
if (!importedContext) {
|
||||||
ctx = new QOpenGLContext;
|
ctx = new QOpenGLContext;
|
||||||
ctx->setFormat(requestedFormat);
|
ctx->setFormat(requestedFormat);
|
||||||
|
if (QOpenGLContext *shareContext = qt_gl_global_share_context()) {
|
||||||
|
ctx->setShareContext(shareContext);
|
||||||
|
ctx->setScreen(shareContext->screen());
|
||||||
|
}
|
||||||
if (!ctx->create()) {
|
if (!ctx->create()) {
|
||||||
qWarning("QRhiGles2: Failed to create context");
|
qWarning("QRhiGles2: Failed to create context");
|
||||||
delete ctx;
|
delete ctx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user