summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-09-22 20:57:04 -0700
committerMathias Agopian <mathias@google.com>2011-09-22 20:57:04 -0700
commit9fe96541c349f87caae10f3c94ed30e8153b15e5 (patch)
tree902114517145c1e8e605014b248aa6e76f3fc4c8 /services/surfaceflinger
parentc4f5d5a0dfb9adc3184eac75fc2c53a7df9e324a (diff)
downloadframeworks_base-9fe96541c349f87caae10f3c94ed30e8153b15e5.zip
frameworks_base-9fe96541c349f87caae10f3c94ed30e8153b15e5.tar.gz
frameworks_base-9fe96541c349f87caae10f3c94ed30e8153b15e5.tar.bz2
don't clear the framebuffer when the framebuffer is not used
when areas of the FB are undefined (transparent windows on top of nothing), we clear those areas before composition. however, it makes no sense to do this when the FB is not in use (case where hwc handles all layers) Bug: 5360529 Change-Id: If51bb669307e8419bbe1f3a89d1c88e0ec1f216c
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0ef03bb..2be6d18 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -986,19 +986,20 @@ void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
void SurfaceFlinger::composeSurfaces(const Region& dirty)
{
- if (UNLIKELY(!mWormholeRegion.isEmpty())) {
+ const DisplayHardware& hw(graphicPlane(0).displayHardware());
+ HWComposer& hwc(hw.getHwComposer());
+
+ const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
+ if (UNLIKELY(fbLayerCount && !mWormholeRegion.isEmpty())) {
// should never happen unless the window manager has a bug
// draw something...
drawWormhole();
}
- const DisplayHardware& hw(graphicPlane(0).displayHardware());
- HWComposer& hwc(hw.getHwComposer());
- hwc_layer_t* const cur(hwc.getLayers());
-
/*
* and then, render the layers targeted at the framebuffer
*/
+ hwc_layer_t* const cur(hwc.getLayers());
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
size_t count = layers.size();
for (size_t i=0 ; i<count ; i++) {