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

Commit 9f64cc89 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Remove redundant check for blurRegions to force client composition

If there are blurRegions on a Layer, we *should* force client
composition, but this is already handled in
Output::updateCompositionState +
Output::findLayerRequestingBackgroundComposition. The check on Layer is
redundant, so remove it.

Moreover, the check on Layer doesn't do enough. It doesn't handle blur-
behind, and it doesn't force the Layers below to use client composition,
which is also necessary.

This allows us to remove blurs and client composition from protected
surfaces on devices that do not have EGL_EXT_protected_content. (See
I9763eb22884e611568b36b2e221ee6d75ec3363e.)

Bug: 196271643
Test: OutputUpdateAndWriteCompositionStateTest
Change-Id: I055d221b1fcb36fb5fbc6747c353d3fb72f4d684
parent 4c1b3b73
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line 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::eApiChanged | layer_state_t::eShadowRadiusChanged |
                 layer_state_t::eBlurRegionsChanged | layer_state_t::eStretchChanged)) {
                 layer_state_t::eBlurRegionsChanged | layer_state_t::eStretchChanged)) {
        forceClientComposition = isHdrY410 || shadowSettings.length > 0 ||
        forceClientComposition = isHdrY410 || shadowSettings.length > 0 ||
                requested.blurRegions.size() > 0 || stretchEffect.hasEffect();
                stretchEffect.hasEffect();
    }
    }


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


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