aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlscene
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-10-28 15:40:49 +0100
committerPierre Rossi <pierre.rossi@gmail.com>2014-11-07 17:24:26 +0100
commit868def84fe800aaba937159814388249ebbaf914 (patch)
tree756cb7940a5c51aa50dfbc8c5d28ef15973fa5e8 /tools/qmlscene
parentcb023cbc2ab494eead21b721040a0a90db0f755c (diff)
qmlscene: Simplify context sharing logic.
We can use the new application attribute for this now. Change-Id: Ia0a6d13d36316ec9becfb5d3251b8461ac73a2d0 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'tools/qmlscene')
-rw-r--r--tools/qmlscene/main.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index bc339ae3e5..2a86b724f4 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -405,6 +405,9 @@ int main(int argc, char ** argv)
}
}
+ // QtWebEngine needs a shared context in order for the GPU thread to
+ // upload textures.
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, options.contextSharing);
#ifdef QT_WIDGETS_LIB
QApplication app(argc, argv);
#else
@@ -443,15 +446,6 @@ int main(int argc, char ** argv)
displayFileDialog(&options);
#endif
- // QWebEngine needs a shared context in order for the GPU thread to
- // upload textures.
- QScopedPointer<QOpenGLContext> shareContext;
- if (options.contextSharing) {
- shareContext.reset(new QOpenGLContext);
- shareContext->create();
- qt_gl_set_global_share_context(shareContext.data());
- }
-
int exitCode = 0;
if (!options.file.isEmpty()) {