Cache window quads since they usually don't change and this gives
few fps. svn path=/trunk/KDE/kdebase/workspace/; revision=787978
This commit is contained in:
parent
113b9853b3
commit
1927a283b3
3 changed files with 25 additions and 5 deletions
|
@ -232,3 +232,11 @@ Effects TODO
|
|||
+ - there's a bug that causes overlapping windows be shown also on desktops painted sooner than the window's desktop
|
||||
- needs clipping (and that probably needs support for cumulating clipping)
|
||||
! - make desktop borders distinctive (i.e. paint a grid), to make it more visible that desktops are still separate
|
||||
|
||||
|
||||
Performance
|
||||
==================
|
||||
|
||||
+ various caching - there are many things that usually don't change and could gain few fps (is it worth it?)
|
||||
- Workspace::performCompositing()
|
||||
- WindowQuadList could perhaps cache quads split by contents/decoration (for select())
|
||||
|
|
15
scene.cpp
15
scene.cpp
|
@ -316,11 +316,13 @@ Scene::Window::Window( Toplevel * c )
|
|||
, filter( ImageFilterFast )
|
||||
, disable_painting( 0 )
|
||||
, shape_valid( false )
|
||||
, cached_quad_list( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
Scene::Window::~Window()
|
||||
{
|
||||
delete cached_quad_list;
|
||||
}
|
||||
|
||||
void Scene::Window::discardShape()
|
||||
|
@ -328,6 +330,8 @@ void Scene::Window::discardShape()
|
|||
// it is created on-demand and cached, simply
|
||||
// reset the flag
|
||||
shape_valid = false;
|
||||
delete cached_quad_list;
|
||||
cached_quad_list = NULL;
|
||||
}
|
||||
|
||||
// Find out the shape of the window using the XShape extension
|
||||
|
@ -415,12 +419,19 @@ void Scene::Window::disablePainting( int reason )
|
|||
|
||||
WindowQuadList Scene::Window::buildQuads() const
|
||||
{
|
||||
if( cached_quad_list != NULL )
|
||||
return *cached_quad_list;
|
||||
WindowQuadList ret;
|
||||
if( toplevel->clientPos() == QPoint( 0, 0 ) && toplevel->clientSize() == toplevel->size())
|
||||
return makeQuads( WindowQuadContents, shape()); // has no decoration
|
||||
ret = makeQuads( WindowQuadContents, shape()); // has no decoration
|
||||
else
|
||||
{
|
||||
QRegion contents = shape() & QRect( toplevel->clientPos(), toplevel->clientSize());
|
||||
QRegion decoration = shape() - contents;
|
||||
WindowQuadList ret = makeQuads( WindowQuadContents, contents );
|
||||
ret = makeQuads( WindowQuadContents, contents );
|
||||
ret += makeQuads( WindowQuadDecoration, decoration );
|
||||
}
|
||||
cached_quad_list = new WindowQuadList( ret );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
1
scene.h
1
scene.h
|
@ -190,6 +190,7 @@ class Scene::Window
|
|||
int disable_painting;
|
||||
mutable QRegion shape_region;
|
||||
mutable bool shape_valid;
|
||||
mutable WindowQuadList* cached_quad_list;
|
||||
Q_DISABLE_COPY(Window)
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue