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

Commit cabf22a4 authored by Peiyong Lin's avatar Peiyong Lin Committed by Android (Google) Code Review
Browse files

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

parents ac9643a4 7956695e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1788,9 +1788,13 @@ half4 Layer::getColor() const {
}

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

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

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

    RoundedCornerState getRoundedCornerStateInternal(const FloatRect bounds) const;

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