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

Proposed by Gerry Boland
Status: Superseded
Proposed branch: lp:~gerboland/qtubuntu/rasterGLSurface
Merge into: lp:qtubuntu
Diff against target: 396 lines (+103/-131)
9 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 (+19/-26)
src/ubuntumirclient/integration.cpp (+19/-12)
src/ubuntumirclient/offscreensurface.cpp (+0/-47)
src/ubuntumirclient/offscreensurface.h (+0/-41)
src/ubuntumirclient/ubuntumirclient.pro (+2/-2)
To merge this branch: bzr merge lp:~gerboland/qtubuntu/rasterGLSurface
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Needs Information
Unity8 CI Bot continuous-integration Approve
Review via email: mp+306915@code.launchpad.net

This proposal has been superseded by 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
- Implement proper offscreen rendering support using EGL pixel buffers.
- 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 :

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 :

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 :
review: Needs Information
295. By Gerry Boland

Merge trunk

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

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/ubuntumirclient/backingstore.cpp'
--- src/ubuntumirclient/backingstore.cpp 2016-04-20 16:10:06 +0000
+++ src/ubuntumirclient/backingstore.cpp 2016-09-28 10:56:31 +0000
@@ -35,9 +35,7 @@
35 window->setSurfaceType(QSurface::OpenGLSurface);35 window->setSurfaceType(QSurface::OpenGLSurface);
36}36}
3737
38UbuntuBackingStore::~UbuntuBackingStore()38UbuntuBackingStore::~UbuntuBackingStore() = default;
39{
40}
4139
42void UbuntuBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)40void UbuntuBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
43{41{
@@ -125,3 +123,9 @@
125{123{
126 return &mImage;124 return &mImage;
127}125}
126
127QImage UbuntuBackingStore::toImage() const
128{
129 // used by QPlatformBackingStore::composeAndFlush
130 return mImage;
131}
128132
=== modified file 'src/ubuntumirclient/backingstore.h'
--- src/ubuntumirclient/backingstore.h 2014-11-11 14:34:12 +0000
+++ src/ubuntumirclient/backingstore.h 2016-09-28 10:56:31 +0000
@@ -34,6 +34,7 @@
34 void flush(QWindow* window, const QRegion& region, const QPoint& offset) override;34 void flush(QWindow* window, const QRegion& region, const QPoint& offset) override;
35 void resize(const QSize& size, const QRegion& staticContents) override;35 void resize(const QSize& size, const QRegion& staticContents) override;
36 QPaintDevice* paintDevice() override;36 QPaintDevice* paintDevice() override;
37 QImage toImage() const override;
3738
38protected:39protected:
39 void updateTexture();40 void updateTexture();
4041
=== added file 'src/ubuntumirclient/desktopwindow.cpp'
--- src/ubuntumirclient/desktopwindow.cpp 1970-01-01 00:00:00 +0000
+++ src/ubuntumirclient/desktopwindow.cpp 2016-09-28 10:56:31 +0000
@@ -0,0 +1,26 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "desktopwindow.h"
18
19// local
20#include "logging.h"
21
22UbuntuDesktopWindow::UbuntuDesktopWindow(QWindow *window)
23 : QPlatformWindow(window)
24{
25 qCDebug(ubuntumirclient, "UbuntuDesktopWindow(window=%p)", window);
26}
027
=== added file 'src/ubuntumirclient/desktopwindow.h'
--- src/ubuntumirclient/desktopwindow.h 1970-01-01 00:00:00 +0000
+++ src/ubuntumirclient/desktopwindow.h 2016-09-28 10:56:31 +0000
@@ -0,0 +1,29 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UBUNTU_DESKTOP_WINDOW_H
18#define UBUNTU_DESKTOP_WINDOW_H
19
20#include <qpa/qplatformwindow.h>
21
22// TODO Implement it. For now it's just an empty, dummy class.
23class UbuntuDesktopWindow : public QPlatformWindow
24{
25public:
26 UbuntuDesktopWindow(QWindow*);
27};
28
29#endif // UBUNTU_DESKTOP_WINDOW_H
030
=== modified file 'src/ubuntumirclient/glcontext.cpp'
--- src/ubuntumirclient/glcontext.cpp 2016-08-09 23:00:32 +0000
+++ src/ubuntumirclient/glcontext.cpp 2016-09-28 10:56:31 +0000
@@ -16,11 +16,11 @@
1616
17#include "glcontext.h"17#include "glcontext.h"
18#include "logging.h"18#include "logging.h"
19#include "offscreensurface.h"
20#include "window.h"19#include "window.h"
2120
22#include <QOpenGLFramebufferObject>21#include <QOpenGLFramebufferObject>
23#include <QtPlatformSupport/private/qeglconvenience_p.h>22#include <QtPlatformSupport/private/qeglconvenience_p.h>
23#include <QtPlatformSupport/private/qeglpbuffer_p.h>
24#include <QtGui/private/qopenglcontext_p.h>24#include <QtGui/private/qopenglcontext_p.h>
2525
26Q_LOGGING_CATEGORY(ubuntumirclientGraphics, "ubuntumirclient.graphics", QtWarningMsg)26Q_LOGGING_CATEGORY(ubuntumirclientGraphics, "ubuntumirclient.graphics", QtWarningMsg)
@@ -74,42 +74,35 @@
7474
75bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface)75bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface)
76{76{
77 Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);77 const bool ret = QEGLPlatformContext::makeCurrent(surface);
7878
79 if (surface->surface()->surfaceClass() == QSurface::Offscreen) {79 if (Q_LIKELY(ret)) {
80 auto offscreen = static_cast<UbuntuOffscreenSurface *>(surface);80 QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
81 if (!offscreen->buffer()) {81 if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) {
82 auto buffer = new QOpenGLFramebufferObject(surface->surface()->size());82 ctx_d->workaround_brokenFBOReadBack = true;
83 offscreen->setBuffer(buffer);83 }
84 }
85 return offscreen->buffer()->bind();
86 } else {
87 const bool ret = QEGLPlatformContext::makeCurrent(surface);
88
89 if (Q_LIKELY(ret)) {
90 QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
91 if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) {
92 ctx_d->workaround_brokenFBOReadBack = true;
93 }
94 }
95
96 return ret;
97 }84 }
85 return ret;
98}86}
9987
100// Following method used internally in the base class QEGLPlatformContext to access88// Following method used internally in the base class QEGLPlatformContext to access
101// the egl surface of a QPlatformSurface/UbuntuWindow89// the egl surface of a QPlatformSurface/UbuntuWindow
102EGLSurface UbuntuOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)90EGLSurface UbuntuOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
103{91{
104 auto ubuntuWindow = static_cast<UbuntuWindow *>(surface);92 if (surface->surface()->surfaceClass() == QSurface::Window) {
105 return ubuntuWindow->eglSurface();93 return static_cast<UbuntuWindow *>(surface)->eglSurface();
94 } else {
95 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
96 }
106}97}
10798
108void UbuntuOpenGLContext::swapBuffers(QPlatformSurface *surface)99void UbuntuOpenGLContext::swapBuffers(QPlatformSurface *surface)
109{100{
110 QEGLPlatformContext::swapBuffers(surface);101 QEGLPlatformContext::swapBuffers(surface);
111102
112 // notify window on swap completion103 if (surface->surface()->surfaceClass() == QSurface::Window) {
113 auto ubuntuWindow = static_cast<UbuntuWindow *>(surface);104 // notify window on swap completion
114 ubuntuWindow->onSwapBuffersDone();105 auto ubuntuWindow = static_cast<UbuntuWindow *>(surface);
106 ubuntuWindow->onSwapBuffersDone();
107 }
115}108}
116109
=== modified file 'src/ubuntumirclient/integration.cpp'
--- src/ubuntumirclient/integration.cpp 2016-08-24 12:40:30 +0000
+++ src/ubuntumirclient/integration.cpp 2016-09-28 10:56:31 +0000
@@ -18,11 +18,11 @@
18#include "integration.h"18#include "integration.h"
19#include "backingstore.h"19#include "backingstore.h"
20#include "clipboard.h"20#include "clipboard.h"
21#include "desktopwindow.h"
21#include "glcontext.h"22#include "glcontext.h"
22#include "input.h"23#include "input.h"
23#include "logging.h"24#include "logging.h"
24#include "nativeinterface.h"25#include "nativeinterface.h"
25#include "offscreensurface.h"
26#include "screen.h"26#include "screen.h"
27#include "theme.h"27#include "theme.h"
28#include "window.h"28#include "window.h"
@@ -30,13 +30,16 @@
30// Qt30// Qt
31#include <QFileInfo>31#include <QFileInfo>
32#include <QGuiApplication>32#include <QGuiApplication>
33#include <private/qeglpbuffer_p.h>
33#include <qpa/qplatformnativeinterface.h>34#include <qpa/qplatformnativeinterface.h>
34#include <qpa/qplatforminputcontextfactory_p.h>35#include <qpa/qplatforminputcontextfactory_p.h>
35#include <qpa/qplatforminputcontext.h>36#include <qpa/qplatforminputcontext.h>
36#include <QtPlatformSupport/private/qeglconvenience_p.h>37#include <QtPlatformSupport/private/qeglconvenience_p.h>
37#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>38#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
38#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>39#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
40#include <QtPlatformSupport/private/qeglpbuffer_p.h>
39#include <QOpenGLContext>41#include <QOpenGLContext>
42#include <QOffscreenSurface>
4043
41// platform-api44// platform-api
42#include <ubuntu/application/lifecycle_delegate.h>45#include <ubuntu/application/lifecycle_delegate.h>
@@ -210,21 +213,17 @@
210213
211QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const214QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const
212{215{
213 return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection);216 if (window->type() == Qt::Desktop) {
217 // Desktop windows should not be backed up by a mir surface as they don't draw anything (nor should).
218 return new UbuntuDesktopWindow(window);
219 } else {
220 return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection);
221 }
214}222}
215223
216bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const224bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
217{225{
218 switch (cap) {226 switch (cap) {
219 case ThreadedPixmaps:
220 return true;
221
222 case OpenGL:
223 return true;
224
225 case ApplicationState:
226 return true;
227
228 case ThreadedOpenGL:227 case ThreadedOpenGL:
229 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {228 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
230 return true;229 return true;
@@ -232,8 +231,16 @@
232 qCDebug(ubuntumirclient, "disabled threaded OpenGL");231 qCDebug(ubuntumirclient, "disabled threaded OpenGL");
233 return false;232 return false;
234 }233 }
234
235 case ThreadedPixmaps:
236 case OpenGL:
237 case ApplicationState:
235 case MultipleWindows:238 case MultipleWindows:
236 case NonFullScreenWindows:239 case NonFullScreenWindows:
240#if QT_VERSION > QT_VERSION_CHECK(5, 5, 0)
241 case SwitchableWidgetComposition:
242#endif
243 case RasterGLSurface: // needed for QQuickWidget
237 return true;244 return true;
238 default:245 default:
239 return QPlatformIntegration::hasCapability(cap);246 return QPlatformIntegration::hasCapability(cap);
@@ -319,7 +326,7 @@
319QPlatformOffscreenSurface *UbuntuClientIntegration::createPlatformOffscreenSurface(326QPlatformOffscreenSurface *UbuntuClientIntegration::createPlatformOffscreenSurface(
320 QOffscreenSurface *surface) const327 QOffscreenSurface *surface) const
321{328{
322 return new UbuntuOffscreenSurface(surface);329 return new QEGLPbuffer(mEglDisplay, surface->requestedFormat(), surface);
323}330}
324331
325void UbuntuClientIntegration::destroyScreen(UbuntuScreen *screen)332void UbuntuClientIntegration::destroyScreen(UbuntuScreen *screen)
326333
=== removed file 'src/ubuntumirclient/offscreensurface.cpp'
--- src/ubuntumirclient/offscreensurface.cpp 2016-01-04 17:18:51 +0000
+++ src/ubuntumirclient/offscreensurface.cpp 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "offscreensurface.h"
18
19#include <QOffscreenSurface>
20#include <QOpenGLFramebufferObject>
21
22UbuntuOffscreenSurface::UbuntuOffscreenSurface(QOffscreenSurface *offscreenSurface)
23 : QPlatformOffscreenSurface(offscreenSurface)
24 , m_buffer(nullptr)
25 , m_format(offscreenSurface->requestedFormat())
26{
27}
28
29QSurfaceFormat UbuntuOffscreenSurface::format() const
30{
31 return m_format;
32}
33
34bool UbuntuOffscreenSurface::isValid() const
35{
36 return m_buffer != nullptr && m_buffer->isValid();
37}
38
39QOpenGLFramebufferObject* UbuntuOffscreenSurface::buffer() const
40{
41 return m_buffer;
42}
43
44void UbuntuOffscreenSurface::setBuffer(QOpenGLFramebufferObject *buffer)
45{
46 m_buffer = buffer;
47}
480
=== removed file 'src/ubuntumirclient/offscreensurface.h'
--- src/ubuntumirclient/offscreensurface.h 2016-01-04 17:18:51 +0000
+++ src/ubuntumirclient/offscreensurface.h 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UBUNTU_OFFSCREEN_SURFACE_H
18#define UBUNTU_OFFSCREEN_SURFACE_H
19
20#include <qpa/qplatformoffscreensurface.h>
21#include <QSurfaceFormat>
22
23class QOpenGLFramebufferObject;
24
25class UbuntuOffscreenSurface : public QPlatformOffscreenSurface
26{
27public:
28 UbuntuOffscreenSurface(QOffscreenSurface *offscreenSurface);
29
30 QSurfaceFormat format() const override;
31 bool isValid() const override;
32
33 QOpenGLFramebufferObject* buffer() const;
34 void setBuffer(QOpenGLFramebufferObject *buffer);
35
36private:
37 QOpenGLFramebufferObject *m_buffer;
38 QSurfaceFormat m_format;
39};
40
41#endif // UBUNTU_OFFSCREEN_SURFACE_H
420
=== modified file 'src/ubuntumirclient/ubuntumirclient.pro'
--- src/ubuntumirclient/ubuntumirclient.pro 2016-08-24 12:40:30 +0000
+++ src/ubuntumirclient/ubuntumirclient.pro 2016-09-28 10:56:31 +0000
@@ -18,11 +18,11 @@
18 backingstore.cpp \18 backingstore.cpp \
19 clipboard.cpp \19 clipboard.cpp \
20 cursor.cpp \20 cursor.cpp \
21 desktopwindow.cpp \
21 glcontext.cpp \22 glcontext.cpp \
22 input.cpp \23 input.cpp \
23 integration.cpp \24 integration.cpp \
24 nativeinterface.cpp \25 nativeinterface.cpp \
25 offscreensurface.cpp \
26 platformservices.cpp \26 platformservices.cpp \
27 plugin.cpp \27 plugin.cpp \
28 screen.cpp \28 screen.cpp \
@@ -34,12 +34,12 @@
34 backingstore.h \34 backingstore.h \
35 clipboard.h \35 clipboard.h \
36 cursor.h \36 cursor.h \
37 desktopwindow.h \
37 glcontext.h \38 glcontext.h \
38 input.h \39 input.h \
39 integration.h \40 integration.h \
40 logging.h \41 logging.h \
41 nativeinterface.h \42 nativeinterface.h \
42 offscreensurface.h \
43 orientationchangeevent_p.h \43 orientationchangeevent_p.h \
44 platformservices.h \44 platformservices.h \
45 plugin.h \45 plugin.h \

Subscribers

People subscribed via source and target branches