BLAST: Handle detached layers.
detachChildren and mLayerDetached were implemented to avoid geometry updates
to layers in the cases of animation. For BufferQueue layers buffers are still
consumed as normal. This is useful as otherwise the client could get hung
inevitably waiting on a buffer to return. We recreate this semantic for BufferState
even though it is a little in-consistent. detachChildren is shortly slated for removal
by the hierarchy mirroring work so we don't need to worry about it too much.
Bug: 135786080
Test: Manual
Change-Id: I86c78fecc921218582918dda1ee7d8ee6c48f922
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 079bc66..2efa23e 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -780,6 +780,15 @@
ATRACE_CALL();
if (mLayerDetached) {
+ // Ensure BLAST buffer callbacks are processed.
+ // detachChildren and mLayerDetached were implemented to avoid geometry updates
+ // to layers in the cases of animation. For BufferQueue layers buffers are still
+ // consumed as normal. This is useful as otherwise the client could get hung
+ // inevitably waiting on a buffer to return. We recreate this semantic for BufferQueue
+ // even though it is a little consistent. detachChildren is shortly slated for removal
+ // by the hierarchy mirroring work so we don't need to worry about it too much.
+ mDrawingState.callbackHandles = mCurrentState.callbackHandles;
+ mCurrentState.callbackHandles = {};
return flags;
}