summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-02-01 10:24:35 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-02-02 09:32:36 +0100
commitfeb6711a7962c210a2c88f416200e266fb30597a (patch)
treeba298c370fbe4aeab7648bc8e6336224225cc00a /src/gui/image/qimage.cpp
parentb23f5621d7e5275dbb3f96f6b46f691c8b19a13d (diff)
Segment qimage conversion block irrelevant of depth
Always try segments from 64k to 128k pixels, this matches qimagescale logic, and gives a one percent speedup locally. Change-Id: I3ef468eac9dca4b84f04850e970f3d15a4f16255 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index cced1d9942..8d8245525a 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4826,7 +4826,7 @@ void QImage::applyColorTransform(const QColorTransform &transform)
}
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
- int segments = sizeInBytes() / (1<<16);
+ int segments = (qsizetype(width()) * height()) >> 16;
segments = std::min(segments, height());
QThreadPool *threadPool = QThreadPool::globalInstance();
if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) {