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

Commit c1dbfcb3 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Avoid blurring and rounded corners without EGL_EXT_protected_content

If the GPU does not support protected content, avoid forcing client
composition for protected layers. This means removing rounded corners.
It also means avoiding blurring when it would require blurring a layer
with protected content.

Bug: 196271643
Test: manual (Netflix, YouTube, ExoDefault) with modified
      RenderEngine::supportsProtectedContent()
Change-Id: I9763eb22884e611568b36b2e221ee6d75ec3363e
parent 9f64cc89
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -895,13 +895,19 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
    compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
    for (auto* layer : getOutputLayersOrderedByZ()) {
        auto* compState = layer->getLayerFE().getCompositionState();
        const auto* compState = layer->getLayerFE().getCompositionState();

        // If any layer has a sideband stream, we will disable blurs. In that case, we don't
        // want to force client composition because of the blur.
        if (compState->sidebandStream != nullptr) {
            return nullptr;
        }

        // If RenderEngine cannot render protected content, we cannot blur.
        if (compState->hasProtectedContent &&
            !getCompositionEngine().getRenderEngine().supportsProtectedContent()) {
            return nullptr;
        }
        if (compState->isOpaque) {
            continue;
        }
+7 −0
Original line number Diff line number Diff line
@@ -2110,6 +2110,13 @@ const std::vector<BlurRegion> Layer::getBlurRegions() const {
}

RoundedCornerState Layer::getRoundedCornerState() const {
    // Today's DPUs cannot do rounded corners. If RenderEngine cannot render
    // protected content, remove rounded corners from protected content so it
    // can be rendered by the DPU.
    if (isProtected() && !mFlinger->getRenderEngine().supportsProtectedContent()) {
        return {};
    }

    // Get parent settings
    RoundedCornerState parentSettings;
    const auto& parent = mDrawingParent.promote();