package r0;

import E3.v;
import I2.O;
import android.graphics.Paint;
import android.graphics.Shader;
import h1.m;
import kotlin.jvm.internal.o;
import p0.AbstractC2686D;
import p0.AbstractC2711q;
import p0.AbstractC2715v;
import p0.C2700f;
import p0.C2702h;
import p0.C2706l;
import p0.C2714u;
import p0.InterfaceC2712s;
import p0.Q;

/* JADX INFO: renamed from: r0.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C2863b implements InterfaceC2866e {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final o4.f f23803b;

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

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

    public C2863b() {
        h1.d dVar = AbstractC2865d.f23806a;
        m mVar = m.f16628a;
        g gVar = g.f23807a;
        C2862a c2862a = new C2862a();
        c2862a.f23798a = dVar;
        c2862a.f23799b = mVar;
        c2862a.f23800c = gVar;
        c2862a.f23801d = 0L;
        this.f23802a = c2862a;
        this.f23803b = new o4.f(this);
    }

    public static p0.O b(C2863b c2863b, long j4, f fVar, float f6, int i6) {
        p0.O oK = c2863b.k(fVar);
        if (f6 != 1.0f) {
            j4 = C2714u.c(C2714u.e(j4) * f6, j4);
        }
        O o6 = (O) oK;
        if (!C2714u.d(AbstractC2686D.c(((Paint) o6.f2524b).getColor()), j4)) {
            o6.g(j4);
        }
        if (((Shader) o6.f2525c) != null) {
            o6.j(null);
        }
        if (!o.c((AbstractC2715v) o6.f2526d, null)) {
            o6.h(null);
        }
        if (o6.f2523a != i6) {
            o6.f(i6);
        }
        if (((Paint) o6.f2524b).isFilterBitmap()) {
            return oK;
        }
        o6.i(1);
        return oK;
    }

    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$PrimitiveArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    @Override // r0.InterfaceC2866e
    public final void A(long j4, long j6, long j7, float f6, int i6) {
        InterfaceC2712s interfaceC2712s = this.f23802a.f23800c;
        O oI = this.f23805d;
        if (oI == null) {
            oI = AbstractC2686D.i();
            oI.n(1);
            this.f23805d = oI;
        }
        if (!C2714u.d(AbstractC2686D.c(((Paint) oI.f2524b).getColor()), j4)) {
            oI.g(j4);
        }
        if (((Shader) oI.f2525c) != null) {
            oI.j(null);
        }
        if (!o.c((AbstractC2715v) oI.f2526d, null)) {
            oI.h(null);
        }
        if (oI.f2523a != 3) {
            oI.f(3);
        }
        Paint paint = (Paint) oI.f2524b;
        if (paint.getStrokeWidth() != f6) {
            oI.m(f6);
        }
        if (paint.getStrokeMiter() != 4.0f) {
            ((Paint) oI.f2524b).setStrokeMiter(4.0f);
        }
        if (oI.b() != i6) {
            oI.k(i6);
        }
        if (oI.d() != 0) {
            oI.l(0);
        }
        if (!paint.isFilterBitmap()) {
            oI.i(1);
        }
        interfaceC2712s.m(j6, j7, oI);
    }

    @Override // r0.InterfaceC2866e
    public final void H(Q q6, AbstractC2711q abstractC2711q, float f6, f fVar, int i6) {
        this.f23802a.f23800c.k(q6, d(abstractC2711q, fVar, f6, null, i6, 1));
    }

    @Override // r0.InterfaceC2866e
    public final void P(long j4, float f6, long j6) {
        this.f23802a.f23800c.l(j6, b(this, j4, h.f23808a, 1.0f, 3), f6);
    }

    @Override // h1.c
    public final float T() {
        return this.f23802a.f23798a.T();
    }

    @Override // r0.InterfaceC2866e
    public final void W(long j4, long j6, long j7, long j8) {
        h hVar = h.f23808a;
        int i6 = (int) (j6 >> 32);
        int i7 = (int) (j6 & 4294967295L);
        this.f23802a.f23800c.n(Float.intBitsToFloat(i6), Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j7 >> 32)) + Float.intBitsToFloat(i6), Float.intBitsToFloat((int) (j7 & 4294967295L)) + Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j8 >> 32)), Float.intBitsToFloat((int) (j8 & 4294967295L)), b(this, j4, hVar, 1.0f, 3));
    }

    @Override // h1.c
    public final float a() {
        return this.f23802a.f23798a.a();
    }

    @Override // r0.InterfaceC2866e
    public final o4.f a0() {
        return this.f23803b;
    }

    @Override // r0.InterfaceC2866e
    public final void b0(long j4, float f6, float f7, long j6, long j7, f fVar) {
        int i6 = (int) (j6 >> 32);
        int i7 = (int) (j6 & 4294967295L);
        this.f23802a.f23800c.s(Float.intBitsToFloat(i6), Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j7 >> 32)) + Float.intBitsToFloat(i6), Float.intBitsToFloat((int) (j7 & 4294967295L)) + Float.intBitsToFloat(i7), f6, f7, b(this, j4, fVar, 1.0f, 3));
    }

    public final p0.O d(AbstractC2711q abstractC2711q, f fVar, float f6, AbstractC2715v abstractC2715v, int i6, int i7) {
        p0.O oK = k(fVar);
        if (abstractC2711q != null) {
            abstractC2711q.mo1209applyToPq9zytI(c(), oK, f6);
        } else {
            O o6 = (O) oK;
            if (((Shader) o6.f2525c) != null) {
                o6.j(null);
            }
            long jC = AbstractC2686D.c(((Paint) o6.f2524b).getColor());
            long j4 = C2714u.f22935b;
            if (!C2714u.d(jC, j4)) {
                o6.g(j4);
            }
            if (((Paint) o6.f2524b).getAlpha() / 255.0f != f6) {
                o6.e(f6);
            }
        }
        O o7 = (O) oK;
        if (!o.c((AbstractC2715v) o7.f2526d, abstractC2715v)) {
            o7.h(abstractC2715v);
        }
        if (o7.f2523a != i6) {
            o7.f(i6);
        }
        if (((Paint) o7.f2524b).isFilterBitmap() == i7) {
            return oK;
        }
        o7.i(i7);
        return oK;
    }

    @Override // r0.InterfaceC2866e
    public final void g(C2702h c2702h, long j4) {
        this.f23802a.f23800c.k(c2702h, b(this, j4, h.f23808a, 1.0f, 3));
    }

    @Override // r0.InterfaceC2866e
    public final m getLayoutDirection() {
        return this.f23802a.f23799b;
    }

    @Override // r0.InterfaceC2866e
    public final void h(AbstractC2711q abstractC2711q, long j4, long j6, long j7, float f6, f fVar) {
        int i6 = (int) (j4 >> 32);
        int i7 = (int) (j4 & 4294967295L);
        this.f23802a.f23800c.n(Float.intBitsToFloat(i6), Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j6 >> 32)) + Float.intBitsToFloat(i6), Float.intBitsToFloat((int) (j6 & 4294967295L)) + Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j7 >> 32)), Float.intBitsToFloat((int) (j7 & 4294967295L)), d(abstractC2711q, fVar, f6, null, 3, 1));
    }

    public final void i(C2700f c2700f, C2706l c2706l) {
        this.f23802a.f23800c.h(c2700f, d(null, h.f23808a, 1.0f, c2706l, 3, 1));
    }

    public final p0.O k(f fVar) {
        if (o.c(fVar, h.f23808a)) {
            O o6 = this.f23804c;
            if (o6 != null) {
                return o6;
            }
            O oI = AbstractC2686D.i();
            oI.n(0);
            this.f23804c = oI;
            return oI;
        }
        if (!(fVar instanceof i)) {
            throw new v();
        }
        O oI2 = this.f23805d;
        if (oI2 == null) {
            oI2 = AbstractC2686D.i();
            oI2.n(1);
            this.f23805d = oI2;
        }
        Paint paint = (Paint) oI2.f2524b;
        float strokeWidth = paint.getStrokeWidth();
        i iVar = (i) fVar;
        float f6 = iVar.f23809a;
        if (strokeWidth != f6) {
            oI2.m(f6);
        }
        int iB = oI2.b();
        int i6 = iVar.f23811c;
        if (iB != i6) {
            oI2.k(i6);
        }
        float strokeMiter = paint.getStrokeMiter();
        float f7 = iVar.f23810b;
        if (strokeMiter != f7) {
            ((Paint) oI2.f2524b).setStrokeMiter(f7);
        }
        int iD = oI2.d();
        int i7 = iVar.f23812d;
        if (iD == i7) {
            return oI2;
        }
        oI2.l(i7);
        return oI2;
    }

    @Override // r0.InterfaceC2866e
    public final void l0(C2700f c2700f, long j4, long j6, long j7, float f6, AbstractC2715v abstractC2715v, int i6) {
        this.f23802a.f23800c.e(c2700f, j4, j6, j7, d(null, h.f23808a, f6, abstractC2715v, 3, i6));
    }

    @Override // r0.InterfaceC2866e
    public final void p0(long j4, long j6, long j7, float f6, int i6) {
        h hVar = h.f23808a;
        int i7 = (int) (j6 >> 32);
        int i8 = (int) (j6 & 4294967295L);
        this.f23802a.f23800c.i(Float.intBitsToFloat(i7), Float.intBitsToFloat(i8), Float.intBitsToFloat((int) (j7 >> 32)) + Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j7 & 4294967295L)) + Float.intBitsToFloat(i8), b(this, j4, hVar, f6, i6));
    }

    @Override // r0.InterfaceC2866e
    public final void x(AbstractC2711q abstractC2711q, long j4, long j6, float f6, f fVar) {
        int i6 = (int) (j4 >> 32);
        int i7 = (int) (j4 & 4294967295L);
        this.f23802a.f23800c.i(Float.intBitsToFloat(i6), Float.intBitsToFloat(i7), Float.intBitsToFloat((int) (j6 >> 32)) + Float.intBitsToFloat(i6), Float.intBitsToFloat((int) (4294967295L & j6)) + Float.intBitsToFloat(i7), d(abstractC2711q, fVar, f6, null, 3, 1));
    }
}
