Draw queued shadows in window stacking order.
BUG: 172756 svn path=/trunk/KDE/kdebase/workspace/; revision=875189
This commit is contained in:
parent
78131acff8
commit
41cb8b3c86
1 changed files with 20 additions and 5 deletions
|
@ -464,20 +464,35 @@ void ShadowEffect::addQuadVertices(QVector<float>& verts, float x1, float y1, fl
|
||||||
void ShadowEffect::drawQueuedShadows( EffectWindow* behindWindow )
|
void ShadowEffect::drawQueuedShadows( EffectWindow* behindWindow )
|
||||||
{
|
{
|
||||||
QList<ShadowData> newShadowDatas;
|
QList<ShadowData> newShadowDatas;
|
||||||
|
QList<ShadowData> thisTime;
|
||||||
EffectWindowList stack = effects->stackingOrder();
|
EffectWindowList stack = effects->stackingOrder();
|
||||||
foreach( const ShadowData &d, shadowDatas )
|
foreach( const ShadowData &d, shadowDatas )
|
||||||
{
|
{
|
||||||
// If behindWindow is given then only render shadows of the windows
|
// If behindWindow is given then only render shadows of the windows
|
||||||
// that are behind that window.
|
// that are behind that window.
|
||||||
if( !behindWindow || stack.indexOf(d.w) < stack.indexOf(behindWindow))
|
if( !behindWindow || stack.indexOf(d.w) < stack.indexOf(behindWindow))
|
||||||
{
|
thisTime.append(d);
|
||||||
drawShadow( d.w, d.mask, d.region.subtracted( d.clip ), d.data );
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
newShadowDatas.append(d);
|
newShadowDatas.append(d);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if( thisTime.count() )
|
||||||
|
{ // Render them in stacking order
|
||||||
|
foreach( EffectWindow *w, stack )
|
||||||
|
for( int i = 0; i < thisTime.size(); i++ )
|
||||||
|
{ // Cannot use foreach() due to thisTime.removeOne()
|
||||||
|
const ShadowData d = thisTime.at(i);
|
||||||
|
if( d.w == w )
|
||||||
|
{
|
||||||
|
drawShadow( d.w, d.mask,
|
||||||
|
d.region.subtracted( d.clip ), d.data );
|
||||||
|
thisTime.removeAt( i );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Render the rest on the top (For menus, etc.)
|
||||||
|
foreach( const ShadowData &d, thisTime )
|
||||||
|
drawShadow( d.w, d.mask, d.region.subtracted( d.clip ), d.data );
|
||||||
shadowDatas = newShadowDatas;
|
shadowDatas = newShadowDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue