plugins/startupfeedback: use inplace QImage::convertTo

to reuse internal buffers
This commit is contained in:
Fushan Wen 2023-09-16 21:17:28 +08:00
parent a7b6093ca0
commit 4716f91b9a
No known key found for this signature in database
GPG key ID: 2E48D1487C91DCAA

View file

@ -389,7 +389,7 @@ QImage StartupFeedbackEffect::scalePixmap(const QPixmap &pm, const QSize &size)
const QSize &adjustedSize = size * m_bounceSizesRatio;
QImage scaled = pm.toImage().scaled(adjustedSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
if (scaled.format() != QImage::Format_ARGB32_Premultiplied && scaled.format() != QImage::Format_ARGB32) {
scaled = scaled.convertToFormat(QImage::Format_ARGB32);
scaled.convertTo(QImage::Format_ARGB32);
}
QImage result(20 * m_bounceSizesRatio, 20 * m_bounceSizesRatio, QImage::Format_ARGB32);