summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-08-28 14:20:00 -0700
committerMathias Agopian <mathias@google.com>2012-08-28 14:20:00 -0700
commit7e7ed7f77a3963a3542bde529d2797a239e2798b (patch)
treed03b949be503c02cbfd562fe492f0602cdaa96c4
parent55801e41e6d7306d75d8134dd69d7d8cbbfbc63c (diff)
downloadframeworks_native-7e7ed7f77a3963a3542bde529d2797a239e2798b.zip
frameworks_native-7e7ed7f77a3963a3542bde529d2797a239e2798b.tar.gz
frameworks_native-7e7ed7f77a3963a3542bde529d2797a239e2798b.tar.bz2
the layer list per display could contain non-visible layers
this happened because we didn't check that the visible region was within the bounds of the display. Bug: 7064121 Change-Id: I2e81850a3dc3d1474253520ad7f9e559c26d5a96
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index da3e932..1162432 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -757,26 +757,31 @@ void SurfaceFlinger::rebuildLayerStacks() {
const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
const sp<DisplayDevice>& hw(mDisplays[dpy]);
+ const Transform& tr(hw->getTransform());
+ const Rect bounds(hw->getBounds());
+
Region opaqueRegion;
Region dirtyRegion;
computeVisibleRegions(currentLayers,
hw->getLayerStack(), dirtyRegion, opaqueRegion);
- hw->dirtyRegion.orSelf(dirtyRegion);
Vector< sp<LayerBase> > layersSortedByZ;
const size_t count = currentLayers.size();
for (size_t i=0 ; i<count ; i++) {
- const Layer::State& s(currentLayers[i]->drawingState());
+ const sp<LayerBase>& layer(currentLayers[i]);
+ const Layer::State& s(layer->drawingState());
if (s.layerStack == hw->getLayerStack()) {
- if (!currentLayers[i]->visibleRegion.isEmpty()) {
- layersSortedByZ.add(currentLayers[i]);
+ Region visibleRegion(tr.transform(layer->visibleRegion));
+ visibleRegion.andSelf(bounds);
+ if (!visibleRegion.isEmpty()) {
+ layersSortedByZ.add(layer);
}
}
}
hw->setVisibleLayersSortedByZ(layersSortedByZ);
- hw->undefinedRegion.set(hw->getBounds());
- hw->undefinedRegion.subtractSelf(
- hw->getTransform().transform(opaqueRegion));
+ hw->undefinedRegion.set(bounds);
+ hw->undefinedRegion.subtractSelf(tr.transform(opaqueRegion));
+ hw->dirtyRegion.orSelf(dirtyRegion);
}
}
}