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:
@@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user