aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-31 16:39:34 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-03 10:51:25 +0200
commitff6369767321afc49b37645bb6b85d3556921645 (patch)
treea6a45cd6c6450d5bee220f44412118c5646e229e /src/quick/items/qquickwindow_p.h
parente2c5ee11bcdc2f093004716f5e65e81cdce9ff85 (diff)
Expose the QRhiSwapchain via QSGRendererInterface
...similarly to how we already do it for the QRhi itself. Just follow the same pattern. This allows Qt Quick 3D to stop peeking directly into QQuickWindowPrivate and accessing member variables in there. Code like the following QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window); QRhiCommandBuffer *cb = wd->swapchain->currentFrameCommandBuffer(); QRhiRenderPassDescriptor *rp = wd->rpDescForSwapchain; can now be written ca. like this, without pulling in quick-private: QRhiSwapChain *swapchain = window->rendererInterface->getResource(window, RhiSwapchain) QRhiCommandBuffer *cb = swapchain->currentFrameCommandBuffer(); QRhiRenderPassDescriptor *rp = swapchain->renderPassDescriptor(); This provides a more stable interface between the scenegraph and Quick 3D. In addition, this is also handy for manual tests, external test applications, etc. in case they do QRhi-based rendering in a QQuickWindow. Now these are also fine with just gui-private, no need to access QQuickWindowPrivate anymore. Change-Id: I921fb1c33c2fc77081272b1f180fdc2c87ed3ab5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow_p.h')
-rw-r--r--src/quick/items/qquickwindow_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index afc47ce848..a65b87f8b6 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -131,6 +131,7 @@ public:
};
static inline QQuickWindowPrivate *get(QQuickWindow *c) { return c->d_func(); }
+ static inline const QQuickWindowPrivate *get(const QQuickWindow *c) { return c->d_func(); }
QQuickWindowPrivate();
~QQuickWindowPrivate() override;