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

Commit 5e9a43e0 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: remove hwcId < 0 path in doComposeSurfaces

Remove the check for hwcId and re-indent the code.  hwcId is never
less than zero.  Even if it did,
getCompositionType(DISPLAY_ID_INVALID) would return
HWC2::Composition::Client and it would still work.

The motivation is that the hwcId < 0 path has gone outdated since
the introduction of legacy sRGB saturation matrix.

Bug: 78891890
Test: virtual displays
Change-Id: I6f3e779bc0f8ef21d33ce7de49ddbfa95757e473
parent 1148147c
Loading
Loading
Loading
Loading
+42 −54
Original line number Diff line number Diff line
@@ -2958,8 +2958,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& displayDev

    ALOGV("Rendering client layers");
    const Transform& displayTransform = displayDevice->getTransform();
    if (hwcId >= 0) {
        // we're using h/w composer
    bool firstLayer = true;
    for (auto& layer : displayDevice->getVisibleLayersSortedByZ()) {
        const Region clip(bounds.intersect(
@@ -3008,16 +3006,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& displayDev
        }
        firstLayer = false;
    }
    } else {
        // we're not using h/w composer
        for (auto& layer : displayDevice->getVisibleLayersSortedByZ()) {
            const Region clip(bounds.intersect(
                    displayTransform.transform(layer->visibleRegion)));
            if (!clip.isEmpty()) {
                layer->draw(renderArea, clip);
            }
        }
    }

    if (applyColorMatrix) {
        getRenderEngine().setupColorTransform(oldColorMatrix);