summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schuldt <michael.schuldt@bmw.de>2013-07-05 12:37:38 +0200
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>2013-07-05 12:41:45 +0200
commitdf155269475853e61fd41c86119a6fa15f56524e (patch)
tree357151da5b75b1ce2b3e2ef44687a7ce853aa4b9
parentc75a9ca2da0de56e4532523750b1fc765904c9ff (diff)
downloadlayer_management-df155269475853e61fd41c86119a6fa15f56524e.tar.gz
GLESGraphicSystem: added handling of synchronized surfaces
Signed-off-by: Michael Schuldt <michael.schuldt@bmw.de>
-rw-r--r--LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
index 83fc460..936ee67 100644
--- a/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
+++ b/LayerManagerPlugins/Renderers/Graphic/src/GraphicSystems/GLESGraphicSystem.cpp
@@ -325,6 +325,42 @@ bool GLESGraphicsystem::needsRedraw(Layer *layer)
bool GLESGraphicsystem::needsRedraw(LayerList layers)
{
// TODO: Ignore damage from completely obscured surfaces
+ for (LayerListConstIterator layer = layers.begin(); layer != layers.end(); layer++)
+ {
+ if ((*layer)->getLayerType() == Hardware && layers.size() > 1)
+ {
+ // Damage in a hardware layer should not imply a redraw in other layers
+ LOG_WARNING("GLESGraphicsystem", "needsRedraw() called with layers not in the same composition");
+ }
+ // Only check synchronized surfaces if the layer is visible
+ if ((*layer)->visibility)
+ {
+ SurfaceList synchronizedSurfaces;
+ SurfaceList surfaces = (*layer)->getAllSurfaces();
+
+ // LOG_DEBUG("GLESGraphicsystem", "Checking surfaces");
+ // Check if we got a synchronized surfaces, only if all synchronized surfaces are damaged, trigger a redraw
+ for ( SurfaceListConstIterator surface = surfaces.begin(); surface != surfaces.end(); surface++ )
+ {
+ //LOG_DEBUG("GLESGraphicsystem", "Checking Surface for sychronization " << (*surface)->getID() );
+ if ( ( (*surface)->synchronized || (*surface)->m_resizesync ) && (*surface)->visibility)
+ {
+ synchronizedSurfaces.push_back((*surface));
+ }
+ }
+ // LOG_DEBUG("GLESGraphicsystem", "Checking synchronizedSurfaces");
+ for ( SurfaceListConstIterator syncSurface = synchronizedSurfaces.begin(); syncSurface != synchronizedSurfaces.end(); syncSurface++ )
+ {
+ if ( !(*syncSurface)->damaged )
+ {
+ LOG_INFO("GLESGraphicsystem","synchronized surface " << (*syncSurface)->getID() << " not damaged, skipping");
+ return false;
+ } else {
+ LOG_INFO("GLESGraphicsystem","synchronized surface " << (*syncSurface)->getID() << " damaged, trigger composition");
+ }
+ }
+ }
+ }
for (LayerListConstIterator layer = layers.begin(); layer != layers.end(); layer++)
{