From 96afaf41ca30fc77f92b0ad01e65c767a944354a Mon Sep 17 00:00:00 2001 From: Elvis Lee Date: Tue, 25 May 2021 17:57:24 +0900 Subject: [PATCH] Support hardware composition for webOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In similar way with vsp2, the interfaces are needed to support qtwayland hardware layer for webOS. https://doc.qt.io/qt-5/qml-qtwayland-compositor-waylandhardwarelayer.html Change-Id: I14481373d696b501a774b9258da789554065a6ea Reviewed-by: Tor Arne Vestbø Reviewed-by: Elvis Lee Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/kernel/qplatformscreen_p.h | 13 +++++++++++++ src/gui/platform/unix/qunixnativeinterface.cpp | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/gui/kernel/qplatformscreen_p.h b/src/gui/kernel/qplatformscreen_p.h index bd149ccbac..3ef87625ad 100644 --- a/src/gui/kernel/qplatformscreen_p.h +++ b/src/gui/kernel/qplatformscreen_p.h @@ -91,6 +91,19 @@ struct Q_GUI_EXPORT QVsp2Screen }; #endif +#if defined(Q_OS_WEBOS) || defined(Q_CLANG_QDOC) +struct Q_GUI_EXPORT QWebOSScreen +{ + QT_DECLARE_NATIVE_INTERFACE(QWebOSScreen) + virtual int addLayer(void *gbm_bo, const QRectF &geometry) = 0; + virtual void setLayerBuffer(int id, void *gbm_bo) = 0; + virtual void setLayerGeometry(int id, const QRectF &geometry) = 0; + virtual void setLayerAlpha(int id, qreal alpha) = 0; + virtual bool removeLayer(int id) = 0; + virtual void addFlipListener(void (*callback)()) = 0; +}; +#endif + } // QNativeInterface::Private QT_END_NAMESPACE diff --git a/src/gui/platform/unix/qunixnativeinterface.cpp b/src/gui/platform/unix/qunixnativeinterface.cpp index 9fde98f76a..4febe69d91 100644 --- a/src/gui/platform/unix/qunixnativeinterface.cpp +++ b/src/gui/platform/unix/qunixnativeinterface.cpp @@ -185,6 +185,10 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QXcbWindow); QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QVsp2Screen); #endif +#ifdef Q_OS_WEBOS +QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWebOSScreen); +#endif + #if QT_CONFIG(evdev) /*!