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

Commit 98aad518 authored by Alec Mouri's avatar Alec Mouri
Browse files

One weird trick to cache single-layer blurs

Bug: 419072112
Flag: EXEMPT tiny change
Test: All app blur caches
Test: TransactionFlinger test app caches
Change-Id: I239598c6fcaadaa5d530a1c8ffa1b43836eeb439
parent c907bc6f
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -173,17 +173,18 @@ private:
                const bool requiresHolePunch =
                        mHolePunchCandidate && mHolePunchCandidate->requiresHolePunch();

                if (!requiresHolePunch) {
                    // If we don't require a hole punch, then treat solid color layers at the front
                    // to be "cheap", so remove them from the candidate cached set.
                if (!requiresHolePunch && mBlurringLayer == nullptr) {
                    // If we don't require a hole punch and we're not being blurred, then treat
                    // solid color layers at the front to be "cheap", so remove them from the
                    // candidate cached set.
                    while (mNumSets > 1 && mStart->getLayerCount() == 1 &&
                           mStart->getFirstLayer().getBuffer() == nullptr) {
                        mStart++;
                        mNumSets--;
                    }

                    // Only allow for single cached sets if a hole punch is required. If we're here,
                    // then we don't require a hole punch, so don't build a run.
                    // Only allow for single cached sets if a hole punch or blur is required.
                    // Neither is true if we're here.
                    if (mNumSets <= 1) {
                        return std::nullopt;
                    }