summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2023-02-24 10:57:56 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2023-02-25 10:54:19 +0100
commit93047c71e8e6dd4ac28e1e59dcb561df11c759eb (patch)
treeb9f80142d34015b8b61c196868b09423688fe1c8 /src/gui/image/qimage.cpp
parenta861eea14f697d7fb1e06981f83158dba9591fa7 (diff)
Add special thread pool for Qt Gui
To avoid gui slowdowns due to global pool being blocked. Fixes: QTBUG-109511 Pick-to: 6.5 6.4 6.2 Change-Id: I4e8d91e8fb0bd2e395072a082e992a3c5d3464ad Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 8eea2f1366..dc2d936fda 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -35,8 +35,9 @@
#include <private/qfont_p.h>
#if QT_CONFIG(thread)
-#include "qsemaphore.h"
-#include "qthreadpool.h"
+#include <qsemaphore.h>
+#include <qthreadpool.h>
+#include <private/qthreadpool_p.h>
#endif
#include <qtgui_tracepoints_p.h>
@@ -5119,7 +5120,7 @@ void QImage::applyColorTransform(const QColorTransform &transform)
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
int segments = (qsizetype(width()) * height()) >> 16;
segments = std::min(segments, height());
- QThreadPool *threadPool = QThreadPool::globalInstance();
+ QThreadPool *threadPool = QThreadPoolPrivate::qtGuiInstance();
if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) {
QSemaphore semaphore;
int y = 0;