removed use of QPainter::setOpacity to render transitions. This makes the code faster
svn path=/trunk/KDE/kdebase/workspace/; revision=1028374icc-effect-5.14.5
parent
b61c6b1ccb
commit
89453d5147
|
@ -224,10 +224,7 @@ namespace Oxygen
|
|||
if( timeLineIsRunning() )
|
||||
{
|
||||
|
||||
painter.save();
|
||||
painter.setOpacity( opacity() );
|
||||
painter.drawPixmap(0, 0, helper_.windecoButtonGlow(glow, (21.0*client_.configuration().buttonSize())/22));
|
||||
painter.restore();
|
||||
painter.drawPixmap(0, 0, helper_.windecoButtonGlow( helper_.alphaColor( glow, opacity() ), (21.0*client_.configuration().buttonSize())/22));
|
||||
|
||||
} else if( status_ == Oxygen::Hovered ) {
|
||||
|
||||
|
|
|
@ -442,8 +442,11 @@ namespace Oxygen
|
|||
}
|
||||
|
||||
// save painter
|
||||
painter->save();
|
||||
if( clipRect.isValid() ) painter->setClipRegion(clipRect,Qt::IntersectClip);
|
||||
if( clipRect.isValid() )
|
||||
{
|
||||
painter->save();
|
||||
painter->setClipRegion(clipRect,Qt::IntersectClip);
|
||||
}
|
||||
|
||||
QRect r = (isPreview()) ? OxygenClient::widget()->rect():window->rect();
|
||||
qreal shadowSize( oxygenShadowCache()->shadowSize() );
|
||||
|
@ -508,7 +511,8 @@ namespace Oxygen
|
|||
}
|
||||
|
||||
// restore painter
|
||||
painter->restore();
|
||||
if( clipRect.isValid() )
|
||||
{ painter->restore(); }
|
||||
|
||||
}
|
||||
|
||||
|
@ -531,9 +535,11 @@ namespace Oxygen
|
|||
}
|
||||
|
||||
// setup painter
|
||||
painter->save();
|
||||
if( timeLineIsRunning() ) painter->setOpacity( opacity() );
|
||||
if (clipRect.isValid()) painter->setClipRegion(clipRect,Qt::IntersectClip);
|
||||
if (clipRect.isValid())
|
||||
{
|
||||
painter->save();
|
||||
painter->setClipRegion(clipRect,Qt::IntersectClip);
|
||||
}
|
||||
|
||||
QRect r = (isPreview()) ? OxygenClient::widget()->rect():window->rect();
|
||||
qreal shadowSize( oxygenShadowCache()->shadowSize() );
|
||||
|
@ -549,9 +555,12 @@ namespace Oxygen
|
|||
// dimensions
|
||||
int x,y,w,h;
|
||||
r.getRect(&x, &y, &w, &h);
|
||||
helper().drawSeparator( painter, QRect(x, titleTop+titleHeight-1.5, w, 2).translated( -position ), color, Qt::Horizontal);
|
||||
|
||||
painter->restore();
|
||||
QColor local( color );
|
||||
if( timeLineIsRunning() ) local = helper().alphaColor( color, opacity() );
|
||||
helper().drawSeparator( painter, QRect(x, titleTop+titleHeight-1.5, w, 2).translated( -position ), local, Qt::Horizontal);
|
||||
|
||||
if (clipRect.isValid()) { painter->restore(); }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -103,11 +103,24 @@ namespace Oxygen
|
|||
QPainter p( &shadow );
|
||||
p.setRenderHint( QPainter::Antialiasing );
|
||||
|
||||
p.setOpacity( 1.0 - opacity );
|
||||
p.drawPixmap( QPointF(0,0), shadowPixmap( client, false ) );
|
||||
QPixmap inactiveShadow( shadowPixmap( client, false ) );
|
||||
{
|
||||
QPainter pp( &inactiveShadow );
|
||||
pp.setRenderHint( QPainter::Antialiasing );
|
||||
pp.setCompositionMode(QPainter::CompositionMode_DestinationIn);
|
||||
pp.fillRect( inactiveShadow.rect(), QColor( 0, 0, 0, 255*(1.0-opacity ) ) );
|
||||
}
|
||||
|
||||
p.setOpacity( opacity );
|
||||
p.drawPixmap( QPointF(0,0), shadowPixmap( client, true ) );
|
||||
QPixmap activeShadow( shadowPixmap( client, true ) );
|
||||
{
|
||||
QPainter pp( &activeShadow );
|
||||
pp.setRenderHint( QPainter::Antialiasing );
|
||||
pp.setCompositionMode(QPainter::CompositionMode_DestinationIn);
|
||||
pp.fillRect( activeShadow.rect(), QColor( 0, 0, 0, 255*( opacity ) ) );
|
||||
}
|
||||
|
||||
p.drawPixmap( QPointF(0,0), inactiveShadow );
|
||||
p.drawPixmap( QPointF(0,0), activeShadow );
|
||||
p.end();
|
||||
|
||||
TileSet* tileSet = new TileSet(shadow, size, size, 1, 1);
|
||||
|
|
Loading…
Reference in New Issue