[libcalamaresui] Remove unused parameter/functionality

- nothing in Calamares uses the tinting, and it triggers some
  deprecation warnings, so just remove it.
main
Adriaan de Groot 4 years ago
parent 2878c474c5
commit 268cf203a8

@ -34,9 +34,9 @@ ImageRegistry::icon( const QString& image, CalamaresUtils::ImageMode mode )
qint64
ImageRegistry::cacheKey( const QSize& size, qreal opacity, QColor tint )
ImageRegistry::cacheKey( const QSize& size, qreal opacity )
{
return size.width() * 100 + size.height() * 10 + static_cast< qint64 >( opacity * 100.0 ) + tint.value();
return size.width() * 100 + size.height() * 10 + static_cast< qint64 >( opacity * 100.0 );
}
@ -44,8 +44,7 @@ QPixmap
ImageRegistry::pixmap( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode,
qreal opacity,
QColor tint )
qreal opacity )
{
Q_ASSERT( !( size.width() < 0 || size.height() < 0 ) );
if ( size.width() < 0 || size.height() < 0 )
@ -64,7 +63,7 @@ ImageRegistry::pixmap( const QString& image,
{
subsubcache = subcache.value( mode );
const qint64 ck = cacheKey( size, opacity, tint );
const qint64 ck = cacheKey( size, opacity );
if ( subsubcache.contains( ck ) )
{
return subsubcache.value( ck );
@ -85,19 +84,6 @@ ImageRegistry::pixmap( const QString& image,
svgRenderer.render( &pixPainter );
pixPainter.end();
if ( tint.alpha() > 0 )
{
QImage resultImage( p.size(), QImage::Format_ARGB32_Premultiplied );
QPainter painter( &resultImage );
painter.drawPixmap( 0, 0, p );
painter.setCompositionMode( QPainter::CompositionMode_Screen );
painter.fillRect( resultImage.rect(), tint );
painter.end();
resultImage.setAlphaChannel( p.toImage().alphaChannel() );
p = QPixmap::fromImage( resultImage );
}
pixmap = p;
}
else
@ -128,7 +114,7 @@ ImageRegistry::pixmap( const QString& image,
}
}
putInCache( image, size, mode, opacity, pixmap, tint );
putInCache( image, size, mode, opacity, pixmap );
}
return pixmap;
@ -140,8 +126,7 @@ ImageRegistry::putInCache( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode,
qreal opacity,
const QPixmap& pixmap,
QColor tint )
const QPixmap& pixmap )
{
QHash< qint64, QPixmap > subsubcache;
QHash< int, QHash< qint64, QPixmap > > subcache;
@ -155,7 +140,7 @@ ImageRegistry::putInCache( const QString& image,
}
}
subsubcache.insert( cacheKey( size, opacity, tint ), pixmap );
subsubcache.insert( cacheKey( size, opacity ), pixmap );
subcache.insert( mode, subsubcache );
s_cache.insert( image, subcache );
}

@ -25,17 +25,15 @@ public:
QPixmap pixmap( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode = CalamaresUtils::Original,
qreal opacity = 1.0,
QColor tint = QColor( 0, 0, 0, 0 ) );
qreal opacity = 1.0 );
private:
qint64 cacheKey( const QSize& size, qreal opacity, QColor tint );
qint64 cacheKey( const QSize& size, qreal opacity );
void putInCache( const QString& image,
const QSize& size,
CalamaresUtils::ImageMode mode,
qreal opacity,
const QPixmap& pixmap,
QColor tint );
const QPixmap& pixmap );
};
#endif // IMAGE_REGISTRY_H

Loading…
Cancel
Save