From 6c67f0fe457f758fc875e1178d8fd5258fd8f6df Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 12 Apr 2013 16:58:11 -0700 Subject: make sure to update the "current state" when we "fake" the transaction this mimics the code we used for the size. basically we need to also update the "current state" because it gets copied to the "drawing state" when a transaction occurs, and it would "undo" our change. Bug: 8511430 Bug: 8581533 Change-Id: I08c02abbf21b7f168f7124cd14ee717d7d3d502c --- services/surfaceflinger/Layer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'services/surfaceflinger') diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 2302367..4779804 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1067,6 +1067,16 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions) if (!front.activeTransparentRegion.isTriviallyEqual( front.requestedTransparentRegion)) { front.activeTransparentRegion = front.requestedTransparentRegion; + + // We also need to update the current state so that + // we don't end-up overwriting the drawing state with + // this stale current state during the next transaction + // + // NOTE: We don't need to hold the transaction lock here + // because State::active is only accessed from this thread. + current.activeTransparentRegion = front.activeTransparentRegion; + + // recompute visible region recomputeVisibleRegions = true; } -- cgit v1.1