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

Commit 25714500 authored by chaviw's avatar chaviw
Browse files

Rename crop_legacy to just crop

crop_legacy and crop should do the same thing so there's no need for two
separate requests.

Test: go/wm-smoke
Test: SurfaceFlinger_test
Bug: 170765639

Change-Id: I74a740d06d15f7cde9775557e65ad1e3a508bd61
parent f5b97a8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -495,7 +495,7 @@ void Replayer::setCrop(SurfaceComposerClient::Transaction& t,


    Rect r = Rect(cc.rectangle().left(), cc.rectangle().top(), cc.rectangle().right(),
    Rect r = Rect(cc.rectangle().left(), cc.rectangle().top(), cc.rectangle().right(),
            cc.rectangle().bottom());
            cc.rectangle().bottom());
    t.setCrop_legacy(mLayers[id], r);
    t.setCrop(mLayers[id], r);
}
}


void Replayer::setCornerRadius(SurfaceComposerClient::Transaction& t,
void Replayer::setCornerRadius(SurfaceComposerClient::Transaction& t,
+2 −7
Original line number Original line Diff line number Diff line
@@ -41,7 +41,6 @@ layer_state_t::layer_state_t()
        flags(0),
        flags(0),
        mask(0),
        mask(0),
        reserved(0),
        reserved(0),
        crop_legacy(Rect::INVALID_RECT),
        cornerRadius(0.0f),
        cornerRadius(0.0f),
        backgroundBlurRadius(0),
        backgroundBlurRadius(0),
        barrierFrameNumber(0),
        barrierFrameNumber(0),
@@ -85,7 +84,7 @@ status_t layer_state_t::write(Parcel& output) const
    SAFE_PARCEL(output.writeUint32, flags);
    SAFE_PARCEL(output.writeUint32, flags);
    SAFE_PARCEL(output.writeUint32, mask);
    SAFE_PARCEL(output.writeUint32, mask);
    SAFE_PARCEL(matrix.write, output);
    SAFE_PARCEL(matrix.write, output);
    SAFE_PARCEL(output.write, crop_legacy);
    SAFE_PARCEL(output.write, crop);
    SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, barrierSurfaceControl_legacy);
    SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, barrierSurfaceControl_legacy);
    SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, reparentSurfaceControl);
    SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, reparentSurfaceControl);
    SAFE_PARCEL(output.writeUint64, barrierFrameNumber);
    SAFE_PARCEL(output.writeUint64, barrierFrameNumber);
@@ -191,7 +190,7 @@ status_t layer_state_t::read(const Parcel& input)
    SAFE_PARCEL(input.readUint32, &mask);
    SAFE_PARCEL(input.readUint32, &mask);


    SAFE_PARCEL(matrix.read, input);
    SAFE_PARCEL(matrix.read, input);
    SAFE_PARCEL(input.read, crop_legacy);
    SAFE_PARCEL(input.read, crop);
    SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &barrierSurfaceControl_legacy);
    SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &barrierSurfaceControl_legacy);
    SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &reparentSurfaceControl);
    SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &reparentSurfaceControl);
    SAFE_PARCEL(input.readUint64, &barrierFrameNumber);
    SAFE_PARCEL(input.readUint64, &barrierFrameNumber);
@@ -407,10 +406,6 @@ void layer_state_t::merge(const layer_state_t& other) {
        what |= eLayerStackChanged;
        what |= eLayerStackChanged;
        layerStack = other.layerStack;
        layerStack = other.layerStack;
    }
    }
    if (other.what & eCropChanged_legacy) {
        what |= eCropChanged_legacy;
        crop_legacy = other.crop_legacy;
    }
    if (other.what & eCornerRadiusChanged) {
    if (other.what & eCornerRadiusChanged) {
        what |= eCornerRadiusChanged;
        what |= eCornerRadiusChanged;
        cornerRadius = other.cornerRadius;
        cornerRadius = other.cornerRadius;
+4 −18
Original line number Original line Diff line number Diff line
@@ -1048,15 +1048,15 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setMatri
    return *this;
    return *this;
}
}


SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCrop_legacy(
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCrop(
        const sp<SurfaceControl>& sc, const Rect& crop) {
        const sp<SurfaceControl>& sc, const Rect& crop) {
    layer_state_t* s = getLayerState(sc);
    layer_state_t* s = getLayerState(sc);
    if (!s) {
    if (!s) {
        mStatus = BAD_INDEX;
        mStatus = BAD_INDEX;
        return *this;
        return *this;
    }
    }
    s->what |= layer_state_t::eCropChanged_legacy;
    s->what |= layer_state_t::eCropChanged;
    s->crop_legacy = crop;
    s->crop = crop;


    registerSurfaceControlForCallback(sc);
    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
@@ -1204,20 +1204,6 @@ SurfaceComposerClient::Transaction::setTransformToDisplayInverse(const sp<Surfac
    return *this;
    return *this;
}
}


SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCrop(
        const sp<SurfaceControl>& sc, const Rect& crop) {
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }
    s->what |= layer_state_t::eCropChanged;
    s->crop = crop;

    registerSurfaceControlForCallback(sc);
    return *this;
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame(
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame(
        const sp<SurfaceControl>& sc, const Rect& frame) {
        const sp<SurfaceControl>& sc, const Rect& frame) {
    layer_state_t* s = getLayerState(sc);
    layer_state_t* s = getLayerState(sc);
@@ -1458,7 +1444,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColor


SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setGeometry(
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setGeometry(
        const sp<SurfaceControl>& sc, const Rect& source, const Rect& dst, int transform) {
        const sp<SurfaceControl>& sc, const Rect& source, const Rect& dst, int transform) {
    setCrop_legacy(sc, source);
    setCrop(sc, source);


    int x = dst.left;
    int x = dst.left;
    int y = dst.top;
    int y = dst.top;
+1 −2
Original line number Original line Diff line number Diff line
@@ -98,7 +98,7 @@ struct layer_state_t {
        eTransparentRegionChanged = 0x00000020,
        eTransparentRegionChanged = 0x00000020,
        eFlagsChanged = 0x00000040,
        eFlagsChanged = 0x00000040,
        eLayerStackChanged = 0x00000080,
        eLayerStackChanged = 0x00000080,
        eCropChanged_legacy = 0x00000100,
        /* was eCropChanged_legacy, now available 0x00000100, */
        eDeferTransaction_legacy = 0x00000200,
        eDeferTransaction_legacy = 0x00000200,
        /* was ScalingModeChanged, now available 0x00000400, */
        /* was ScalingModeChanged, now available 0x00000400, */
        eShadowRadiusChanged = 0x00000800,
        eShadowRadiusChanged = 0x00000800,
@@ -167,7 +167,6 @@ struct layer_state_t {
    uint32_t mask;
    uint32_t mask;
    uint8_t reserved;
    uint8_t reserved;
    matrix22_t matrix;
    matrix22_t matrix;
    Rect crop_legacy;
    float cornerRadius;
    float cornerRadius;
    uint32_t backgroundBlurRadius;
    uint32_t backgroundBlurRadius;
    sp<SurfaceControl> barrierSurfaceControl_legacy;
    sp<SurfaceControl> barrierSurfaceControl_legacy;
+1 −2
Original line number Original line Diff line number Diff line
@@ -436,7 +436,7 @@ public:
                float alpha);
                float alpha);
        Transaction& setMatrix(const sp<SurfaceControl>& sc,
        Transaction& setMatrix(const sp<SurfaceControl>& sc,
                float dsdx, float dtdx, float dtdy, float dsdy);
                float dsdx, float dtdx, float dtdy, float dsdy);
        Transaction& setCrop_legacy(const sp<SurfaceControl>& sc, const Rect& crop);
        Transaction& setCrop(const sp<SurfaceControl>& sc, const Rect& crop);
        Transaction& setCornerRadius(const sp<SurfaceControl>& sc, float cornerRadius);
        Transaction& setCornerRadius(const sp<SurfaceControl>& sc, float cornerRadius);
        Transaction& setBackgroundBlurRadius(const sp<SurfaceControl>& sc,
        Transaction& setBackgroundBlurRadius(const sp<SurfaceControl>& sc,
                                             int backgroundBlurRadius);
                                             int backgroundBlurRadius);
@@ -469,7 +469,6 @@ public:
        Transaction& setTransform(const sp<SurfaceControl>& sc, uint32_t transform);
        Transaction& setTransform(const sp<SurfaceControl>& sc, uint32_t transform);
        Transaction& setTransformToDisplayInverse(const sp<SurfaceControl>& sc,
        Transaction& setTransformToDisplayInverse(const sp<SurfaceControl>& sc,
                                                  bool transformToDisplayInverse);
                                                  bool transformToDisplayInverse);
        Transaction& setCrop(const sp<SurfaceControl>& sc, const Rect& crop);
        Transaction& setFrame(const sp<SurfaceControl>& sc, const Rect& frame);
        Transaction& setFrame(const sp<SurfaceControl>& sc, const Rect& frame);
        Transaction& setBuffer(const sp<SurfaceControl>& sc, const sp<GraphicBuffer>& buffer);
        Transaction& setBuffer(const sp<SurfaceControl>& sc, const sp<GraphicBuffer>& buffer);
        Transaction& setCachedBuffer(const sp<SurfaceControl>& sc, int32_t bufferId);
        Transaction& setCachedBuffer(const sp<SurfaceControl>& sc, int32_t bufferId);
Loading