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

Commit 457e69f0 authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge changes I9763eb22,I055d221b into main

* changes:
  Avoid blurring and rounded corners without EGL_EXT_protected_content
  Remove redundant check for blurRegions to force client composition
parents 30054976 c1dbfcb3
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;
        }
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ void LayerSnapshot::merge(const RequestedLayerState& requested, bool forceUpdate
                 layer_state_t::eApiChanged | layer_state_t::eShadowRadiusChanged |
                 layer_state_t::eBlurRegionsChanged | layer_state_t::eStretchChanged)) {
        forceClientComposition = isHdrY410 || shadowSettings.length > 0 ||
                requested.blurRegions.size() > 0 || stretchEffect.hasEffect();
                stretchEffect.hasEffect();
    }

    if (forceUpdate ||
+1 −1
Original line number Diff line number Diff line
@@ -871,7 +871,7 @@ void LayerSnapshotBuilder::updateSnapshot(LayerSnapshot& snapshot, const Args& a

    // computed snapshot properties
    snapshot.forceClientComposition = snapshot.isHdrY410 || snapshot.shadowSettings.length > 0 ||
            requested.blurRegions.size() > 0 || snapshot.stretchEffect.hasEffect();
            snapshot.stretchEffect.hasEffect();
    snapshot.contentOpaque = snapshot.isContentOpaque();
    snapshot.isOpaque = snapshot.contentOpaque && !snapshot.roundedCorner.hasRoundedCorners() &&
            snapshot.color.a == 1.f;
+8 −2
Original line number Diff line number Diff line
@@ -659,8 +659,7 @@ void Layer::preparePerFrameCompositionState() {
    // Force client composition for special cases known only to the front-end.
    // Rounded corners no longer force client composition, since we may use a
    // hole punch so that the layer will appear to have rounded corners.
    if (isHdrY410() || drawShadows() || drawingState.blurRegions.size() > 0 ||
        snapshot->stretchEffect.hasEffect()) {
    if (isHdrY410() || drawShadows() || snapshot->stretchEffect.hasEffect()) {
        snapshot->forceClientComposition = true;
    }
    // If there are no visible region changes, we still need to update blur parameters.
@@ -2111,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();