Make sure to unbind the texture in tfp_mode when the underlying pixmap
is discarded. Windows that have previously been mapped and unmapped now update properly when mapped again. svn path=/trunk/KDE/kdebase/workspace/; revision=683977icc-effect-5.14.5
parent
913d8395d8
commit
c2ff6a4d7a
|
@ -407,6 +407,8 @@ void Toplevel::discardWindowPixmap()
|
||||||
return;
|
return;
|
||||||
XFreePixmap( display(), window_pix );
|
XFreePixmap( display(), window_pix );
|
||||||
window_pix = None;
|
window_pix = None;
|
||||||
|
if( effectWindow() != NULL && effectWindow()->sceneWindow() != NULL )
|
||||||
|
effectWindow()->sceneWindow()->pixmapDiscarded();
|
||||||
}
|
}
|
||||||
|
|
||||||
Pixmap Toplevel::createWindowPixmap()
|
Pixmap Toplevel::createWindowPixmap()
|
||||||
|
|
|
@ -1082,7 +1082,6 @@ void EffectWindowImpl::setShader(GLShader* shader)
|
||||||
EffectWindow* effectWindow( Toplevel* w )
|
EffectWindow* effectWindow( Toplevel* w )
|
||||||
{
|
{
|
||||||
EffectWindowImpl* ret = w->effectWindow();
|
EffectWindowImpl* ret = w->effectWindow();
|
||||||
ret->setSceneWindow( NULL ); // just in case
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
scene.h
2
scene.h
|
@ -131,6 +131,8 @@ class Scene::Window
|
||||||
// perform the actual painting of the window
|
// perform the actual painting of the window
|
||||||
virtual void performPaint( int mask, QRegion region, WindowPaintData data ) = 0;
|
virtual void performPaint( int mask, QRegion region, WindowPaintData data ) = 0;
|
||||||
virtual void prepareForPainting() {}
|
virtual void prepareForPainting() {}
|
||||||
|
// do any cleanup needed when the window's composite pixmap is discarded
|
||||||
|
virtual void pixmapDiscarded() {}
|
||||||
int x() const;
|
int x() const;
|
||||||
int y() const;
|
int y() const;
|
||||||
int width() const;
|
int width() const;
|
||||||
|
|
|
@ -691,6 +691,7 @@ void SceneOpenGL::windowClosed( Toplevel* c, Deleted* deleted )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete windows.take( c );
|
delete windows.take( c );
|
||||||
|
c->effectWindow()->setSceneWindow( NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -698,6 +699,7 @@ void SceneOpenGL::windowDeleted( Deleted* c )
|
||||||
{
|
{
|
||||||
assert( windows.contains( c ));
|
assert( windows.contains( c ));
|
||||||
delete windows.take( c );
|
delete windows.take( c );
|
||||||
|
c->effectWindow()->setSceneWindow( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneOpenGL::windowGeometryShapeChanged( Toplevel* c )
|
void SceneOpenGL::windowGeometryShapeChanged( Toplevel* c )
|
||||||
|
@ -749,18 +751,21 @@ void SceneOpenGL::Texture::init()
|
||||||
void SceneOpenGL::Texture::discard()
|
void SceneOpenGL::Texture::discard()
|
||||||
{
|
{
|
||||||
if( mTexture != None )
|
if( mTexture != None )
|
||||||
{
|
release();
|
||||||
if( tfp_mode )
|
|
||||||
{
|
|
||||||
if( !options->glStrictBinding )
|
|
||||||
glXReleaseTexImageEXT( display(), bound_glxpixmap, GLX_FRONT_LEFT_EXT );
|
|
||||||
glXDestroyGLXPixmap( display(), bound_glxpixmap );
|
|
||||||
bound_glxpixmap = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GLTexture::discard();
|
GLTexture::discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SceneOpenGL::Texture::release()
|
||||||
|
{
|
||||||
|
if( tfp_mode && bound_glxpixmap != None )
|
||||||
|
{
|
||||||
|
if( !options->glStrictBinding )
|
||||||
|
glXReleaseTexImageEXT( display(), bound_glxpixmap, GLX_FRONT_LEFT_EXT );
|
||||||
|
glXDestroyGLXPixmap( display(), bound_glxpixmap );
|
||||||
|
bound_glxpixmap = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SceneOpenGL::Texture::findTarget()
|
void SceneOpenGL::Texture::findTarget()
|
||||||
{
|
{
|
||||||
unsigned int new_target = 0;
|
unsigned int new_target = 0;
|
||||||
|
@ -1183,6 +1188,12 @@ void SceneOpenGL::Window::discardVertices()
|
||||||
currentYResolution = -1;
|
currentYResolution = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when the window's composite pixmap is discarded, undo binding it to the texture
|
||||||
|
void SceneOpenGL::Window::pixmapDiscarded()
|
||||||
|
{
|
||||||
|
texture.release();
|
||||||
|
}
|
||||||
|
|
||||||
// paint the window
|
// paint the window
|
||||||
void SceneOpenGL::Window::performPaint( int mask, QRegion region, WindowPaintData data )
|
void SceneOpenGL::Window::performPaint( int mask, QRegion region, WindowPaintData data )
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,6 +98,7 @@ class SceneOpenGL::Texture
|
||||||
virtual bool load( const QImage& image, GLenum target = GL_TEXTURE_2D );
|
virtual bool load( const QImage& image, GLenum target = GL_TEXTURE_2D );
|
||||||
virtual bool load( const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D );
|
virtual bool load( const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D );
|
||||||
virtual void discard();
|
virtual void discard();
|
||||||
|
virtual void release(); // undo the tfp_mode binding
|
||||||
virtual void bind();
|
virtual void bind();
|
||||||
virtual void unbind();
|
virtual void unbind();
|
||||||
|
|
||||||
|
@ -119,6 +120,7 @@ class SceneOpenGL::Window
|
||||||
virtual ~Window();
|
virtual ~Window();
|
||||||
virtual void performPaint( int mask, QRegion region, WindowPaintData data );
|
virtual void performPaint( int mask, QRegion region, WindowPaintData data );
|
||||||
virtual void prepareForPainting();
|
virtual void prepareForPainting();
|
||||||
|
virtual void pixmapDiscarded();
|
||||||
bool bindTexture();
|
bool bindTexture();
|
||||||
void discardTexture();
|
void discardTexture();
|
||||||
void discardVertices();
|
void discardVertices();
|
||||||
|
|
|
@ -287,6 +287,7 @@ void SceneXrender::windowClosed( Toplevel* c, Deleted* deleted )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete windows.take( c );
|
delete windows.take( c );
|
||||||
|
c->effectWindow()->setSceneWindow( NULL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,6 +295,7 @@ void SceneXrender::windowDeleted( Deleted* c )
|
||||||
{
|
{
|
||||||
assert( windows.contains( c ));
|
assert( windows.contains( c ));
|
||||||
delete windows.take( c );
|
delete windows.take( c );
|
||||||
|
c->effectWindow()->setSceneWindow( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneXrender::windowAdded( Toplevel* c )
|
void SceneXrender::windowAdded( Toplevel* c )
|
||||||
|
|
Loading…
Reference in New Issue