Merge lp:~osomon/webbrowser-app/AA_ShareOpenGLContexts into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 907
Merged at revision: 913
Proposed branch: lp:~osomon/webbrowser-app/AA_ShareOpenGLContexts
Merge into: lp:webbrowser-app
Diff against target: 108 lines (+22/-9)
4 files modified
src/app/CMakeLists.txt (+5/-1)
src/app/browserapplication.cpp (+8/-6)
src/app/webbrowser/webbrowser-app.cpp (+5/-1)
src/app/webcontainer/webapp-container.cpp (+4/-1)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/AA_ShareOpenGLContexts
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+250157@code.launchpad.net

Commit message

Use Qt::AA_ShareOpenGLContexts when building with Qt >= 5.4.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/CMakeLists.txt'
2--- src/app/CMakeLists.txt 2014-11-26 10:38:23 +0000
3+++ src/app/CMakeLists.txt 2015-02-18 15:49:13 +0000
4@@ -18,7 +18,11 @@
5
6 qt5_use_modules(${COMMONLIB} Core Gui Network Qml Quick Widgets)
7
8-include_directories(${Qt5Quick_PRIVATE_INCLUDE_DIRS})
9+if(${Qt5Core_VERSION_STRING} VERSION_LESS "5.3.0")
10+ include_directories(${Qt5Quick_PRIVATE_INCLUDE_DIRS})
11+elseif(${Qt5Core_VERSION_STRING} VERSION_LESS "5.4.0")
12+ include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
13+endif()
14
15 file(GLOB QML_FILES *.qml)
16 install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app)
17
18=== modified file 'src/app/browserapplication.cpp'
19--- src/app/browserapplication.cpp 2014-12-03 15:31:38 +0000
20+++ src/app/browserapplication.cpp 2015-02-18 15:49:13 +0000
21@@ -1,5 +1,5 @@
22 /*
23- * Copyright 2013 Canonical Ltd.
24+ * Copyright 2013-2015 Canonical Ltd.
25 *
26 * This file is part of webbrowser-app.
27 *
28@@ -28,7 +28,7 @@
29 #include <QtQuick/QQuickWindow>
30 #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
31 #include <QtQuick/private/qsgcontext_p.h>
32-#else
33+#elif QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
34 #include <QtGui/private/qopenglcontext_p.h>
35 #endif
36
37@@ -126,15 +126,17 @@
38 // which is needed by Online Accounts.
39 QString unversionedAppId = QStringList(appIdParts.mid(0, 2)).join('_');
40
41- // Enable compositing in oxide
42+#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
43+ // Enable compositing in oxide (not needed starting with Qt 5.4
44+ // because the Qt::AA_ShareOpenGLContexts attribute is set before
45+ // the application is instantiated).
46 QOpenGLContext* glcontext = new QOpenGLContext(this);
47 glcontext->create();
48 #if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
49 QSGContext::setSharedOpenGLContext(glcontext);
50-#elif QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
51+#else
52 QOpenGLContextPrivate::setGlobalShareContext(glcontext);
53-#else
54- qt_gl_set_global_share_context(glcontext);
55+#endif
56 #endif
57
58 QString devtoolsPort = inspectorPort();
59
60=== modified file 'src/app/webbrowser/webbrowser-app.cpp'
61--- src/app/webbrowser/webbrowser-app.cpp 2015-02-09 10:16:16 +0000
62+++ src/app/webbrowser/webbrowser-app.cpp 2015-02-18 15:49:13 +0000
63@@ -1,5 +1,5 @@
64 /*
65- * Copyright 2013 Canonical Ltd.
66+ * Copyright 2013-2015 Canonical Ltd.
67 *
68 * This file is part of webbrowser-app.
69 *
70@@ -42,6 +42,7 @@
71 #include <QtCore/QFileInfo>
72 #include <QtCore/QString>
73 #include <QtCore/QTextStream>
74+#include <QtCore/QtGlobal>
75 #include <QtCore/QVariant>
76 #include <QtQml/QtQml>
77 #include <QtQuick/QQuickWindow>
78@@ -132,6 +133,9 @@
79
80 int main(int argc, char** argv)
81 {
82+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
83+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
84+#endif
85 WebbrowserApp app(argc, argv);
86 if (app.initialize()) {
87 return app.run();
88
89=== modified file 'src/app/webcontainer/webapp-container.cpp'
90--- src/app/webcontainer/webapp-container.cpp 2015-01-26 14:53:18 +0000
91+++ src/app/webcontainer/webapp-container.cpp 2015-02-18 15:49:13 +0000
92@@ -1,5 +1,5 @@
93 /*
94- * Copyright 2013 Canonical Ltd.
95+ * Copyright 2013-2015 Canonical Ltd.
96 *
97 * This file is part of webbrowser-app.
98 *
99@@ -439,6 +439,9 @@
100
101 int main(int argc, char** argv)
102 {
103+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
104+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
105+#endif
106 WebappContainer app(argc, argv);
107 if (app.initialize()) {
108 return app.run();

Subscribers

People subscribed via source and target branches

to status/vote changes: