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

Commit 223eb91c authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Refactor Surfaceflinger Layer::latchBuffer

Reduces indentation of 300 lines via an early return if no work
is detected.

Change-Id: I08fe2a3e2808ae58e3da28a1c2f7d28e7a4a98af
parent eeefbe07
Loading
Loading
Loading
Loading
+273 −271
Original line number Diff line number Diff line
@@ -1803,7 +1803,9 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)
    }

    Region outDirtyRegion;
    if (mQueuedFrames > 0 || mAutoRefresh) {
    if (mQueuedFrames <= 0 && !mAutoRefresh) {
        return outDirtyRegion;
    }

    // if we've already called updateTexImage() without going through
    // a composition step, we have to skip this layer at this point
@@ -2130,7 +2132,7 @@ Region Layer::latchBuffer(bool& recomputeVisibleRegions)

    // transform the dirty region to window-manager space
    outDirtyRegion = (s.active.transform.transform(dirtyRegion));
    }

    return outDirtyRegion;
}