Skip to content

Commit 81f69ba

Browse files
committed
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: I761a7d3664228ebbee0944aca8b0cc278fc94c9c
1 parent 892ac41 commit 81f69ba

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -986,19 +986,20 @@ void SurfaceFlinger::setupHardwareComposer(Region& dirtyInOut)
986986

987987
void SurfaceFlinger::composeSurfaces(const Region& dirty)
988988
{
989-
if (UNLIKELY(!mWormholeRegion.isEmpty())) {
989+
const DisplayHardware& hw(graphicPlane(0).displayHardware());
990+
HWComposer& hwc(hw.getHwComposer());
991+
992+
const size_t fbLayerCount = hwc.getLayerCount(HWC_FRAMEBUFFER);
993+
if (UNLIKELY(fbLayerCount && !mWormholeRegion.isEmpty())) {
990994
// should never happen unless the window manager has a bug
991995
// draw something...
992996
drawWormhole();
993997
}
994998

995-
const DisplayHardware& hw(graphicPlane(0).displayHardware());
996-
HWComposer& hwc(hw.getHwComposer());
997-
hwc_layer_t* const cur(hwc.getLayers());
998-
999999
/*
10001000
* and then, render the layers targeted at the framebuffer
10011001
*/
1002+
hwc_layer_t* const cur(hwc.getLayers());
10021003
const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
10031004
size_t count = layers.size();
10041005
for (size_t i=0 ; i<count ; i++) {

0 commit comments

Comments
 (0)