diff options
author | Liang Qi <liang.qi@qt.io> | 2019-10-10 09:13:49 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-10-10 13:26:37 +0200 |
commit | 386768298cf2be024de673f5329c94a23dab4b90 (patch) | |
tree | 9c130cd93f984788493c427098358a8da86628e3 /src/widgets/kernel | |
parent | ae7b21898273a83b4b2669b9d30a7f9777a7af99 (diff) | |
parent | 9c84b7786cac7ea1cf1a8a61b503fca4b5553a49 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qopenglwidget.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 451b18d8d3..bc5ca21b97 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -788,10 +788,12 @@ void QOpenGLWidgetPrivate::initialize() if (initialized) return; - // Get our toplevel's context with which we will share in order to make the - // texture usable by the underlying window's backingstore. + // If no global shared context get our toplevel's context with which we + // will share in order to make the texture usable by the underlying window's backingstore. QWidget *tlw = q->window(); - QOpenGLContext *shareContext = get(tlw)->shareContext(); + QOpenGLContext *shareContext = qt_gl_global_share_context(); + if (!shareContext) + shareContext = get(tlw)->shareContext(); // If shareContext is null, showing content on-screen will not work. // However, offscreen rendering and grabFramebuffer() will stay fully functional. |