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

Commit c747ad01 authored by Robert Carr's avatar Robert Carr
Browse files

onPostComposition doesnt need to run on layers without queued frames

If we didn't latch a buffer with this frame, we will just return
early from onPostComposition and so we can safe traversal overhead
by just iterating mLayersWithQueuedFrames directly.

Test: Existing tests pass. simpleperf
Bug: 186200583
Change-Id: I8f72100f15d2b381e2480ee4c40f6ba79030e092
parent 13a864c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2246,14 +2246,14 @@ void SurfaceFlinger::postComposition() {
        compositorTiming = getBE().mCompositorTiming;
    }

    mDrawingState.traverse([&](Layer* layer) {
    for (const auto& layer: mLayersWithQueuedFrames) {
        const bool frameLatched =
                layer->onPostComposition(display, glCompositionDoneFenceTime,
                                         mPreviousPresentFences[0].fenceTime, compositorTiming);
        if (frameLatched) {
            recordBufferingStats(layer->getName(), layer->getOccupancyHistory(false));
        }
    });
    }

    std::vector<std::pair<std::shared_ptr<compositionengine::Display>, sp<HdrLayerInfoReporter>>>
            hdrInfoListeners;