package o;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RadialGradient;
import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.Shader;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class S70 extends X70 {
    public final U70 c;

    public S70(U70 u70) {
        this.c = u70;
    }

    @Override // o.X70
    public final void a(Matrix matrix, J70 j70, int i, Canvas canvas) {
        float f;
        U70 u70 = this.c;
        float f2 = u70.f;
        float f3 = u70.g;
        RectF rectF = new RectF(u70.b, u70.c, u70.d, u70.e);
        Paint paint = j70.b;
        boolean z = f3 < 0.0f;
        Path path = j70.g;
        int[] iArr = J70.k;
        if (z) {
            iArr[0] = 0;
            iArr[1] = j70.f;
            iArr[2] = j70.e;
            iArr[3] = j70.d;
            f = 0.0f;
        } else {
            path.rewind();
            f = 0.0f;
            path.moveTo(rectF.centerX(), rectF.centerY());
            path.arcTo(rectF, f2, f3);
            path.close();
            float f4 = -i;
            rectF.inset(f4, f4);
            iArr[0] = 0;
            iArr[1] = j70.d;
            iArr[2] = j70.e;
            iArr[3] = j70.f;
        }
        float fWidth = rectF.width() / 2.0f;
        if (fWidth <= f) {
            return;
        }
        float f5 = 1.0f - (i / fWidth);
        float[] fArr = J70.l;
        fArr[1] = f5;
        fArr[2] = ((1.0f - f5) / 2.0f) + f5;
        paint.setShader(new RadialGradient(rectF.centerX(), rectF.centerY(), fWidth, iArr, fArr, Shader.TileMode.CLAMP));
        canvas.save();
        canvas.concat(matrix);
        canvas.scale(1.0f, rectF.height() / rectF.width());
        if (!z) {
            canvas.clipPath(path, Region.Op.DIFFERENCE);
            canvas.drawPath(path, j70.h);
        }
        canvas.drawArc(rectF, f2, f3, true, paint);
        canvas.restore();
    }
}
