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

Commit 2ee01c90 authored by Melody Hsu's avatar Melody Hsu
Browse files

[legacy layer cleanup] Crop and transform methods

Remove unused methods in legacy layer code.

Flag: EXEMPT flag removal
Bug: 330785038
Test: presubmit
Change-Id: I0c008ea8548ef18c86bd99280f9c1f202f656cc9
parent c420be83
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -871,16 +871,6 @@ bool Layer::setTransformToDisplayInverse(bool transformToDisplayInverse) {
    return true;
}

bool Layer::setBufferCrop(const Rect& bufferCrop) {
    if (mDrawingState.bufferCrop == bufferCrop) return false;

    mDrawingState.sequence++;
    mDrawingState.bufferCrop = bufferCrop;

    setTransactionFlags(eTransactionNeeded);
    return true;
}

void Layer::releasePreviousBuffer() {
    mReleasePreviousBuffer = true;
    if (!mBufferInfo.mBuffer ||
@@ -1568,25 +1558,6 @@ bool Layer::getTransformToDisplayInverse() const {
    return mBufferInfo.mTransformToDisplayInverse;
}

Rect Layer::getBufferCrop() const {
    // this is the crop rectangle that applies to the buffer
    // itself (as opposed to the window)
    if (!mBufferInfo.mCrop.isEmpty()) {
        // if the buffer crop is defined, we use that
        return mBufferInfo.mCrop;
    } else if (mBufferInfo.mBuffer != nullptr) {
        // otherwise we use the whole buffer
        return mBufferInfo.mBuffer->getBounds();
    } else {
        // if we don't have a buffer yet, we use an empty/invalid crop
        return Rect();
    }
}

uint32_t Layer::getBufferTransform() const {
    return mBufferInfo.mTransform;
}

ui::Dataspace Layer::translateDataspace(ui::Dataspace dataspace) {
    ui::Dataspace updatedDataspace = dataspace;
    // translate legacy dataspaces to modern dataspaces
+0 −18
Original line number Diff line number Diff line
@@ -213,10 +213,6 @@ public:
     * GRALLOC_USAGE_PROTECTED sense.
     */
    bool isProtected() const;
    /*
     * usesSourceCrop - true if content should use a source crop
     */
    bool usesSourceCrop() const { return hasBufferOrSidebandStream(); }

    Rect getCrop(const Layer::State& s) const { return s.crop; }
    bool needsFiltering(const DisplayDevice*) const;
@@ -248,17 +244,6 @@ public:
     */
    bool willReleaseBufferOnLatch() const;

    /*
     * returns the rectangle that crops the content of the layer and scales it
     * to the layer's size.
     */
    Rect getBufferCrop() const;

    /*
     * Returns the transform applied to the buffer.
     */
    uint32_t getBufferTransform() const;

    sp<GraphicBuffer> getBuffer() const;
    /**
     * Returns active buffer size in the correct orientation. Buffer size is determined by undoing
@@ -366,8 +351,6 @@ public:
    void getFrameStats(FrameStats* outStats) const;
    void onDisconnect();

    ui::Transform getTransform() const;

    half4 getColor() const;
    int32_t getBackgroundBlurRadius() const;
    bool drawShadows() const { return mEffectiveShadowRadius > 0.f; };
@@ -433,7 +416,6 @@ public:

    bool mPendingHWCDestroy{false};

    bool setBufferCrop(const Rect& /* bufferCrop */);
    // See mPendingBufferTransactions
    void decrementPendingBufferCount();
    std::atomic<int32_t>* getPendingBufferCounter() { return &mPendingBufferTransactions; }