Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6fa90b15 authored by Robert Carr's avatar Robert Carr Committed by android-build-merger
Browse files

Merge "SurfaceFlinger: Fix destruction of relatively Z-ordered layers." into oc-dev

am: edcc0c28

Change-Id: I78b9c353b201b43888d469a6aa8919b2e1809f5c
parents 5c8e63db edcc0c28
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -287,6 +287,14 @@ void Layer::onSidebandStreamChanged() {
// the layer has been remove from the current state list (and just before
// it's removed from the drawing state list)
void Layer::onRemoved() {
    if (mCurrentState.zOrderRelativeOf != nullptr) {
        sp<Layer> strongRelative = mCurrentState.zOrderRelativeOf.promote();
        if (strongRelative != nullptr) {
            strongRelative->removeZOrderRelative(this);
        }
        mCurrentState.zOrderRelativeOf = nullptr;
    }

    mSurfaceFlingerConsumer->abandon();
    for (const auto& child : mCurrentChildren) {
        child->onRemoved();
@@ -2555,11 +2563,6 @@ LayerVector Layer::makeTraversalList() {
        sp<Layer> strongRelative = weakRelative.promote();
        if (strongRelative != nullptr) {
            traverse.add(strongRelative);
        } else {
            // We need to erase from current state instead of drawing
            // state so we don't overwrite when copying
            // the current state to the drawing state.
            mCurrentState.zOrderRelatives.remove(weakRelative);
        }
    }