From 4b76d50a11370b68f7c2b6f0725d7e811e238bf3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 23 Jul 2014 11:02:29 +0200 Subject: [PATCH] Core: calling QImage::constBits() instead of QImage::bits() the non-const QImage::bits() performs shared-data checks. With QImage::constBits() we can skip those for sure in cases where we only want to read. Change-Id: Ic5f328b54eb2d9930ad31b4df8d9b636dc005982 Reviewed-by: hjk --- src/plugins/coreplugin/styleanimator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp index 7a283510fe7..61c7f384494 100644 --- a/src/plugins/coreplugin/styleanimator.cpp +++ b/src/plugins/coreplugin/styleanimator.cpp @@ -65,8 +65,8 @@ void Animation::drawBlendedImage(QPainter *painter, const QRect &rect, float alp case 32: { uchar *mixed_data = m_tempImage.bits(); - const uchar *back_data = m_primaryImage.bits(); - const uchar *front_data = m_secondaryImage.bits(); + const uchar *back_data = m_primaryImage.constBits(); + const uchar *front_data = m_secondaryImage.constBits(); for (int sy = 0; sy < sh; sy++) { quint32 *mixed = (quint32*)mixed_data; const quint32* back = (const quint32*)back_data;