diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-07 00:08:06 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-07 00:13:39 +0100 |
commit | 8ab1765b0f9640eb410864971cb4336adc7b30ab (patch) | |
tree | bb0ecae07f0110cabde8e38ab69b326fa1118a24 /src | |
parent | 8bd8815fd629e34c54924a2ada41007464da22ec (diff) | |
parent | ec029b1a4c104c2400da23d4f5f04d7f03731beb (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
.qmake.conf
src/compositor/compositor_api/qwaylandquickitem.cpp
Change-Id: Id2f49e8703a67daedcee66db83f006df828d9da0
Diffstat (limited to 'src')
12 files changed, 115 insertions, 78 deletions
diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp index f6b5564b8..2b73c06ca 100644 --- a/src/compositor/compositor_api/qwaylandclient.cpp +++ b/src/compositor/compositor_api/qwaylandclient.cpp @@ -221,7 +221,7 @@ qint64 QWaylandClient::userId() const */ /*! - * \property int QWaylandClient::groupId + * \property QWaylandClient::groupId * * This property holds the group id of this QWaylandClient. */ diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 99b484e20..4e7040889 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -283,39 +283,6 @@ void QWaylandCompositorPrivate::addPolishObject(QObject *object) } } -/*! - \qmlsignal void QtWaylandCompositor::WaylandCompositor::createSurface(object client, int id, int version) - - This signal is emitted when a client has created a surface. - The slot connecting to this signal may create and initialize - a WaylandSurface instance in the scope of the slot. - Otherwise a default surface is created. -*/ - -/*! - \fn void QWaylandCompositor::createSurface(QWaylandClient *client, uint id, int version) - - This signal is emitted when a client has created a surface. - The slot connecting to this signal may create and initialize - a QWaylandSurface instance in the scope of the slot. - Otherwise a default surface is created. - - Connections to this signal must be of Qt::DirectConnection connection type. -*/ - -/* - \qmlsignal void surfaceCreated(QWaylandSurface *surface) - - This signal is emitted when a new WaylandSurface instance has been created. -*/ - -/* - \fn void surfaceCreated(QWaylandSurface *surface) - - This signal is emitted when a new QWaylandSurface instance has been created. -*/ - - void QWaylandCompositorPrivate::compositor_create_surface(wl_compositor::Resource *resource, uint32_t id) { Q_Q(QWaylandCompositor); @@ -465,6 +432,38 @@ void QWaylandCompositorPrivate::loadServerBufferIntegration() */ /*! + \qmlsignal void QtWaylandCompositor::WaylandCompositor::surfaceRequested(WaylandClient client, int id, int version) + + This signal is emitted when a client has created a surface. + The slot connecting to this signal may create and initialize + a WaylandSurface instance in the scope of the slot. + Otherwise a default surface is created. +*/ + +/*! + \fn void QWaylandCompositor::surfaceRequested(QWaylandClient *client, uint id, int version) + + This signal is emitted when a client has created a surface. + The slot connecting to this signal may create and initialize + a QWaylandSurface instance in the scope of the slot. + Otherwise a default surface is created. + + Connections to this signal must be of Qt::DirectConnection connection type. +*/ + +/*! + \qmlsignal void QtWaylandCompositor::WaylandCompositor::surfaceCreated(QWaylandSurface *surface) + + This signal is emitted when a new WaylandSurface instance has been created. +*/ + +/*! + \fn void QWaylandCompositor::surfaceCreated(QWaylandSurface *surface) + + This signal is emitted when a new QWaylandSurface instance has been created. +*/ + +/*! * Constructs a QWaylandCompositor with the given \a parent. */ QWaylandCompositor::QWaylandCompositor(QObject *parent) diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 77d3dc1a9..c369bb26c 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -838,7 +838,7 @@ void QWaylandOutput::setSizeFollowsWindow(bool follow) } /*! - * \qmlproperty object QtWaylandCompositor::WaylandOutput::window + * \qmlproperty Window QtWaylandCompositor::WaylandOutput::window * * This property holds the Window for this WaylandOutput. * diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index a993467ac..5414d06ae 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -221,15 +221,15 @@ void QWaylandBufferMaterial::bind() switch (m_textures.size()) { case 3: if (m_textures[2]) - m_textures[2]->bind(GL_TEXTURE2); + m_textures[2]->bind(2); Q_FALLTHROUGH(); case 2: if (m_textures[1]) - m_textures[1]->bind(GL_TEXTURE1); + m_textures[1]->bind(1); Q_FALLTHROUGH(); case 1: if (m_textures[0]) - m_textures[0]->bind(GL_TEXTURE0); + m_textures[0]->bind(0); } } @@ -388,15 +388,7 @@ QWaylandCompositor *QWaylandQuickItem::compositor() const } /*! - * \qmlproperty WaylandView QtWaylandCompositor::WaylandQuickItem::view - * - * This property holds the view rendered by this WaylandQuickItem. - */ - -/*! - * \property QWaylandQuickItem::view - * - * This property holds the view rendered by this QWaylandQuickItem. + * Returns the view rendered by this QWaylandQuickItem. */ QWaylandView *QWaylandQuickItem::view() const { @@ -817,7 +809,7 @@ void QWaylandQuickItem::setBufferLocked(bool locked) } /*! - * \property bool QWaylandQuickItem::allowDiscardFrontBuffer + * \property QWaylandQuickItem::allowDiscardFrontBuffer * * By default, the item locks the current buffer until a new buffer is available * and updatePaintNode() is called. Set this property to true to allow Qt to release the buffer @@ -1158,6 +1150,32 @@ void QWaylandQuickItem::updateInputMethod(Qt::InputMethodQueries queries) } #endif +/*! + * \qmlsignal void QtWaylandCompositor::WaylandQuickItem::surfaceDestroyed() + * + * This signal is emitted when the client has destroyed the \c wl_surface associated + * with the WaylandQuickItem. The handler for this signal is expected to either destroy the + * WaylandQuickItem immediately or start a close animation and then destroy the Item. + * + * If an animation is started, bufferLocked should be set to ensure the item keeps its content + * until the animation finishes + * + * \sa bufferLocked + */ + +/*! + * \fn void QWaylandQuickItem::surfaceDestroyed() + * + * This signal is emitted when the client has destroyed the \c wl_surface associated + * with the QWaylandQuickItem. The handler for this signal is expected to either destroy the + * QWaylandQuickItem immediately or start a close animation and then destroy the Item. + * + * If an animation is started, bufferLocked should be set to ensure the item keeps its content + * until the animation finishes + * + * \sa QWaylandQuickkItem::bufferLocked + */ + QSGNode *QWaylandQuickItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { Q_D(QWaylandQuickItem); diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 945d68827..05113c41c 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -410,7 +410,7 @@ QWaylandSurface::~QWaylandSurface() } /*! - * \qmlmethod void QtWaylandCompositor::WaylandSurface::initialize(object compositor, object client, int id, int version) + * \qmlmethod void QtWaylandCompositor::WaylandSurface::initialize(WaylandCompositor compositor, WaylandClient client, int id, int version) * * Initializes the WaylandSurface with the given \a compositor and \a client, and with the given \a id * and \a version. @@ -888,7 +888,7 @@ void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Re } /*! - * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(object drag) + * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(WaylandDrag drag) * * This signal is emitted when a \a drag has started from this surface. */ diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index d04662447..8295d2a18 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -137,7 +137,7 @@ QByteArray QWaylandIviApplication::interfaceName() } /*! - * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceRequested(object surface, int iviId, object resource) + * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceRequested(WaylandSurface surface, int iviId, WaylandResource resource) * * This signal is emitted when the client has requested an \c ivi_surface to be associated * with \a surface, which is identified by \a id. The handler for this signal is @@ -146,7 +146,7 @@ QByteArray QWaylandIviApplication::interfaceName() */ /*! - * \fn void QWaylandWlShell::iviSurfaceRequested(QWaylandSurface *surface, uint iviId, const QWaylandResource &resource) + * \fn void QWaylandIviApplication::iviSurfaceRequested(QWaylandSurface *surface, uint iviId, const QWaylandResource &resource) * * This signal is emitted when the client has requested an \c ivi_surface to be associated * with \a surface, which is identified by \a id. The handler for this signal is @@ -155,16 +155,16 @@ QByteArray QWaylandIviApplication::interfaceName() */ /*! - * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceCreated(object *iviSurface) + * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceCreated(IviSurface *iviSurface) * * This signal is emitted when an IviSurface has been created. The supplied \a iviSurface is * most commonly used to instantiate a ShellSurfaceItem. */ /*! - * \fn void QtWaylandCompositor::IviApplication::iviSurfaceCreated(QWaylandIviSurface *iviSurface) + * \fn void QWaylandIviApplication::iviSurfaceCreated(QWaylandIviSurface *iviSurface) * - * This signal is emitted when an IviSurface has been created. + * This signal is emitted when an IviSurface, \a iviSurface, has been created. */ QWaylandIviApplicationPrivate::QWaylandIviApplicationPrivate() diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index 08b95b3b5..2bdd4a14d 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -93,10 +93,10 @@ QWaylandIviSurface::QWaylandIviSurface(QWaylandIviApplication *application, QWay } /*! - * \qmlmethod void QtWaylandCompositor::IviSurface::initialize(object iviApplication, object surface, int iviId, object resource) + * \qmlmethod void QtWaylandCompositor::IviSurface::initialize(IviApplication iviApplication, WaylandSurface surface, int iviId, WaylandResource resource) * * Initializes the IviSurface, associating it with the given \a iviApplication, \a surface, - * \a client, \a iviId, and \a resource. + * \a iviId, and \a resource. */ /*! diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 96dbd3dc1..4cdbb0a3a 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -475,9 +475,9 @@ QWaylandWlShellSurface::~QWaylandWlShellSurface() } /*! - * \qmlmethod void QtWaylandCompositor::WlShellSurface::initialize(object shell, object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::WlShellSurface::initialize(WlShell shell, WaylandSurface surface, WaylandResource resource) * - * Initializes the WlShellSurface with \a id and associates it with the given \a shell, \a surface, and \a client. + * Initializes the WlShellSurface and associates it with the given \a shell, \a surface, and \a resource. */ /*! @@ -633,11 +633,6 @@ QWaylandWlShell *QWaylandWlShellSurface::shell() const * This property holds the window type of the WlShellSurface. */ -/*! - * \property QWaylandWlShellSurface::windowType - * - * This property holds the window type of the QWaylandWlShellSurface. - */ Qt::WindowType QWaylandWlShellSurface::windowType() const { Q_D(const QWaylandWlShellSurface); diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index c0cb4f8e4..b5db226c2 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -825,10 +825,10 @@ QWaylandXdgSurfaceV5::QWaylandXdgSurfaceV5(QWaylandXdgShellV5 *xdgShell, QWaylan } /*! - * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::initialize(object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::initialize(XdgShellV5 xdgShell, WaylandSurface surface, WaylandResource resource) * - * Initializes the XdgSurfaceV5, associating it with the given \a surface, - * \a client, and \a id. + * Initializes the XdgSurfaceV5, associating it with the given \a xdgShell, \a surface, + * and \a resource. */ /*! @@ -888,11 +888,11 @@ void QWaylandXdgSurfaceV5::initialize(QWaylandXdgShellV5 *xdgShell, QWaylandSurf * typically in response to the window decorations being dragged by \a seat on the window borders * given by \a edges. * - * \sa QWaylandXdgSurfaceV5::ResizeEdges + * \sa QWaylandXdgSurfaceV5::ResizeEdge */ /*! - * \fn void QWaylandXdgSurfaceV5::startResize(QWaylandSeat *seat, ResizeEdges edges) + * \fn void QWaylandXdgSurfaceV5::startResize(QWaylandSeat *seat, ResizeEdge edges) * * This signal is emitted when the client wants to start an interactive resize of the * QWaylandXdgSurfaceV5, typically in response to the window decorations being dragged by @@ -1048,11 +1048,6 @@ QWaylandSurface *QWaylandXdgSurfaceV5::surface() const * This property holds the window type of the XdgSurfaceV5. */ -/*! - * \property QWaylandXdgSurfaceV5::windowType - * - * This property holds the window type of the QWaylandXdgSurfaceV5. - */ Qt::WindowType QWaylandXdgSurfaceV5::windowType() const { Q_D(const QWaylandXdgSurfaceV5); @@ -1367,10 +1362,10 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSur } /*! - * \qmlmethod void QtWaylandCompositor::XdgPopupV5::initialize(object surface, object parentSurface, object resource) + * \qmlmethod void QtWaylandCompositor::XdgPopupV5::initialize(XdgShellV5 shell, WaylandSurface surface, WaylandSurface parentSurface, point position, WaylandResource resource) * * Initializes the xdg popup, associating it with the given \a shell, \a surface, - * \a parentSurface and \a resource. + * \a parentSurface, \a position and \a resource. */ /*! diff --git a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri index df3aead3e..e20c6802c 100644 --- a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -QMAKE_USE_PRIVATE += wayland-server wayland-egl +QMAKE_USE_PRIVATE += egl wayland-server wayland-egl QT += egl_support-private diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 453800c18..f5e63aec5 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -198,10 +198,14 @@ public: QEGLStreamConvenience *funcs; static WaylandEglClientBufferIntegrationPrivate *get(WaylandEglClientBufferIntegration *integration) { - return integration->d_ptr.data(); + return shuttingDown ? nullptr : integration->d_ptr.data(); } + + static bool shuttingDown; }; +bool WaylandEglClientBufferIntegrationPrivate::shuttingDown = false; + BufferState::BufferState() : egl_format(EGL_TEXTURE_RGBA) , egl_stream(EGL_NO_STREAM_KHR) @@ -395,6 +399,11 @@ WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration() { } +WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration() +{ + WaylandEglClientBufferIntegrationPrivate::shuttingDown = true; +} + void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display) { Q_D(WaylandEglClientBufferIntegration); @@ -480,6 +489,24 @@ WaylandEglClientBuffer::WaylandEglClientBuffer(WaylandEglClientBufferIntegration } } + +WaylandEglClientBuffer::~WaylandEglClientBuffer() +{ + auto *p = WaylandEglClientBufferIntegrationPrivate::get(m_integration); + + if (p) { + for (auto image : d->egl_images) + p->egl_destroy_image(p->egl_display, image); + + if (d->egl_stream) + p->funcs->destroy_stream(p->egl_display, d->egl_stream); + + for (auto *texture : d->textures) + delete texture; + } + delete d; +} + static QWaylandBufferRef::BufferFormatEgl formatFromEglFormat(EGLint format) { switch (format) { case EGL_TEXTURE_RGB: diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h index 5217039d8..60ce814de 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h @@ -53,6 +53,7 @@ class WaylandEglClientBufferIntegration : public QtWayland::ClientBufferIntegrat Q_DECLARE_PRIVATE(WaylandEglClientBufferIntegration) public: WaylandEglClientBufferIntegration(); + ~WaylandEglClientBufferIntegration(); void initializeHardware(struct ::wl_display *display) override; @@ -68,6 +69,8 @@ struct BufferState; class WaylandEglClientBuffer : public QtWayland::ClientBuffer { public: + ~WaylandEglClientBuffer(); + QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const override; QSize size() const override; QWaylandSurface::Origin origin() const override; |