From 01e29054e672301e4adbbca15b3562a59a20f267 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Tue, 19 Feb 2013 16:13:35 -0800 Subject: Init displays to null layer stack When a display is added, initialize it to use an empty layer stack, so if it is somehow visible it will show black. It will be assigned the real layer stack -- along with a projection and other properties -- by window manager soon. Normally a display remains blanked until window manager has decided what to show on it, but for HDMI connected at boot that isn't currently the case. Bug: 7258935 Change-Id: Ic9bb25f7a9b8d9d3772b097ab1d6fa03bc8780a1 --- services/surfaceflinger/SurfaceFlinger.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ee3e93b1a4..c8d2eb653d 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1347,7 +1347,7 @@ void SurfaceFlinger::computeVisibleRegions( // start with the whole surface at its current location const Layer::State& s(layer->drawingState()); - // only consider the layers on the given later stack + // only consider the layers on the given layer stack if (s.layerStack != layerStack) continue; @@ -2072,12 +2072,14 @@ status_t SurfaceFlinger::onLayerDestroyed(const wp& layer) // --------------------------------------------------------------------------- void SurfaceFlinger::onInitializeDisplays() { - // reset screen orientation + // reset screen orientation and use primary layer stack Vector state; Vector displays; DisplayState d; - d.what = DisplayState::eDisplayProjectionChanged; + d.what = DisplayState::eDisplayProjectionChanged | + DisplayState::eLayerStackChanged; d.token = mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY]; + d.layerStack = 0; d.orientation = DisplayState::eOrientationDefault; d.frame.makeInvalid(); d.viewport.makeInvalid(); @@ -2901,7 +2903,7 @@ SurfaceFlinger::DisplayDeviceState::DisplayDeviceState() } SurfaceFlinger::DisplayDeviceState::DisplayDeviceState(DisplayDevice::DisplayType type) - : type(type), layerStack(0), orientation(0) { + : type(type), layerStack(DisplayDevice::NO_LAYER_STACK), orientation(0) { viewport.makeInvalid(); frame.makeInvalid(); } -- cgit v1.2.3-59-g8ed1b