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

Commit 7a60afbe authored by Ady Abraham's avatar Ady Abraham
Browse files

SF: black out layers that doesn't have gpu accessible buffer

If a layer provided a non gpu readable buffer, and that layer needs
to be composited using the gpu, backout the layer instead of asserting
in RenderEngine.

Fixes: 183950013
Test: launch the apk attached to the bug and force client composition
Change-Id: I068d72acf58866150284b3770b7c33da5a3bd3ac
parent 4fd10d8d
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -185,10 +185,14 @@ std::optional<compositionengine::LayerFE::LayerSettings> BufferLayer::prepareCli
            return std::nullopt;
            return std::nullopt;
        }
        }
    }
    }
    bool blackOutLayer = (isProtected() && !targetSettings.supportsProtectedContent) ||
    const bool blackOutLayer = (isProtected() && !targetSettings.supportsProtectedContent) ||
            (isSecure() && !targetSettings.isSecure);
            (isSecure() && !targetSettings.isSecure);
    const bool bufferCanBeUsedAsHwTexture =
            mBufferInfo.mBuffer->getUsage() & GraphicBuffer::USAGE_HW_TEXTURE;
    compositionengine::LayerFE::LayerSettings& layer = *result;
    compositionengine::LayerFE::LayerSettings& layer = *result;
    if (blackOutLayer) {
    if (blackOutLayer || !bufferCanBeUsedAsHwTexture) {
        ALOGE_IF(!bufferCanBeUsedAsHwTexture, "%s is blacked out as buffer is not gpu readable",
                 mName.c_str());
        prepareClearClientComposition(layer, true /* blackout */);
        prepareClearClientComposition(layer, true /* blackout */);
        return layer;
        return layer;
    }
    }