package defpackage;

import android.graphics.Path;
import android.graphics.PointF;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class hp8 extends u70<bp8, Path> {
    public final bp8 i;
    public final Path j;
    public Path k;
    public Path l;
    public ArrayList m;

    public hp8(List list) {
        super(list);
        this.i = new bp8();
        this.j = new Path();
    }

    @Override // defpackage.u70
    public final Object f(u35 u35Var, float f) {
        bp8 bp8VarD;
        bp8 bp8Var = (bp8) u35Var.b;
        bp8 bp8Var2 = (bp8) u35Var.c;
        bp8 bp8Var3 = bp8Var2 == null ? bp8Var : bp8Var2;
        bp8 bp8Var4 = this.i;
        ArrayList arrayList = bp8Var4.a;
        if (bp8Var4.b == null) {
            bp8Var4.b = new PointF();
        }
        boolean z = bp8Var.c;
        ArrayList arrayList2 = bp8Var.a;
        boolean z2 = true;
        bp8Var4.c = z || bp8Var3.c;
        int size = arrayList2.size();
        ArrayList arrayList3 = bp8Var3.a;
        if (size != arrayList3.size()) {
            gh5.b("Curves must have the same number of control points. Shape 1: " + arrayList2.size() + "\tShape 2: " + arrayList3.size());
        }
        int iMin = Math.min(arrayList2.size(), arrayList3.size());
        if (arrayList.size() < iMin) {
            for (int size2 = arrayList.size(); size2 < iMin; size2++) {
                arrayList.add(new nn1());
            }
        } else if (arrayList.size() > iMin) {
            for (int size3 = arrayList.size() - 1; size3 >= iMin; size3--) {
                arrayList.remove(arrayList.size() - 1);
            }
        }
        PointF pointF = bp8Var.b;
        PointF pointF2 = bp8Var3.b;
        bp8Var4.a(mx5.f(pointF.x, pointF2.x, f), mx5.f(pointF.y, pointF2.y, f));
        int size4 = arrayList.size() - 1;
        while (size4 >= 0) {
            nn1 nn1Var = (nn1) arrayList2.get(size4);
            nn1 nn1Var2 = (nn1) arrayList3.get(size4);
            PointF pointF3 = nn1Var.a;
            PointF pointF4 = nn1Var.b;
            PointF pointF5 = nn1Var.c;
            PointF pointF6 = nn1Var2.a;
            boolean z3 = z2;
            PointF pointF7 = nn1Var2.b;
            PointF pointF8 = nn1Var2.c;
            ((nn1) arrayList.get(size4)).a.set(mx5.f(pointF3.x, pointF6.x, f), mx5.f(pointF3.y, pointF6.y, f));
            ((nn1) arrayList.get(size4)).b.set(mx5.f(pointF4.x, pointF7.x, f), mx5.f(pointF4.y, pointF7.y, f));
            ((nn1) arrayList.get(size4)).c.set(mx5.f(pointF5.x, pointF8.x, f), mx5.f(pointF5.y, pointF8.y, f));
            size4--;
            z2 = z3;
            arrayList2 = arrayList2;
            bp8Var4 = bp8Var4;
            arrayList3 = arrayList3;
        }
        bp8 bp8Var5 = bp8Var4;
        ArrayList arrayList4 = this.m;
        if (arrayList4 != null) {
            bp8VarD = bp8Var5;
            for (int size5 = arrayList4.size() - 1; size5 >= 0; size5--) {
                bp8VarD = ((jp8) this.m.get(size5)).d(bp8VarD);
            }
        } else {
            bp8VarD = bp8Var5;
        }
        Path path = this.j;
        mx5.e(bp8VarD, path);
        if (this.e == null) {
            return path;
        }
        if (this.k == null) {
            this.k = new Path();
            this.l = new Path();
        }
        mx5.e(bp8Var, this.k);
        if (bp8Var2 != null) {
            mx5.e(bp8Var2, this.l);
        }
        hl5 hl5Var = this.e;
        float f2 = u35Var.g;
        float fFloatValue = u35Var.h.floatValue();
        Path path2 = this.k;
        return (Path) hl5Var.b(f2, fFloatValue, path2, bp8Var2 == null ? path2 : this.l, f, d(), this.d);
    }

    @Override // defpackage.u70
    public final boolean k() {
        ArrayList arrayList = this.m;
        return (arrayList == null || arrayList.isEmpty()) ? false : true;
    }
}
