summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTasuku Suzuki <[email protected]>2023-08-17 11:46:53 +0900
committerTasuku Suzuki <[email protected]>2023-08-23 02:58:15 +0900
commitb77e1de2badd0f207680987e33d5f0e95e9fe4d0 (patch)
tree8903ad034774807e890da6ead88b32327fbe76d1
parent9218c8f4ea863f13c8f379ffdd64fc74d323937c (diff)
Fix build with -no-feature-thread
Change-Id: I7158f92faa1d6b3b0fe6322998682b825af908be Reviewed-by: Hatem ElKharashy <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/gui/util/qgraphicsframecapturerenderdoc.cpp11
-rw-r--r--src/gui/util/qgraphicsframecapturerenderdoc_p_p.h4
2 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/util/qgraphicsframecapturerenderdoc.cpp b/src/gui/util/qgraphicsframecapturerenderdoc.cpp
index fad0591b801..800729b5a5a 100644
--- a/src/gui/util/qgraphicsframecapturerenderdoc.cpp
+++ b/src/gui/util/qgraphicsframecapturerenderdoc.cpp
@@ -15,7 +15,9 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcGraphicsFrameCapture, "qt.gui.graphicsframecapture")
RENDERDOC_API_1_6_0 *QGraphicsFrameCaptureRenderDoc::s_rdocApi = nullptr;
+#if QT_CONFIG(thread)
QBasicMutex QGraphicsFrameCaptureRenderDoc::s_frameCaptureMutex;
+#endif
static void *glNativeContext(QOpenGLContext *context) {
void *nctx = nullptr;
@@ -166,8 +168,10 @@ void QGraphicsFrameCaptureRenderDoc::startCaptureFrame()
return;
}
+#if QT_CONFIG(thread)
// There is a single instance of RenderDoc library and it needs mutex for multithreading access.
QMutexLocker locker(&s_frameCaptureMutex);
+#endif
if (s_rdocApi->IsFrameCapturing()) {
qCWarning(lcGraphicsFrameCapture) << "A frame capture is already in progress, "
"will not initiate another one until"
@@ -195,8 +199,10 @@ void QGraphicsFrameCaptureRenderDoc::endCaptureFrame()
return;
}
+#if QT_CONFIG(thread)
// There is a single instance of RenderDoc library and it needs mutex for multithreading access.
QMutexLocker locker(&s_frameCaptureMutex);
+#endif
if (!s_rdocApi->IsFrameCapturing()) {
qCWarning(lcGraphicsFrameCapture) << "A call to QGraphicsFrameCapture::endCaptureFrame can not be done"
" without a call to QGraphicsFrameCapture::startCaptureFrame";
@@ -247,8 +253,10 @@ void QGraphicsFrameCaptureRenderDoc::openCapture()
return;
}
+#if QT_CONFIG(thread)
// There is a single instance of RenderDoc library and it needs mutex for multithreading access.
QMutexLocker locker(&s_frameCaptureMutex);
+#endif
if (s_rdocApi->IsTargetControlConnected())
s_rdocApi->ShowReplayUI();
else
@@ -257,9 +265,10 @@ void QGraphicsFrameCaptureRenderDoc::openCapture()
void QGraphicsFrameCaptureRenderDoc::init()
{
-
+#if QT_CONFIG(thread)
// There is a single instance of RenderDoc library and it needs mutex for multithreading access.
QMutexLocker locker(&s_frameCaptureMutex);
+#endif
QLibrary renderDocLib(QStringLiteral("renderdoc"));
pRENDERDOC_GetAPI RENDERDOC_GetAPI = (pRENDERDOC_GetAPI) renderDocLib.resolve("RENDERDOC_GetAPI");
diff --git a/src/gui/util/qgraphicsframecapturerenderdoc_p_p.h b/src/gui/util/qgraphicsframecapturerenderdoc_p_p.h
index 8198c0325cb..c0d92ea733d 100644
--- a/src/gui/util/qgraphicsframecapturerenderdoc_p_p.h
+++ b/src/gui/util/qgraphicsframecapturerenderdoc_p_p.h
@@ -21,7 +21,9 @@
QT_BEGIN_NAMESPACE
+#if QT_CONFIG(thread)
class QBasicMutex;
+#endif
class QGraphicsFrameCaptureRenderDoc : public QGraphicsFrameCapturePrivate
{
@@ -40,7 +42,9 @@ private:
void init();
void updateCapturePathAndTemplate();
static RENDERDOC_API_1_5_0 *s_rdocApi;
+#if QT_CONFIG(thread)
static QBasicMutex s_frameCaptureMutex;
+#endif
bool m_nativeHandlesSet;
};