aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-09-16 15:51:21 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-09-18 02:27:10 +0000
commit89d654fcd4f06311c69393d5a1e1fbc8932347a1 (patch)
tree15ed158c2bbbf6f60de325bd0b8d2fea1d2199d8 /src
parentdbf40f74de81e2780e3b14e35704750a2e44d978 (diff)
Clean up GraphicsStateInfo after API review
Change-Id: I715ad71153151a0e6521bc182227d9fa2dc0a3ea Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickwindow.cpp6
-rw-r--r--src/quick/items/qquickwindow.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 6fe2891242..cd620e3408 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -4737,7 +4737,7 @@ void QQuickWindow::resetOpenGLState()
*/
/*!
- \return a pointer to a GraphicsStateInfo struct describing some of the
+ \return a reference to a GraphicsStateInfo struct describing some of the
RHI's internal state, in particular, the double or tripple buffering status
of the backend (such as, the Vulkan or Metal integrations). This is
relevant when the underlying graphics APIs is Vulkan or Metal, and the
@@ -4745,14 +4745,14 @@ void QQuickWindow::resetOpenGLState()
its own often-changing resources, such as, uniform buffers, in order to
avoid stalling the pipeline.
*/
-const QQuickWindow::GraphicsStateInfo *QQuickWindow::graphicsStateInfo()
+const QQuickWindow::GraphicsStateInfo &QQuickWindow::graphicsStateInfo()
{
Q_D(QQuickWindow);
if (d->rhi) {
d->rhiStateInfo.currentFrameSlot = d->rhi->currentFrameSlot();
d->rhiStateInfo.framesInFlight = d->rhi->resourceLimit(QRhi::FramesInFlight);
}
- return &d->rhiStateInfo;
+ return d->rhiStateInfo;
}
/*!
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 9dbff88f0d..56d50cec2a 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -142,10 +142,10 @@ public:
void resetOpenGLState();
#endif
struct GraphicsStateInfo {
- int currentFrameSlot = 0;
- int framesInFlight = 0;
+ int currentFrameSlot;
+ int framesInFlight;
};
- const GraphicsStateInfo *graphicsStateInfo();
+ const GraphicsStateInfo &graphicsStateInfo();
void beginExternalCommands();
void endExternalCommands();
QQmlIncubationController *incubationController() const;