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

Commit c8145170 authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Clear local sync points on hide and destroy

Clears out a Layer's local sync points when the layer is destroyed
and when it is hidden, so that any Layers waiting for frames to
appear on that Layer are not blocked when attempting to apply
transactions

Bug: 28399096
Change-Id: I380a83624f9d7ea5797f66daa711ae4b80475bdf
parent 32a6129e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -178,6 +178,9 @@ Layer::~Layer() {
    for (auto& point : mRemoteSyncPoints) {
        point->setTransactionApplied();
    }
    for (auto& point : mLocalSyncPoints) {
        point->setFrameAvailable();
    }
    mFlinger->deleteTextureAsync(mTextureName);
    mFrameTracker.logAndResetStats(mName);
}
@@ -1478,6 +1481,17 @@ uint32_t Layer::doTransaction(uint32_t flags) {
                (type >= Transform::SCALE));
    }

    // If the layer is hidden, signal and clear out all local sync points so
    // that transactions for layers depending on this layer's frames becoming
    // visible are not blocked
    if (c.flags & layer_state_t::eLayerHidden) {
        Mutex::Autolock lock(mLocalSyncPointMutex);
        for (auto& point : mLocalSyncPoints) {
            point->setFrameAvailable();
        }
        mLocalSyncPoints.clear();
    }

    // Commit the transaction
    commitTransaction(c);
    return flags;