Merge lp:~gerboland/qtubuntu/rasterGLSurface into lp:qtubuntu

Proposed by Gerry Boland
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 296
Merged at revision: 350
Proposed branch: lp:~gerboland/qtubuntu/rasterGLSurface
Merge into: lp:qtubuntu
Prerequisite: lp:~gerboland/qtubuntu/enable-debug-mode
Diff against target: 199 lines (+81/-15)
7 files modified
src/ubuntumirclient/backingstore.cpp (+7/-3)
src/ubuntumirclient/backingstore.h (+1/-0)
src/ubuntumirclient/desktopwindow.cpp (+26/-0)
src/ubuntumirclient/desktopwindow.h (+29/-0)
src/ubuntumirclient/glcontext.cpp (+0/-2)
src/ubuntumirclient/integration.cpp (+16/-10)
src/ubuntumirclient/ubuntumirclient.pro (+2/-0)
To merge this branch: bzr merge lp:~gerboland/qtubuntu/rasterGLSurface
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
Unity8 CI Bot continuous-integration Approve
Daniel d'Andrada Pending
Review via email: mp+307597@code.launchpad.net

This proposal supersedes a proposal from 2016-09-28.

Commit message

Fix rendering of apps using QQuickWidget

Based on a branch by Daniel d'Andrada
- Advertise RasterGLSurface capability
- Don't create mir surfaces for Qt::Desktop QWindows. Proper implementation still pending
- Add BackingStore toImage method, fixes render of QQuick and Widget content

Description of the change

Tested working correctly on Desktop (Mesa), Nexus 4 & 7, Meizu MX4, Bq Aquaris 4.5.
M10 has rendering problems, still unresolved.

Good test is the "quickwidget" demo in qtdeclarative5-examples as it uses QQuickWidget, which combines QML and Widget content in a single window. You can also test QtCreator

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:335
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/124/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2973
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3001
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2859/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2859
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2859/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/124/rebuild

review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:337
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/125/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2974
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3002
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2860/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2860
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2860/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/125/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal
review: Needs Information
Revision history for this message
Gerry Boland (gerboland) wrote : Posted in a previous version of this proposal

Quite right, I've rebased it now

Revision history for this message
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

Works. Didn't test on phone though.

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:347
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/130/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3008
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2866/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2866
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2866/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/130/rebuild

review: Approve (continuous-integration)
296. By Gerry Boland

Fix rendering of apps using QQuickWidget

