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

Commit 2d3f8b8b authored by Tim Murray's avatar Tim Murray
Browse files

avoid unnecessary allocation in SurfaceFlinger

Test: boots, works

Change-Id: I6371addc18dfa2aa4826432c58058cd897a190c5
parent 19de7665
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -579,12 +579,13 @@ sp<Fence> HWComposer::getPresentFence(DisplayId displayId) const {

sp<Fence> HWComposer::getLayerReleaseFence(DisplayId displayId, HWC2::Layer* layer) const {
    RETURN_IF_INVALID_DISPLAY(displayId, Fence::NO_FENCE);
    auto displayFences = mDisplayData.at(displayId).releaseFences;
    if (displayFences.count(layer) == 0) {
    const auto& displayFences = mDisplayData.at(displayId).releaseFences;
    auto fence = displayFences.find(layer);
    if (fence == displayFences.end()) {
        ALOGV("getLayerReleaseFence: Release fence not found");
        return Fence::NO_FENCE;
    }
    return displayFences[layer];
    return fence->second;
}

status_t HWComposer::presentAndGetReleaseFences(DisplayId displayId) {