avoid unnecessary conversion: QPixmap->QImage->QPixmap
svn path=/trunk/KDE/kdebase/workspace/; revision=535225
This commit is contained in:
parent
a54ba477c3
commit
86d995aec4
3 changed files with 3 additions and 3 deletions
|
@ -695,7 +695,7 @@ void KDEDefaultButton::drawButton(QPainter *p)
|
|||
// Smooth scale the pixmap for small titlebars
|
||||
// This is slow, but we assume this isn't done too often
|
||||
if ( width() < 16 ) {
|
||||
btnpix = QPixmap::fromImage(btnpix.toImage().scaled(12, 12));
|
||||
btnpix.scaled(12, 12);
|
||||
p->drawPixmap( 0, 0, btnpix );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -261,7 +261,7 @@ void PlastikButton::drawButton(QPainter *painter)
|
|||
{
|
||||
QPixmap menuIcon(m_client->icon().pixmap( style()->pixelMetric( QStyle::PM_SmallIconSize ) ));
|
||||
if (width() < menuIcon.width() || height() < menuIcon.height() ) {
|
||||
menuIcon = QPixmap::fromImage( menuIcon.toImage().scaled(width(), height()));
|
||||
menuIcon.scaled(width(), height());
|
||||
}
|
||||
bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
|
||||
}
|
||||
|
|
|
@ -494,7 +494,7 @@ void QuartzButton::drawButton(QPainter *p)
|
|||
if ( height() < 16)
|
||||
{
|
||||
// Smooth scale the image
|
||||
QPixmap tmpPix = QPixmap::fromImage( btnpix.toImage().scaled(height(), height(), Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
|
||||
QPixmap tmpPix ( btnpix.scaled(height(), height(), Qt::IgnoreAspectRatio,Qt::SmoothTransformation) );
|
||||
p->drawPixmap( 0, 0, tmpPix );
|
||||
} else {
|
||||
Offset += (height() - 16)/2;
|
||||
|
|
Loading…
Reference in a new issue