diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-03-19 16:40:31 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-20 00:41:26 +0000 |
commit | a6cfdca7bd97f750bc034ec772f8c42c5458a0ac (patch) | |
tree | 2adcc0bed60905005cc2d5ae2c17c378f374de9b /src/quick/scenegraph/qsgrhisupport_p.h | |
parent | 4ae76406515cb61b56f7a8c97529ce65bf21952b (diff) |
Clean up QSGRhiSupport wrt static functions
Make static everything that can be static. At the same time, make
configure() non-static. Does not change behavior in any way, but
this is the more logical approach. Also more future proof.
Change-Id: I601d59a0547106802f330a7551a97186cde481e0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit fb8ba3f7250f837dd29600d30108ba6f4470a727)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport_p.h')
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport_p.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport_p.h b/src/quick/scenegraph/qsgrhisupport_p.h index 73fa2caad1..db710814bc 100644 --- a/src/quick/scenegraph/qsgrhisupport_p.h +++ b/src/quick/scenegraph/qsgrhisupport_p.h @@ -102,10 +102,15 @@ class QOffscreenSurface; class Q_QUICK_PRIVATE_EXPORT QSGRhiSupport { public: - static void configure(QSGRendererInterface::GraphicsApi api); + static QSGRhiSupport *instance_internal(); static QSGRhiSupport *instance(); static QVulkanInstance *defaultVulkanInstance(); static void cleanupDefaultVulkanInstance(); + static int chooseSampleCountForWindowWithRhi(QWindow *window, QRhi *rhi); + static QImage grabAndBlockInCurrentFrame(QRhi *rhi, QRhiCommandBuffer *cb, QRhiTexture *src = nullptr); + static void checkEnvQSgInfo(); + + void configure(QSGRendererInterface::GraphicsApi api); bool isRhiEnabled() const { return m_enableRhi; } QRhi::Implementation rhiBackend() const { return m_rhiBackend; } @@ -123,24 +128,17 @@ public: const QSGDefaultRenderContext *rc, const QQuickWindow *w); - int chooseSampleCountForWindowWithRhi(QWindow *window, QRhi *rhi); - QOffscreenSurface *maybeCreateOffscreenSurface(QWindow *window); QRhi *createRhi(QQuickWindow *window, QOffscreenSurface *offscreenSurface); void destroyRhi(QRhi *rhi); void prepareWindowForRhi(QQuickWindow *window); - QImage grabAndBlockInCurrentFrame(QRhi *rhi, QRhiCommandBuffer *cb, QRhiTexture *src = nullptr); - QImage grabOffscreen(QQuickWindow *window); - static void checkEnvQSgInfo(); - private: QSGRhiSupport(); void applySettings(); void adjustToPlatformQuirks(); - static QSGRhiSupport *staticInst(); struct { bool valid = false; QSGRendererInterface::GraphicsApi api; |