Based on a branch by Daniel d'Andrada
- Advertise RasterGLSurface capability
- Don't create mir surfaces for Qt::Desktop QWindows. Proper implementation still pending
- Add BackingStore toImage method, fixes render of QQuick and Widget content

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:296
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/140/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3048
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3076
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2933/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2933
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2933/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/140/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Re-approving, had been top approved before; CI passing too

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntumirclient/backingstore.cpp'
2--- src/ubuntumirclient/backingstore.cpp 2016-04-20 16:10:06 +0000
3+++ src/ubuntumirclient/backingstore.cpp 2016-10-12 20:28:54 +0000
4@@ -35,9 +35,7 @@
5 window->setSurfaceType(QSurface::OpenGLSurface);
6 }
7
8-UbuntuBackingStore::~UbuntuBackingStore()
9-{
10-}
11+UbuntuBackingStore::~UbuntuBackingStore() = default;
12
13 void UbuntuBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
14 {
15@@ -125,3 +123,9 @@
16 {
17 return &mImage;
18 }
19+
20+QImage UbuntuBackingStore::toImage() const
21+{
22+ // used by QPlatformBackingStore::composeAndFlush
23+ return mImage;
24+}
25
26=== modified file 'src/ubuntumirclient/backingstore.h'
27--- src/ubuntumirclient/backingstore.h 2014-11-11 14:34:12 +0000
28+++ src/ubuntumirclient/backingstore.h 2016-10-12 20:28:54 +0000
29@@ -34,6 +34,7 @@
30 void flush(QWindow* window, const QRegion& region, const QPoint& offset) override;
31 void resize(const QSize& size, const QRegion& staticContents) override;
32 QPaintDevice* paintDevice() override;
33+ QImage toImage() const override;
34
35 protected:
36 void updateTexture();
37
38=== added file 'src/ubuntumirclient/desktopwindow.cpp'
39--- src/ubuntumirclient/desktopwindow.cpp 1970-01-01 00:00:00 +0000
40+++ src/ubuntumirclient/desktopwindow.cpp 2016-10-12 20:28:54 +0000
41@@ -0,0 +1,26 @@
42+/*
43+ * Copyright (C) 2016 Canonical, Ltd.
44+ *
45+ * This program is free software: you can redistribute it and/or modify it under
46+ * the terms of the GNU Lesser General Public License version 3, as published by
47+ * the Free Software Foundation.
48+ *
49+ * This program is distributed in the hope that it will be useful, but WITHOUT
50+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
51+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
52+ * Lesser General Public License for more details.
53+ *
54+ * You should have received a copy of the GNU Lesser General Public License
55+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
56+ */
57+
58+#include "desktopwindow.h"
59+
60+// local
61+#include "logging.h"
62+
63+UbuntuDesktopWindow::UbuntuDesktopWindow(QWindow *window)
64+ : QPlatformWindow(window)
65+{
66+ qCDebug(ubuntumirclient, "UbuntuDesktopWindow(window=%p)", window);
67+}
68
69=== added file 'src/ubuntumirclient/desktopwindow.h'
70--- src/ubuntumirclient/desktopwindow.h 1970-01-01 00:00:00 +0000
71+++ src/ubuntumirclient/desktopwindow.h 2016-10-12 20:28:54 +0000
72@@ -0,0 +1,29 @@
73+/*
74+ * Copyright (C) 2016 Canonical, Ltd.
75+ *
76+ * This program is free software: you can redistribute it and/or modify it under
77+ * the terms of the GNU Lesser General Public License version 3, as published by
78+ * the Free Software Foundation.
79+ *
80+ * This program is distributed in the hope that it will be useful, but WITHOUT
81+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
82+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83+ * Lesser General Public License for more details.
84+ *
85+ * You should have received a copy of the GNU Lesser General Public License
86+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
87+ */
88+
89+#ifndef UBUNTU_DESKTOP_WINDOW_H
90+#define UBUNTU_DESKTOP_WINDOW_H
91+
92+#include <qpa/qplatformwindow.h>
93+
94+// TODO Implement it. For now it's just an empty, dummy class.
95+class UbuntuDesktopWindow : public QPlatformWindow
96+{
97+public:
98+ UbuntuDesktopWindow(QWindow*);
99+};
100+
101+#endif // UBUNTU_DESKTOP_WINDOW_H
102
103=== modified file 'src/ubuntumirclient/glcontext.cpp'
104--- src/ubuntumirclient/glcontext.cpp 2016-08-17 15:32:38 +0000
105+++ src/ubuntumirclient/glcontext.cpp 2016-10-12 20:28:54 +0000
106@@ -74,8 +74,6 @@
107
108 bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface)
109 {
110- Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
111-
112 const bool ret = QEGLPlatformContext::makeCurrent(surface);
113
114 if (Q_LIKELY(ret)) {
115
116=== modified file 'src/ubuntumirclient/integration.cpp'
117--- src/ubuntumirclient/integration.cpp 2016-10-12 20:28:54 +0000
118+++ src/ubuntumirclient/integration.cpp 2016-10-12 20:28:54 +0000
119@@ -18,6 +18,7 @@
120 #include "integration.h"
121 #include "backingstore.h"
122 #include "clipboard.h"
123+#include "desktopwindow.h"
124 #include "debugextension.h"
125 #include "glcontext.h"
126 #include "input.h"
127@@ -30,6 +31,7 @@
128 // Qt
129 #include <QFileInfo>
130 #include <QGuiApplication>
131+#include <private/qeglpbuffer_p.h>
132 #include <qpa/qplatformnativeinterface.h>
133 #include <qpa/qplatforminputcontextfactory_p.h>
134 #include <qpa/qplatforminputcontext.h>
135@@ -224,21 +226,17 @@
136
137 QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const
138 {
139- return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection, mDebugExtension.data());
140+ if (window->type() == Qt::Desktop) {
141+ // Desktop windows should not be backed up by a mir surface as they don't draw anything (nor should).
142+ return new UbuntuDesktopWindow(window);
143+ } else {
144+ return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection, mDebugExtension.data());
145+ }
146 }
147
148 bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
149 {
150 switch (cap) {
151- case ThreadedPixmaps:
152- return true;
153-
154- case OpenGL:
155- return true;
156-
157- case ApplicationState:
158- return true;
159-
160 case ThreadedOpenGL:
161 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
162 return true;
163@@ -246,8 +244,16 @@
164 qCDebug(ubuntumirclient, "disabled threaded OpenGL");
165 return false;
166 }
167+
168+ case ThreadedPixmaps:
169+ case OpenGL:
170+ case ApplicationState:
171 case MultipleWindows:
172 case NonFullScreenWindows:
173+#if QT_VERSION > QT_VERSION_CHECK(5, 5, 0)
174+ case SwitchableWidgetComposition:
175+#endif
176+ case RasterGLSurface: // needed for QQuickWidget
177 return true;
178 default:
179 return QPlatformIntegration::hasCapability(cap);
180
181=== modified file 'src/ubuntumirclient/ubuntumirclient.pro'
182--- src/ubuntumirclient/ubuntumirclient.pro 2016-10-12 20:28:54 +0000
183+++ src/ubuntumirclient/ubuntumirclient.pro 2016-10-12 20:28:54 +0000
184@@ -19,6 +19,7 @@
185 clipboard.cpp \
186 cursor.cpp \
187 debugextension.cpp \
188+ desktopwindow.cpp \
189 glcontext.cpp \
190 input.cpp \
191 integration.cpp \
192@@ -35,6 +36,7 @@
193 clipboard.h \
194 cursor.h \
195 debugextension.h \
196+ desktopwindow.h \
197 glcontext.h \
198 input.h \
199 integration.h \

Subscribers

People subscribed via source and target branches