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
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 9466944..4fc9c6a 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -89,7 +89,7 @@
mIsSecure(isSecure),
mSecureLayerVisible(false),
mScreenAcquired(false),
- mLayerStack(0),
+ mLayerStack(NO_LAYER_STACK),
mOrientation()
{
init(config);
@@ -196,13 +196,13 @@
EGLDisplay dpy = mDisplay;
EGLSurface surface = mSurface;
-#ifdef EGL_ANDROID_swap_rectangle
+#ifdef EGL_ANDROID_swap_rectangle
if (mFlags & SWAP_RECTANGLE) {
const Region newDirty(dirty.intersect(bounds()));
const Rect b(newDirty.getBounds());
eglSetSwapRectangleANDROID(dpy, surface,
b.left, b.top, b.width(), b.height());
- }
+ }
#endif
mPageFlipCount++;