package J2;

import java.util.ArrayList;

/* JADX INFO: loaded from: classes.dex */
public final class t0 implements M {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final ArrayList f3451a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public float f3452b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public float f3453c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public u0 f3454d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f3455e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f3456f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public int f3457g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f3458h;

    public t0(B0 b02, L l) {
        ArrayList arrayList = new ArrayList();
        this.f3451a = arrayList;
        this.f3454d = null;
        this.f3455e = false;
        this.f3456f = true;
        this.f3457g = -1;
        if (l == null) {
            return;
        }
        l.o(this);
        if (this.f3458h) {
            this.f3454d.b((u0) arrayList.get(this.f3457g));
            arrayList.set(this.f3457g, this.f3454d);
            this.f3458h = false;
        }
        u0 u0Var = this.f3454d;
        if (u0Var != null) {
            arrayList.add(u0Var);
        }
    }

    @Override // J2.M
    public final void a(float f6, float f7, float f8, float f9) {
        this.f3454d.a(f6, f7);
        this.f3451a.add(this.f3454d);
        this.f3454d = new u0(f8, f9, f8 - f6, f9 - f7);
        this.f3458h = false;
    }

    @Override // J2.M
    public final void b(float f6, float f7) {
        boolean z6 = this.f3458h;
        ArrayList arrayList = this.f3451a;
        if (z6) {
            this.f3454d.b((u0) arrayList.get(this.f3457g));
            arrayList.set(this.f3457g, this.f3454d);
            this.f3458h = false;
        }
        u0 u0Var = this.f3454d;
        if (u0Var != null) {
            arrayList.add(u0Var);
        }
        this.f3452b = f6;
        this.f3453c = f7;
        this.f3454d = new u0(f6, f7, 0.0f, 0.0f);
        this.f3457g = arrayList.size();
    }

    @Override // J2.M
    public final void c(float f6, float f7, float f8, float f9, float f10, float f11) {
        if (this.f3456f || this.f3455e) {
            this.f3454d.a(f6, f7);
            this.f3451a.add(this.f3454d);
            this.f3455e = false;
        }
        this.f3454d = new u0(f10, f11, f10 - f8, f11 - f9);
        this.f3458h = false;
    }

    @Override // J2.M
    public final void close() {
        this.f3451a.add(this.f3454d);
        e(this.f3452b, this.f3453c);
        this.f3458h = true;
    }

    @Override // J2.M
    public final void d(float f6, float f7, float f8, boolean z6, boolean z7, float f9, float f10) {
        this.f3455e = true;
        this.f3456f = false;
        u0 u0Var = this.f3454d;
        B0.a(u0Var.f3460a, u0Var.f3461b, f6, f7, f8, z6, z7, f9, f10, this);
        this.f3456f = true;
        this.f3458h = false;
    }

    @Override // J2.M
    public final void e(float f6, float f7) {
        this.f3454d.a(f6, f7);
        this.f3451a.add(this.f3454d);
        u0 u0Var = this.f3454d;
        this.f3454d = new u0(f6, f7, f6 - u0Var.f3460a, f7 - u0Var.f3461b);
        this.f3458h = false;
    }
}
