summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qbmphandler_p.h2
-rw-r--r--src/gui/image/qiconloader.cpp8
-rw-r--r--src/gui/image/qimage_conversions.cpp13
-rw-r--r--src/gui/image/qimagereader.cpp4
-rw-r--r--src/gui/image/qimagewriter.cpp19
-rw-r--r--src/gui/image/qpixmap.cpp2
6 files changed, 31 insertions, 17 deletions
diff --git a/src/gui/image/qbmphandler_p.h b/src/gui/image/qbmphandler_p.h
index fd044fc442..e1d744e539 100644
--- a/src/gui/image/qbmphandler_p.h
+++ b/src/gui/image/qbmphandler_p.h
@@ -98,7 +98,7 @@ struct BMP_INFOHDR { // BMP information header
// BMP-Handler, which is also able to read and write the DIB
// (Device-Independent-Bitmap) format used internally in the Windows operating
// system for OLE/clipboard operations. DIB is a subset of BMP (without file
-// header). The Windows-Lighthouse plugin accesses the DIB-functionality.
+// header). The Windows platform plugin accesses the DIB-functionality.
class QBmpHandler : public QImageIOHandler
{
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index e67b387981..15ab1b3cd9 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -797,8 +797,12 @@ QPixmap ScalableEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State
if (svgIcon.isNull())
svgIcon = QIcon(filename);
- // Simply reuse svg icon engine
- return svgIcon.pixmap(size, mode, state);
+ // Bypass QIcon API, as that will scale by device pixel ratio of the
+ // highest DPR screen since we're not passing on any QWindow.
+ if (QIconEngine *engine = svgIcon.data_ptr() ? svgIcon.data_ptr()->engine : nullptr)
+ return engine->pixmap(size, mode, state);
+
+ return QPixmap();
}
QPixmap QIconLoaderEngine::pixmap(const QSize &size, QIcon::Mode mode,
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 6ddd08d08d..34d2b8d8c7 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -48,6 +48,11 @@
#if QT_CONFIG(thread)
#include <qsemaphore.h>
#include <qthreadpool.h>
+#ifdef Q_OS_WASM
+// WebAssembly has threads; however we can't block the main thread.
+#else
+#define QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
+#endif
#endif
QT_BEGIN_NAMESPACE
@@ -227,7 +232,7 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio
}
};
-#if QT_CONFIG(thread)
+#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
int segments = src->nbytes / (1<<16);
segments = std::min(segments, src->height);
@@ -281,7 +286,7 @@ void convert_generic_to_rgb64(QImageData *dest, const QImageData *src, Qt::Image
destData += dest->bytes_per_line;
}
};
-#if QT_CONFIG(thread)
+#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
int segments = src->nbytes / (1<<16);
segments = std::min(segments, src->height);
@@ -388,7 +393,7 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
destData += params.bytesPerLine;
}
};
-#if QT_CONFIG(thread)
+#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
int segments = data->nbytes / (1<<16);
segments = std::min(segments, data->height);
if (segments > 1) {
@@ -426,8 +431,8 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
data->nbytes = params.totalSize;
}
data->bytes_per_line = params.bytesPerLine;
- data->depth = destDepth;
}
+ data->depth = destDepth;
data->format = dst_format;
return true;
}
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 3eb1e01863..5cb7e1328e 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -101,7 +101,7 @@
This can be disabled by setting the environment variable
\c QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING.
- \sa QImageWriter, QImageIOHandler, QImageIOPlugin, QMimeDatabase
+ \sa QImageWriter, QImageIOHandler, QImageIOPlugin, QMimeDatabase, QColorSpace
\sa QImage::devicePixelRatio(), QPixmap::devicePixelRatio(), QIcon, QPainter::drawPixmap(), QPainter::drawImage(), Qt::AA_UseHighDpiPixmaps
*/
@@ -1152,6 +1152,7 @@ bool QImageReader::autoTransform() const
#if QT_DEPRECATED_SINCE(5, 15)
/*!
\since 5.6
+ \obsolete Use QColorSpace conversion on the QImage instead.
This is an image format specific function that forces images with
gamma information to be gamma corrected to \a gamma. For image formats
@@ -1169,6 +1170,7 @@ void QImageReader::setGamma(float gamma)
/*!
\since 5.6
+ \obsolete Use QImage::colorSpace() and QColorSpace::gamma() instead.
Returns the gamma level of the decoded image. If setGamma() has been
called and gamma correction is supported it will return the gamma set.
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 6e74b23f76..33f5e491c7 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -47,19 +47,18 @@
\ingroup painting
\ingroup io
- QImageWriter supports setting format specific options, such as the
- gamma level, compression level and quality, prior to storing the
+ QImageWriter supports setting format specific options, such as
+ compression level and quality, prior to storing the
image. If you do not need such options, you can use QImage::save()
or QPixmap::save() instead.
To store an image, you start by constructing a QImageWriter
object. Pass either a file name or a device pointer, and the
image format to QImageWriter's constructor. You can then set
- several options, such as the gamma level (by calling setGamma())
- and quality (by calling setQuality()). canWrite() returns \c true if
- QImageWriter can write the image (i.e., the image format is
- supported and the device is open for writing). Call write() to
- write the image to the device.
+ several options, such as quality (by calling setQuality()).
+ canWrite() returns \c true if QImageWriter can write the image
+ (i.e., the image format is supported and the device is open for
+ writing). Call write() to write the image to the device.
If any error occurs when writing the image, write() will return
false. You can then call error() to find the type of error that
@@ -81,7 +80,7 @@
\snippet qimagewriter/main.cpp 0
- \sa QImageReader, QImageIOHandler, QImageIOPlugin
+ \sa QImageReader, QImageIOHandler, QImageIOPlugin, QColorSpace
*/
/*!
@@ -500,6 +499,8 @@ int QImageWriter::compression() const
#if QT_DEPRECATED_SINCE(5, 15)
/*!
+ \obsolete Use QColorSpace conversion on the QImage instead.
+
This is an image format specific function that sets the gamma
level of the image to \a gamma. For image formats that do not
support setting the gamma level, this value is ignored.
@@ -515,6 +516,8 @@ void QImageWriter::setGamma(float gamma)
}
/*!
+ \obsolete Use QImage::colorSpace() and QColorSpace::gamma() instead.
+
Returns the gamma level of the image.
\sa setGamma()
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index c162b706cb..a4c5296d9f 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -78,7 +78,7 @@ static bool qt_pixmap_thread_test()
if (qApp->thread() != QThread::currentThread()) {
bool fail = false;
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps)) {
- printf("Lighthouse plugin does not support threaded pixmaps!\n");
+ printf("Platform plugin does not support threaded pixmaps!\n");
fail = true;
}
if (fail) {