diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-06-27 14:17:37 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-06-27 14:50:40 +0200 |
commit | 3038bec859895b1591b7035d4d397d45fce488bc (patch) | |
tree | 01ad74ce58d21d35c9a4ad8e43cec878c60fa327 | |
parent | ec0a5db0479645b14efea2525b6a801b6cf665d6 (diff) | |
parent | 9b531b319d263bf917c1e0a3d35de5b45de15ad0 (diff) | |
download | qtwayland-3038bec859895b1591b7035d4d397d45fce488bc.tar.gz |
Merge remote-tracking branch 'qt/5.9' into dev
Change-Id: I286b58e2c3a42c1078fd25d5b699c8a17edb1c23
18 files changed, 60 insertions, 20 deletions
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index 4e7e7ee5..eebd69a8 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -84,10 +84,10 @@ QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create( // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandClientBufferIntegration *ret = qLoadPlugin1<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(directLoader(), name, args)) + if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (QWaylandClientBufferIntegration *ret = qLoadPlugin1<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args)) + if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif return 0; diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index 527dc571..aa2f54cb 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -84,10 +84,10 @@ QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create( // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandServerBufferIntegration *ret = qLoadPlugin1<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(directLoader(), name, args)) + if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (QWaylandServerBufferIntegration *ret = qLoadPlugin1<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args)) + if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif return 0; diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp index c069a364..94eca326 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp @@ -84,10 +84,10 @@ QWaylandInputDeviceIntegration *QWaylandInputDeviceIntegrationFactory::create(co // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandInputDeviceIntegration *ret = qLoadPlugin1<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(directLoader(), name, args)) + if (QWaylandInputDeviceIntegration *ret = qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (QWaylandInputDeviceIntegration *ret = qLoadPlugin1<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(loader(), name, args)) + if (QWaylandInputDeviceIntegration *ret = qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(loader(), name, args)) return ret; #endif return Q_NULLPTR; diff --git a/src/client/qwaylanddecorationfactory.cpp b/src/client/qwaylanddecorationfactory.cpp index 1279e303..ccf2c806 100644 --- a/src/client/qwaylanddecorationfactory.cpp +++ b/src/client/qwaylanddecorationfactory.cpp @@ -84,10 +84,10 @@ QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &nam // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandAbstractDecoration *ret = qLoadPlugin1<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(directLoader(), name, args)) + if (QWaylandAbstractDecoration *ret = qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(directLoader(), name, args)) return ret; } - if (QWaylandAbstractDecoration *ret = qLoadPlugin1<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args)) + if (QWaylandAbstractDecoration *ret = qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args)) return ret; #endif diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index 0afdda4c..045748a1 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -171,12 +171,20 @@ QPaintDevice *QWaylandShmBackingStore::paintDevice() return contentSurface(); } -void QWaylandShmBackingStore::beginPaint(const QRegion &) +void QWaylandShmBackingStore::beginPaint(const QRegion ®ion) { mPainting = true; ensureSize(); waylandWindow()->setCanResize(false); + + if (mBackBuffer->image()->hasAlphaChannel()) { + QPainter p(paintDevice()); + p.setCompositionMode(QPainter::CompositionMode_Source); + const QColor blank = Qt::transparent; + for (const QRect &rect : region) + p.fillRect(rect, blank); + } } void QWaylandShmBackingStore::endPaint() diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 8564cc9d..251368ef 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -94,7 +94,7 @@ public: void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; void resize(const QSize &size, const QRegion &staticContents) override; void resize(const QSize &size); - void beginPaint(const QRegion &) override; + void beginPaint(const QRegion ®ion) override; void endPaint() override; QWaylandAbstractDecoration *windowDecoration() const; diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp index 8bee45c7..09c62339 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp +++ b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp @@ -84,10 +84,10 @@ QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandShellIntegration *ret = qLoadPlugin1<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args)) + if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (QWaylandShellIntegration *ret = qLoadPlugin1<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args)) + if (QWaylandShellIntegration *ret = qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args)) return ret; #endif return Q_NULLPTR; diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index fb493e8f..14d4a9f1 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -835,7 +835,7 @@ void QWaylandQuickItem::setAllowDiscardFrontBuffer(bool discard) } /*! - * \qmlmethod QtWaylandCompositor::WaylandQuickItem::setPrimary + * \qmlmethod WaylandQuickItem::setPrimary() * * Makes this WaylandQuickItem the primary view for the surface. */ diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index fd323f0e..038e41b1 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -532,10 +532,10 @@ QSize QWaylandWlShellSurface::sizeForResize(const QSizeF &size, const QPointF &d */ /*! - * \qmlmethod void QtWaylandCompositor::WlShellSurface::sendConfigure(size size, enum edges) + * \qmlmethod void WlShellSurface::sendConfigure(size s, enum edges) * * Sends a configure event to the client, suggesting that it resize its surface to - * the provided \a size. The \a edges provide a hint about how the surface + * the provided size \a s. The \a edges provide a hint about how the surface * was resized. */ diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp index 0d3b8e5b..57359190 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp @@ -84,10 +84,10 @@ ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &n // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (ClientBufferIntegration *ret = qLoadPlugin1<ClientBufferIntegration, ClientBufferIntegrationPlugin>(directLoader(), name, args)) + if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (ClientBufferIntegration *ret = qLoadPlugin1<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args)) + if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif return 0; diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp index a1638f21..6425f7c3 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp @@ -84,10 +84,10 @@ ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &n // Try loading the plugin from platformPluginPath first: if (!pluginPath.isEmpty()) { QCoreApplication::addLibraryPath(pluginPath); - if (ServerBufferIntegration *ret = qLoadPlugin1<ServerBufferIntegration, ServerBufferIntegrationPlugin>(directLoader(), name, args)) + if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(directLoader(), name, args)) return ret; } - if (ServerBufferIntegration *ret = qLoadPlugin1<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args)) + if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args)) return ret; #endif return 0; diff --git a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp index 01a4f3d7..7d7e787c 100644 --- a/src/compositor/wayland_wrapper/qwlclientbuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlclientbuffer.cpp @@ -170,11 +170,14 @@ QOpenGLTexture *SharedMemoryBuffer::toOpenGlTexture(int plane) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); // TODO: partial texture upload QImage image = this->image(); + m_shmTexture->setSize(image.width(), image.height()); if (image.hasAlphaChannel()) { + m_shmTexture->setFormat(QOpenGLTexture::RGBAFormat); if (image.format() != QImage::Format_RGBA8888) image = image.convertToFormat(QImage::Format_RGBA8888); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, image.constBits()); } else { + m_shmTexture->setFormat(QOpenGLTexture::RGBFormat); if (image.format() != QImage::Format_RGBX8888) image = image.convertToFormat(QImage::Format_RGBX8888); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, image.constBits()); diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index bb592698..a1937c92 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -272,6 +272,8 @@ void DataDeviceManager::comp_destroy(wl_client *, wl_resource *) { } +QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers") + const struct wl_data_offer_interface DataDeviceManager::compositor_offer_interface = { DataDeviceManager::comp_accept, DataDeviceManager::comp_receive, diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp index 9842f61c..f2709983 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp @@ -91,6 +91,7 @@ public: { wl_array_release(&m_array); wl_buffer_destroy(mBuffer); + mBuffer = nullptr; } QSize size() const { return m_size; } diff --git a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp index e4bfe27d..2312a468 100644 --- a/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/libhybris-egl-server/libhybriseglserverbufferintegration.cpp @@ -172,7 +172,7 @@ void LibHybrisEglServerBufferIntegration::initializeHardware(QWaylandCompositor return; } - QtWaylandServer::qt_libhybris_egl_server_buffer::init(compositor->waylandDisplay(), 1); + QtWaylandServer::qt_libhybris_egl_server_buffer::init(compositor->display(), 1); } bool LibHybrisEglServerBufferIntegration::supportsFormat(QtWayland::ServerBuffer::Format format) const diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 116c9729..c9133a22 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -456,6 +456,17 @@ static QWaylandBufferRef::BufferFormatEgl formatFromEglFormat(EGLint format) { return QWaylandBufferRef::BufferFormatEgl_RGBA; } +static QOpenGLTexture::TextureFormat openGLFormatFromEglFormat(EGLint format) { + switch (format) { + case EGL_TEXTURE_RGB: + return QOpenGLTexture::RGBFormat; + case EGL_TEXTURE_RGBA: + return QOpenGLTexture::RGBAFormat; + default: + return QOpenGLTexture::NoFormat; + } +} + QWaylandBufferRef::BufferFormatEgl WaylandEglClientBuffer::bufferFormatEgl() const { return formatFromEglFormat(d->egl_format); @@ -472,6 +483,8 @@ QOpenGLTexture *WaylandEglClientBuffer::toOpenGlTexture(int plane) : GL_TEXTURE_2D); if (!texture) { texture = new QOpenGLTexture(target); + texture->setFormat(openGLFormatFromEglFormat(d->egl_format)); + texture->setSize(d->size.width(), d->size.height()); texture->create(); d->textures[plane] = texture; } diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index 5b9707a5..01dfa921 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -392,6 +392,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("\n"); printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); QByteArray serverExport; if (headerPath.size()) { serverExport = QByteArray("Q_WAYLAND_SERVER_") + preProcessorProtocolName + "_EXPORT"; @@ -533,6 +535,7 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("}\n"); printf("\n"); + printf("QT_WARNING_POP\n"); printf("QT_END_NAMESPACE\n"); printf("\n"); printf("#endif\n"); @@ -545,6 +548,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("#include <%s/qwayland-server-%s.h>\n", headerPath.constData(), QByteArray(protocolName).replace('_', '-').constData()); printf("\n"); printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); printf("\n"); printf("namespace QtWaylandServer {\n"); @@ -827,6 +832,7 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr } printf("}\n"); printf("\n"); + printf("QT_WARNING_POP\n"); printf("QT_END_NAMESPACE\n"); } @@ -843,6 +849,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("#include <QString>\n"); printf("\n"); printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); QByteArray clientExport; @@ -940,6 +948,7 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr } printf("}\n"); printf("\n"); + printf("QT_WARNING_POP\n"); printf("QT_END_NAMESPACE\n"); printf("\n"); printf("#endif\n"); @@ -952,6 +961,8 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("#include <%s/qwayland-%s.h>\n", headerPath.constData(), QByteArray(protocolName).replace('_', '-').constData()); printf("\n"); printf("QT_BEGIN_NAMESPACE\n"); + printf("QT_WARNING_PUSH\n"); + printf("QT_WARNING_DISABLE_GCC(\"-Wmissing-field-initializers\")\n"); printf("\n"); printf("namespace QtWayland {\n"); for (int j = 0; j < interfaces.size(); ++j) { @@ -1134,6 +1145,7 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr } printf("}\n"); printf("\n"); + printf("QT_WARNING_POP\n"); printf("QT_END_NAMESPACE\n"); } } diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp index 0e2d1a40..6acf312e 100644 --- a/src/shared/qwaylandinputmethodeventbuilder.cpp +++ b/src/shared/qwaylandinputmethodeventbuilder.cpp @@ -108,6 +108,7 @@ void QWaylandInputMethodEventBuilder::addPreeditStyling(uint32_t index, uint32_t format.setFontUnderline(true); format.setUnderlineStyle(QTextCharFormat::SingleUnderline); m_preeditStyles.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, index, length, format)); + break; case 5: format.setFontUnderline(true); format.setUnderlineStyle(QTextCharFormat::WaveUnderline); |