diff options
author | Elvis Lee <kwangwoong.lee@lge.com> | 2021-05-25 19:52:09 +0900 |
---|---|---|
committer | Elvis Lee <kwangwoong.lee@lge.com> | 2021-05-31 16:21:07 +0900 |
commit | b763917e2d2709a335d1fe9e5f87098bb6a2c794 (patch) | |
tree | 74b8aed6bfab914341bc8afe7cc1f9fa42022366 | |
parent | 5431edc8ad195b97e292921d6df78186993caa4b (diff) | |
download | qtwayland-b763917e2d2709a335d1fe9e5f87098bb6a2c794.tar.gz |
Enhance QWaylandQuickHardwareLayer support
1. method to re-enable scenegraph painting
2. method to initialize in native level
Change-Id: Ia680c25d327608fd9163b46f3d1051d44dc759a8
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
3 files changed, 12 insertions, 4 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickhardwarelayer.cpp b/src/compositor/compositor_api/qwaylandquickhardwarelayer.cpp index 55ac61cf..0c5b2f0a 100644 --- a/src/compositor/compositor_api/qwaylandquickhardwarelayer.cpp +++ b/src/compositor/compositor_api/qwaylandquickhardwarelayer.cpp @@ -160,9 +160,16 @@ void QWaylandQuickHardwareLayer::componentComplete() qWarning() << "No hardware layer integration. WaylandHarwareLayer has no effect."; } -void QWaylandQuickHardwareLayer::disableSceneGraphPainting() +void QWaylandQuickHardwareLayer::setSceneGraphPainting(bool enable) { - waylandItem()->setPaintEnabled(false); + waylandItem()->setPaintEnabled(enable); +} + +// This should be called if QWaylandQuickHardwareLayer used as a native instance, not a qml component. +void QWaylandQuickHardwareLayer::initialize() +{ + classBegin(); + componentComplete(); } QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h b/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h index 90eaf85b..6b6a3f9a 100644 --- a/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h +++ b/src/compositor/compositor_api/qwaylandquickhardwarelayer_p.h @@ -67,7 +67,8 @@ public: void classBegin() override; void componentComplete() override; - void disableSceneGraphPainting(); + void setSceneGraphPainting(bool); + void initialize(); Q_SIGNALS: void stackingLevelChanged(); diff --git a/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp b/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp index e527e1a0..a01b2798 100644 --- a/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp +++ b/src/hardwareintegration/compositor/hardwarelayer/vsp2/vsp2hardwarelayerintegration.cpp @@ -68,7 +68,7 @@ Vsp2Layer::Vsp2Layer(QWaylandQuickHardwareLayer *hwLayer, Vsp2HardwareLayerInteg connect(hwLayer->waylandItem(), &QWaylandQuickItem::surfaceChanged, this, &Vsp2Layer::handleSurfaceChanged); connect(hwLayer->waylandItem(), &QQuickItem::opacityChanged, this, &Vsp2Layer::updateOpacity); connect(hwLayer->waylandItem()->window(), &QQuickWindow::afterSynchronizing, this, &Vsp2Layer::updatePosition); - hwLayer->disableSceneGraphPainting(); + hwLayer->setSceneGraphPainting(false); QWaylandViewPrivate::get(hwLayer->waylandItem()->view())->independentFrameCallback = true; handleSurfaceChanged(); } |