Try to load the data in prePaintWindow() instead of paintWindow() if it's not loaded yet.
This way we won't request the window to be painted when loading fails or has failed. Also remove 2 lines of obsolete code. svn path=/branches/work/kwin_composite/; revision=647139
This commit is contained in:
parent
16c9f2f228
commit
295477c4ad
1 changed files with 17 additions and 15 deletions
|
@ -96,6 +96,11 @@ void ExplosionEffect::prePaintScreen( int* mask, QRegion* region, int time )
|
|||
void ExplosionEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time )
|
||||
{
|
||||
if( mWindows.contains( w ))
|
||||
{
|
||||
SceneOpenGL::Window* glwin = dynamic_cast< SceneOpenGL::Window* >( w->sceneWindow() );
|
||||
if( mValid && glwin && !mInited )
|
||||
mValid = loadData();
|
||||
if( mValid )
|
||||
{
|
||||
mWindows[ w ] += time / 700.0; // complete change in 700ms
|
||||
if( mWindows[ w ] < 1 )
|
||||
|
@ -111,6 +116,7 @@ void ExplosionEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint
|
|||
mActiveAnimations--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
effects->prePaintWindow( w, mask, paint, clip, time );
|
||||
}
|
||||
|
@ -120,15 +126,11 @@ void ExplosionEffect::paintWindow( EffectWindow* w, int mask, QRegion region, Wi
|
|||
// Make sure we have OpenGL compositing and the window is vidible and not a
|
||||
// special window
|
||||
SceneOpenGL::Window* glwin = dynamic_cast< SceneOpenGL::Window* >( w->sceneWindow() );
|
||||
//Client* c = qobject_cast< Client* >( w->window() );
|
||||
bool useshader = ( mValid && glwin && mWindows.contains( w ) );
|
||||
if( useshader && !mInited )
|
||||
useshader = mValid = loadData();
|
||||
if( useshader )
|
||||
{
|
||||
float maxscaleadd = 1.5f;
|
||||
float scale = 1 + maxscaleadd*mWindows[w];
|
||||
//data.xTranslate = (f - 1)*
|
||||
data.xScale = scale;
|
||||
data.yScale = scale;
|
||||
data.xTranslate += int( w->window()->width() / 2 * ( 1 - scale ));
|
||||
|
|
Loading…
Reference in a new issue