1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01: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;
m_defaultImage = false;
QByteArray ba;
QBuffer buffer( &ba );
buffer.open( QIODevice::WriteOnly );
pixmap.save( &buffer, "PNG" );
QString newImageMd5 = TomahawkUtils::md5( buffer.data() );
QCryptographicHash hash( QCryptographicHash::Md5 );
const QImage img = pixmap.toImage();
hash.addData( (const char*)img.constBits(), img.byteCount() );
const QString newImageMd5 = hash.result();
if ( m_oldImageMd5 == newImageMd5 )
return;