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

Commit ea04b6f7 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

SF: Clean up layer state

Remove unused layer states.

Bug: 238781169
Test: presubmit
Change-Id: I84917bed157a93ec9bfd16d168312ce27ff1765e
parent a62797e4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -464,7 +464,6 @@ void Replayer::setPosition(SurfaceComposerClient::Transaction& t,
void Replayer::setSize(SurfaceComposerClient::Transaction& t,
        layer_id id, const SizeChange& sc) {
    ALOGV("Layer %d: Setting Size -- w=%u, h=%u", id, sc.w(), sc.h());
    t.setSize(mLayers[id], sc.w(), sc.h());
}

void Replayer::setLayer(SurfaceComposerClient::Transaction& t,
+0 −11
Original line number Diff line number Diff line
@@ -40,8 +40,6 @@ layer_state_t::layer_state_t()
        x(0),
        y(0),
        z(0),
        w(0),
        h(0),
        alpha(0),
        flags(0),
        mask(0),
@@ -84,8 +82,6 @@ status_t layer_state_t::write(Parcel& output) const
    SAFE_PARCEL(output.writeFloat, x);
    SAFE_PARCEL(output.writeFloat, y);
    SAFE_PARCEL(output.writeInt32, z);
    SAFE_PARCEL(output.writeUint32, w);
    SAFE_PARCEL(output.writeUint32, h);
    SAFE_PARCEL(output.writeUint32, layerStack.id);
    SAFE_PARCEL(output.writeFloat, alpha);
    SAFE_PARCEL(output.writeUint32, flags);
@@ -180,8 +176,6 @@ status_t layer_state_t::read(const Parcel& input)
    SAFE_PARCEL(input.readFloat, &x);
    SAFE_PARCEL(input.readFloat, &y);
    SAFE_PARCEL(input.readInt32, &z);
    SAFE_PARCEL(input.readUint32, &w);
    SAFE_PARCEL(input.readUint32, &h);
    SAFE_PARCEL(input.readUint32, &layerStack.id);
    SAFE_PARCEL(input.readFloat, &alpha);

@@ -457,11 +451,6 @@ void layer_state_t::merge(const layer_state_t& other) {
        what &= ~eRelativeLayerChanged;
        z = other.z;
    }
    if (other.what & eSizeChanged) {
        what |= eSizeChanged;
        w = other.w;
        h = other.h;
    }
    if (other.what & eAlphaChanged) {
        what |= eAlphaChanged;
        alpha = other.alpha;
+0 −15
Original line number Diff line number Diff line
@@ -1165,21 +1165,6 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::hide(
    return setFlags(sc, layer_state_t::eLayerHidden, layer_state_t::eLayerHidden);
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setSize(
        const sp<SurfaceControl>& sc, uint32_t w, uint32_t h) {
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }
    s->what |= layer_state_t::eSizeChanged;
    s->w = w;
    s->h = h;

    registerSurfaceControlForCallback(sc);
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLayer(
        const sp<SurfaceControl>& sc, int32_t z) {
    layer_state_t* s = getLayerState(sc);
+0 −2
Original line number Diff line number Diff line
@@ -182,8 +182,6 @@ void SurfaceComposerClientFuzzer::invokeSurfaceComposerTransaction() {
    sp<SurfaceControl> surface = makeSurfaceControl();

    SurfaceComposerClient::Transaction transaction;
    transaction.setSize(surface, mFdp.ConsumeIntegral<uint32_t>(),
                        mFdp.ConsumeIntegral<uint32_t>());
    int32_t layer = mFdp.ConsumeIntegral<int32_t>();
    transaction.setLayer(surface, layer);

+1 −3
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ struct layer_state_t {
    enum {
        ePositionChanged = 0x00000001,
        eLayerChanged = 0x00000002,
        eSizeChanged = 0x00000004,
        // unused = 0x00000004,
        eAlphaChanged = 0x00000008,
        eMatrixChanged = 0x00000010,
        eTransparentRegionChanged = 0x00000020,
@@ -217,8 +217,6 @@ struct layer_state_t {
    float x;
    float y;
    int32_t z;
    uint32_t w;
    uint32_t h;
    ui::LayerStack layerStack = ui::DEFAULT_LAYER_STACK;
    float alpha;
    uint32_t flags;
Loading