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

Commit 70522fe5 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Push existing pending state when deferring transaction" into pi-dev

parents 1572f9b6 dba3273a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -920,10 +920,7 @@ void Layer::pushPendingState() {
}

void Layer::popPendingState(State* stateToCommit) {
    auto oldFlags = stateToCommit->flags;
    *stateToCommit = mPendingStates[0];
    stateToCommit->flags =
            (oldFlags & ~stateToCommit->mask) | (stateToCommit->flags & stateToCommit->mask);

    mPendingStates.removeAt(0);
    ATRACE_INT(mTransactionName.string(), mPendingStates.size());
@@ -1270,7 +1267,6 @@ bool Layer::setFlags(uint8_t flags, uint8_t mask) {
    if (mCurrentState.flags == newFlags) return false;
    mCurrentState.sequence++;
    mCurrentState.flags = newFlags;
    mCurrentState.mask = mask;
    mCurrentState.modified = true;
    setTransactionFlags(eTransactionNeeded);
    return true;
+1 −2
Original line number Diff line number Diff line
@@ -186,7 +186,6 @@ public:
        uint32_t layerStack;

        uint8_t flags;
        uint8_t mask;
        uint8_t reserved[2];
        int32_t sequence; // changes when visible regions can change
        bool modified;
@@ -588,6 +587,7 @@ public:
    // SurfaceFlinger to complete a transaction.
    void commitChildList();
    int32_t getZ() const;
    void pushPendingState();

protected:
    // constant
@@ -670,7 +670,6 @@ protected:
    // Returns false if the relevant frame has already been latched
    bool addSyncPoint(const std::shared_ptr<SyncPoint>& point);

    void pushPendingState();
    void popPendingState(State* stateToCommit);
    bool applyPendingStates(State* stateToCommit);

+7 −0
Original line number Diff line number Diff line
@@ -3345,6 +3345,13 @@ uint32_t SurfaceFlinger::setClientStateLocked(const ComposerState& composerState
    const uint32_t what = s.what;
    bool geometryAppliesWithResize =
            what & layer_state_t::eGeometryAppliesWithResize;

    // If we are deferring transaction, make sure to push the pending state, as otherwise the
    // pending state will also be deferred.
    if (what & layer_state_t::eDeferTransaction) {
        layer->pushPendingState();
    }

    if (what & layer_state_t::ePositionChanged) {
        if (layer->setPosition(s.x, s.y, !geometryAppliesWithResize)) {
            flags |= eTraversalNeeded;