summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-09-12 15:34:57 -0700
committerMathias Agopian <mathias@google.com>2012-09-12 17:42:06 -0700
commitce3a0a541c3dde1330551bd7a048cd9d92335c00 (patch)
tree0087666b68164bb524da6fdde9d35837970d22d5 /services
parent2c7c8ba56ad9c0c08fde6f86771475f03a03e6fd (diff)
downloadframeworks_native-ce3a0a541c3dde1330551bd7a048cd9d92335c00.zip
frameworks_native-ce3a0a541c3dde1330551bd7a048cd9d92335c00.tar.gz
frameworks_native-ce3a0a541c3dde1330551bd7a048cd9d92335c00.tar.bz2
don't call hwc with non-empty layer lists for blanked displays
we now make sure to take the blanked state of a display into account when we build its list of visible layers, this ensures that we won't call prepare/set with a non-empty list when the display is blanked. Possibly fixes 7075380, 7103553, 7130187, 7016215 Bug: 7075380 Change-Id: I9fdd2e73d1b7621eaeca3d4ac2ae60d9fb1b3631
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp33
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h4
2 files changed, 20 insertions, 17 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 058ba45..6542acd 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -753,27 +753,29 @@ void SurfaceFlinger::rebuildLayerStacks() {
ATRACE_CALL();
mVisibleRegionsDirty = false;
invalidateHwcGeometry();
+
const LayerVector& currentLayers(mDrawingState.layersSortedByZ);
for (size_t dpy=0 ; dpy<mDisplays.size() ; dpy++) {
+ Region opaqueRegion;
+ Region dirtyRegion;
+ Vector< sp<LayerBase> > layersSortedByZ;
const sp<DisplayDevice>& hw(mDisplays[dpy]);
const Transform& tr(hw->getTransform());
const Rect bounds(hw->getBounds());
+ if (hw->canDraw()) {
+ SurfaceFlinger::computeVisibleRegions(currentLayers,
+ hw->getLayerStack(), dirtyRegion, opaqueRegion);
- Region opaqueRegion;
- Region dirtyRegion;
- computeVisibleRegions(currentLayers,
- hw->getLayerStack(), dirtyRegion, opaqueRegion);
-
- Vector< sp<LayerBase> > layersSortedByZ;
- const size_t count = currentLayers.size();
- for (size_t i=0 ; i<count ; i++) {
- const sp<LayerBase>& layer(currentLayers[i]);
- const Layer::State& s(layer->drawingState());
- if (s.layerStack == hw->getLayerStack()) {
- Region visibleRegion(tr.transform(layer->visibleRegion));
- visibleRegion.andSelf(bounds);
- if (!visibleRegion.isEmpty()) {
- layersSortedByZ.add(layer);
+ const size_t count = currentLayers.size();
+ for (size_t i=0 ; i<count ; i++) {
+ const sp<LayerBase>& layer(currentLayers[i]);
+ const Layer::State& s(layer->drawingState());
+ if (s.layerStack == hw->getLayerStack()) {
+ Region visibleRegion(tr.transform(layer->visibleRegion));
+ visibleRegion.andSelf(bounds);
+ if (!visibleRegion.isEmpty()) {
+ layersSortedByZ.add(layer);
+ }
}
}
}
@@ -1776,6 +1778,7 @@ void SurfaceFlinger::onScreenReleased() {
mEventThread->onScreenReleased();
hw->releaseScreen();
getHwComposer().release();
+ mVisibleRegionsDirty = true;
// from this point on, SF will stop drawing
}
}
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index ea03e2d..ffe68c6 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -351,8 +351,8 @@ private:
* Compositing
*/
void invalidateHwcGeometry();
- void computeVisibleRegions(const LayerVector& currentLayers,
- uint32_t layerStack,
+ static void computeVisibleRegions(
+ const LayerVector& currentLayers, uint32_t layerStack,
Region& dirtyRegion, Region& opaqueRegion);
void preComposition();