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

Commit 27016a9f authored by Peiyong Lin's avatar Peiyong Lin
Browse files

Revert "[RoundedCorner] Use the correct source bounds and crop."

This reverts commit 7956695e.

Reason for revert: Results in weird crop issues.

Below is the original commit message:
Previously we call getBounds to calculate the rounded corner, but that's wrong.
For an app layer, what we really need is the source bounds of the layer, and
the actual crop with transformation but without any parent bounds and display
bounds. However, only the root view has the correct crop information. And thus
this patch passes the correct bounds up to the root, and use the crop from the
root to calculate the rounded corner bounds.

Change-Id: I5319614ba74ee2877fe382575f2e7f9da418d585
BUG: 125916918
Test: Build, flash and boot. Verify with window transition.
parent 7956695e
Loading
Loading
Loading
Loading
+2 −8
Original line number Original line Diff line number Diff line
@@ -1768,13 +1768,9 @@ half4 Layer::getColor() const {
}
}


Layer::RoundedCornerState Layer::getRoundedCornerState() const {
Layer::RoundedCornerState Layer::getRoundedCornerState() const {
    return getRoundedCornerStateInternal(mSourceBounds);
}

Layer::RoundedCornerState Layer::getRoundedCornerStateInternal(const FloatRect bounds) const {
    const auto& p = mDrawingParent.promote();
    const auto& p = mDrawingParent.promote();
    if (p != nullptr) {
    if (p != nullptr) {
        RoundedCornerState parentState = p->getRoundedCornerStateInternal(bounds);
        RoundedCornerState parentState = p->getRoundedCornerState();
        if (parentState.radius > 0) {
        if (parentState.radius > 0) {
            ui::Transform t = getActiveTransform(getDrawingState());
            ui::Transform t = getActiveTransform(getDrawingState());
            t = t.inverse();
            t = t.inverse();
@@ -1788,9 +1784,7 @@ Layer::RoundedCornerState Layer::getRoundedCornerStateInternal(const FloatRect b
        }
        }
    }
    }
    const float radius = getDrawingState().cornerRadius;
    const float radius = getDrawingState().cornerRadius;
    return radius > 0
    return radius > 0 ? RoundedCornerState(getBounds(), radius) : RoundedCornerState();
            ? RoundedCornerState(bounds.intersect(getCrop(getDrawingState()).toFloatRect()), radius)
            : RoundedCornerState();
}
}


void Layer::commitChildList() {
void Layer::commitChildList() {
+0 −2
Original line number Original line Diff line number Diff line
@@ -901,8 +901,6 @@ private:
     */
     */
    Rect getCroppedBufferSize(const Layer::State& s) const;
    Rect getCroppedBufferSize(const Layer::State& s) const;


    RoundedCornerState getRoundedCornerStateInternal(const FloatRect bounds) const;

    // Cached properties computed from drawing state
    // Cached properties computed from drawing state
    // Effective transform taking into account parent transforms and any parent scaling.
    // Effective transform taking into account parent transforms and any parent scaling.
    ui::Transform mEffectiveTransform;
    ui::Transform mEffectiveTransform;