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

Commit 29810f75 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

SF: Replace container layers with effect layers

Groundwork before we can collapse all layer types into
a single layer.

Bug: 238781169
Test: presubmit
Test: go/wm-smoke

Change-Id: If53c5fdb266551a6ff30c09dd054e61f4cc488aa
parent 0c5ba684
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ std::vector<compositionengine::LayerFE::LayerSettings> EffectLayer::prepareClien
}

bool EffectLayer::isVisible() const {
    return !isHiddenByPolicy() && (getAlpha() > 0.0_hf || hasBlur()) && hasSomethingToDraw();
    return hasSomethingToDraw() && !isHiddenByPolicy() && (getAlpha() > 0.0_hf || hasBlur());
}

bool EffectLayer::setColor(const half3& color) {
+4 −1
Original line number Diff line number Diff line
@@ -1945,8 +1945,11 @@ half4 Layer::getColor() const {
}

int32_t Layer::getBackgroundBlurRadius() const {
    const auto& p = mDrawingParent.promote();
    if (getDrawingState().backgroundBlurRadius == 0) {
        return 0;
    }

    const auto& p = mDrawingParent.promote();
    half parentAlpha = (p != nullptr) ? p->getAlpha() : 1.0_hf;
    return parentAlpha * getDrawingState().backgroundBlurRadius;
}
+3 −3
Original line number Diff line number Diff line
@@ -4623,12 +4623,12 @@ status_t SurfaceFlinger::createLayer(LayerCreationArgs& args, sp<IBinder>* outHa
                                        pendingBufferCounter);
            }
        } break;
        case ISurfaceComposerClient::eFXSurfaceContainer:
            args.flags |= ISurfaceComposerClient::eNoColorFill;
            FMT_FALLTHROUGH;
        case ISurfaceComposerClient::eFXSurfaceEffect:
            result = createEffectLayer(args, outHandle, &layer);
            break;
        case ISurfaceComposerClient::eFXSurfaceContainer:
            result = createContainerLayer(args, outHandle, &layer);
            break;
        default:
            result = BAD_VALUE;
            break;