Allocate client buffer & damage only for surfaces that belong to a renderable layer
authorRahul Singhal <rasinghal@nvidia.com>
Thu, 30 Jun 2011 11:55:17 +0000 (17:25 +0530)
committerMichael Schuldt <michael.schuldt@bmw-carit.de>
Mon, 4 Jul 2011 07:40:36 +0000 (09:40 +0200)
This is was the behaviour before XDamage implementation. So this
change reverts back to the old behaviour.

A renderable layer is one which is part of getCurrentRenderOrder().
Surfaces which don't belong to such a layer are not rendered
in the final compositing, hence we don't need to allocate/create
client buffer & damage for such surfaces. Instead this is delayed
till the surface is added to a renderable layer.

LayerManagerPlugins/Renderers/Graphic/src/WindowSystems/X11WindowSystem.cpp

index 025d0f6..0dc0330 100644 (file)
@@ -185,12 +185,15 @@ Surface* X11WindowSystem::getSurfaceForWindow(Window w)
 
 void X11WindowSystem::checkForNewSurface()
 {
-       const std::map<unsigned int,Surface*> surfaces = m_pScene->getAllSurfaces();
-       for(std::map<unsigned int, Surface*>::const_iterator currentS = surfaces.begin(); currentS != surfaces.end(); currentS++)
-       {
-               Surface* currentSurface = (*currentS).second;
-               allocatePlatformSurface(currentSurface);
-       }
+    LayerList layers = m_pScene->getCurrentRenderOrder();
+    for(LayerListConstIterator current = layers.begin(); current != layers.end(); current++)
+    {
+        SurfaceList surfaces = (*current)->getAllSurfaces();
+        for(SurfaceListConstIterator currentS = surfaces.begin(); currentS != surfaces.end(); currentS++)
+        {
+            allocatePlatformSurface(*currentS);
+        }
+    }
 }
 
 void X11WindowSystem::configureSurfaceWindow(Window window)