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

Commit 464a526f authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "BLAST: Handle detached layers."

parents 8f2b750d 321e83c9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -125,9 +125,10 @@ bool BufferStateLayer::shouldPresentNow(nsecs_t /*expectedPresentTime*/) const {

bool BufferStateLayer::willPresentCurrentTransaction() const {
    // Returns true if the most recent Transaction applied to CurrentState will be presented.
    return getSidebandStreamChanged() || getAutoRefresh() ||
    return (getSidebandStreamChanged() || getAutoRefresh() ||
            (mCurrentState.modified &&
             (mCurrentState.buffer != nullptr || mCurrentState.bgColorLayer != nullptr));
             (mCurrentState.buffer != nullptr || mCurrentState.bgColorLayer != nullptr))) &&
        !mLayerDetached;
}

void BufferStateLayer::pushPendingState() {
+9 −0
Original line number Diff line number Diff line
@@ -780,6 +780,15 @@ uint32_t Layer::doTransaction(uint32_t flags) {
    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;
    }