Do not recreate text and icon EffectFrame in each rendered frame, but only when it's changed.
svn path=/trunk/KDE/kdebase/workspace/; revision=1160144
This commit is contained in:
parent
18750f6667
commit
b216a23908
1 changed files with 9 additions and 13 deletions
|
@ -408,19 +408,7 @@ void FlipSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& d
|
||||||
if( m_windowTitle )
|
if( m_windowTitle )
|
||||||
{
|
{
|
||||||
// Render the caption frame
|
// Render the caption frame
|
||||||
double opacity = 1.0;
|
m_captionFrame->render( region, m_startStopTimeLine.value() );
|
||||||
opacity = m_startStopTimeLine.value();
|
|
||||||
QPixmap iconPixmap = m_selectedWindow->icon();
|
|
||||||
if( m_start || m_stop )
|
|
||||||
{
|
|
||||||
int alpha = 255.0f * m_startStopTimeLine.value();
|
|
||||||
QPixmap transparency = iconPixmap.copy( iconPixmap.rect() );
|
|
||||||
transparency.fill( QColor( 255, 255, 255, alpha ));
|
|
||||||
iconPixmap.setAlphaChannel( transparency.alphaChannel() );
|
|
||||||
}
|
|
||||||
m_captionFrame->setText( m_selectedWindow->caption() );
|
|
||||||
m_captionFrame->setIcon( iconPixmap );
|
|
||||||
m_captionFrame->render( region, opacity );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -613,6 +601,8 @@ void FlipSwitchEffect::tabBoxUpdated()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_selectedWindow = effects->currentTabBoxWindow();
|
m_selectedWindow = effects->currentTabBoxWindow();
|
||||||
|
m_captionFrame->setText( m_selectedWindow->caption() );
|
||||||
|
m_captionFrame->setIcon( m_selectedWindow->icon() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
effects->addRepaintFull();
|
effects->addRepaintFull();
|
||||||
|
@ -716,6 +706,8 @@ void FlipSwitchEffect::setActive( bool activate, FlipSwitchMode mode )
|
||||||
QFontMetrics( m_captionFont ).height() );
|
QFontMetrics( m_captionFont ).height() );
|
||||||
m_captionFrame->setGeometry( frameRect );
|
m_captionFrame->setGeometry( frameRect );
|
||||||
m_captionFrame->setIconSize( QSize( frameRect.height(), frameRect.height() ));
|
m_captionFrame->setIconSize( QSize( frameRect.height(), frameRect.height() ));
|
||||||
|
m_captionFrame->setText( m_selectedWindow->caption() );
|
||||||
|
m_captionFrame->setIcon( m_selectedWindow->icon() );
|
||||||
effects->addRepaintFull();
|
effects->addRepaintFull();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -980,6 +972,8 @@ void FlipSwitchEffect::grabbedKeyboardEvent(QKeyEvent* e)
|
||||||
}
|
}
|
||||||
if( found )
|
if( found )
|
||||||
{
|
{
|
||||||
|
m_captionFrame->setText( m_selectedWindow->caption() );
|
||||||
|
m_captionFrame->setIcon( m_selectedWindow->icon() );
|
||||||
scheduleAnimation( DirectionForward );
|
scheduleAnimation( DirectionForward );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1013,6 +1007,8 @@ void FlipSwitchEffect::grabbedKeyboardEvent(QKeyEvent* e)
|
||||||
}
|
}
|
||||||
if( found )
|
if( found )
|
||||||
{
|
{
|
||||||
|
m_captionFrame->setText( m_selectedWindow->caption() );
|
||||||
|
m_captionFrame->setIcon( m_selectedWindow->icon() );
|
||||||
scheduleAnimation( DirectionBackward );
|
scheduleAnimation( DirectionBackward );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue