1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Faster pixmap fading

This commit is contained in:
Leo Franchi
2012-06-05 09:17:05 +01:00
parent 8ba4cb66ea
commit a8ff291a37

View File

@@ -186,11 +186,11 @@ PixmapDelegateFader::setPixmap( const QPixmap& pixmap )
return; return;
m_defaultImage = false; m_defaultImage = false;
QByteArray ba; QCryptographicHash hash( QCryptographicHash::Md5 );
QBuffer buffer( &ba ); const QImage img = pixmap.toImage();
buffer.open( QIODevice::WriteOnly ); hash.addData( (const char*)img.constBits(), img.byteCount() );
pixmap.save( &buffer, "PNG" ); const QString newImageMd5 = hash.result();
QString newImageMd5 = TomahawkUtils::md5( buffer.data() );
if ( m_oldImageMd5 == newImageMd5 ) if ( m_oldImageMd5 == newImageMd5 )
return; return;