From 5bf786d8f00ff8eee64ebf330dac55e33a0f97b1 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Tue, 30 Sep 2014 10:35:11 -0700 Subject: [PATCH] surfaceflinger: recompute visibility after sideband stream change We normally recompute layer visibility when a layer gets its first buffer; before then it's treated as invisible. Sideband layers never get a buffer (as far as SurfaceFlinger knows), so never became visible. Now we also recompute visibility when a layer gets a new sideband stream. Bug: 17752511 Change-Id: I84e150f196eb2eb7bcd2616248e5e3fa73624809 --- services/surfaceflinger/Layer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index a36ddd958..fa07656e2 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1042,6 +1042,10 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) if (android_atomic_acquire_cas(true, false, &mSidebandStreamChanged) == 0) { // mSidebandStreamChanged was true mSidebandStream = mSurfaceFlingerConsumer->getSidebandStream(); + recomputeVisibleRegions = true; + + const State& s(getDrawingState()); + return s.transform.transform(Region(Rect(s.active.w, s.active.h))); } Region outDirtyRegion;