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

Commit 1e7e0abe authored by Tim Murray's avatar Tim Murray Committed by Android (Google) Code Review
Browse files

Merge "avoid unnecessary allocation in SurfaceFlinger"

parents 5e4d5b1f 2d3f8b8b
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -578,12 +578,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) {