Don't cache window pixmap, it's used only after it

changes.


svn path=/branches/work/kwin_composite/; revision=593453
This commit is contained in:
Luboš Luňák 2006-10-07 21:20:23 +00:00
parent 4d7a859bf3
commit b168c35384
9 changed files with 19 additions and 15 deletions

View file

@ -274,8 +274,8 @@ EffectsHandler::EffectsHandler( Workspace* ws )
{
if( !compositing())
return;
mht = new MakeHalfTransparent;
sm = new ShakyMove;
// mht = new MakeHalfTransparent;
// sm = new ShakyMove;
// gm = new GrowMove;
// swu = new ShiftWorkspaceUp( ws );
}

View file

@ -1653,7 +1653,6 @@ void Unmanaged::unmapNotifyEvent( XUnmapEvent* )
void Unmanaged::configureNotifyEvent( XConfigureEvent* e )
{
resetWindowPixmap();
// TODO add damage only if the window is not obscured
workspace()->addDamage( geometry());
geom = QRect( e->x, e->y, e->width, e->height );

View file

@ -1686,7 +1686,6 @@ void Client::setGeometry( int x, int y, int w, int h, ForceGeometry_t force )
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
resetWindowPixmap();
addDamage( rect());
}
@ -1743,7 +1742,6 @@ void Client::plainResize( int w, int h, ForceGeometry_t force )
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
resetWindowPixmap();
// TODO add damage only in added area?
addDamage( rect());
}

View file

@ -44,8 +44,10 @@ void SceneBasic::paint( QRegion, ToplevelList windows )
QRect r = (*it)->geometry().intersect( QRect( 0, 0, displayWidth(), displayHeight()));
if( !r.isEmpty())
{
XCopyArea( display(), (*it)->windowPixmap(), composite_pixmap, gc,
Pixmap pix = (*it)->createWindowPixmap();
XCopyArea( display(), pix, composite_pixmap, gc,
qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
XFreePixmap( display(), pix );
}
}
XCopyArea( display(), composite_pixmap, rootWindow(), gc, 0, 0, displayWidth(), displayHeight(), 0, 0 );

View file

@ -226,7 +226,8 @@ void SceneOpenGL::Window::bindTexture()
glBindTexture( GL_TEXTURE_RECTANGLE_ARB, texture );
return;
}
Pixmap pix = toplevel->windowPixmap();
Pixmap window_pix = toplevel->createWindowPixmap();
Pixmap pix = window_pix;
// HACK
// When a window uses ARGB visual and has a decoration, the decoration
// does use ARGB visual. When converting such window to a texture
@ -304,7 +305,7 @@ void SceneOpenGL::Window::bindTexture()
// only when the window changes anyway, so no need to cache
// the pixmap
glXDestroyPixmap( display(), pixmap );
toplevel->resetWindowPixmap();
XFreePixmap( display(), window_pix );
#ifdef ALPHA_CLEAR_COPY
if( alpha_clear )
XFreePixmap( display(), pix );

View file

@ -295,8 +295,17 @@ bool SceneXrender::WindowData::simpleTransformation() const
Picture SceneXrender::WindowData::picture()
{
if( !window->damage().isEmpty() && _picture != None )
{
XRenderFreePicture( display(), _picture );
_picture = None;
}
if( _picture == None && format != NULL )
_picture = XRenderCreatePicture( display(), window->windowPixmap(), format, 0, 0 );
{
Pixmap pix = window->createWindowPixmap();
_picture = XRenderCreatePicture( display(), pix, format, 0, 0 );
XFreePixmap( display(), pix ); // the picture owns the pixmap
}
return _picture;
}

View file

@ -18,7 +18,6 @@ Toplevel::Toplevel( Workspace* ws )
, id( None )
, wspace( ws )
, damage_handle( None )
, window_pixmap( None )
, is_shape( false )
{
}
@ -26,7 +25,6 @@ Toplevel::Toplevel( Workspace* ws )
Toplevel::~Toplevel()
{
assert( damage_handle == None );
assert( window_pixmap == None );
}
#ifndef NDEBUG

View file

@ -53,8 +53,7 @@ class Toplevel
bool isSplash() const;
bool isUtility() const;
Pixmap windowPixmap() const;
void resetWindowPixmap();
Pixmap createWindowPixmap() const;
Visual* visual() const;
bool shape() const;
virtual double opacity() const = 0;
@ -79,7 +78,6 @@ class Toplevel
Workspace* wspace;
Damage damage_handle;
QRegion damage_region;
mutable Pixmap window_pixmap;
bool is_shape;
};

View file

@ -54,7 +54,6 @@ bool Unmanaged::track( Window w )
XShapeSelectInput( display(), w, ShapeNotifyMask );
detectShape( w );
setupCompositing();
resetWindowPixmap();
return true;
}