Skip to content

Commit a2a3f1e

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "don't clear the framebuffer when the framebuffer is not used" into ics-factoryrom
2 parents a7969d9 + 81f69ba commit a2a3f1e

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)