package o;

import android.graphics.Paint;
import android.graphics.Shader;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.zg, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C3113zg implements InterfaceC2095ot {
    public final C3018yg l;
    public final C3126zm0 m;
    public Ew0 n;

    /* renamed from: o, reason: collision with root package name */
    public Ew0 f827o;

    public C3113zg() {
        C2375rr c2375rr = AbstractC2539te.b;
        C3018yg c3018yg = new C3018yg();
        c3018yg.a = c2375rr;
        c3018yg.b = EnumC1280gK.l;
        c3018yg.c = C0255Jv.a;
        c3018yg.d = 0L;
        this.l = c3018yg;
        this.m = new C3126zm0(this);
    }

    public static Ew0 a(C3113zg c3113zg, long j, AbstractC2190pt abstractC2190pt, int i) {
        Ew0 ew0D = c3113zg.d(abstractC2190pt);
        Paint paint = (Paint) ew0D.b;
        if (!C0190Hi.c(AbstractC0752ap.b(paint.getColor()), j)) {
            ew0D.f(j);
        }
        if (((Shader) ew0D.c) != null) {
            ew0D.c = null;
            paint.setShader(null);
        }
        if (!F3.c((C0444Rd) ew0D.d, null)) {
            ew0D.g(null);
        }
        if (ew0D.a != i) {
            ew0D.e(i);
        }
        if (paint.isFilterBitmap()) {
            return ew0D;
        }
        paint.setFilterBitmap(true);
        return ew0D;
    }

    @Override // o.InterfaceC2095ot
    public final C3126zm0 E() {
        return this.m;
    }

    @Override // o.InterfaceC2095ot
    public final void F(O4 o4, long j, AbstractC2190pt abstractC2190pt) {
        this.l.c.h(o4, a(this, j, abstractC2190pt, 3));
    }

    @Override // o.InterfaceC2095ot
    public final void M(C2493t4 c2493t4, long j, long j2, long j3, float f, C0444Rd c0444Rd, int i) {
        this.l.c.m(c2493t4, j, j2, j3, b(null, C2103oy.a, f, c0444Rd, 3, i));
    }

    @Override // o.InterfaceC2095ot
    public final void P(O4 o4, AbstractC0601Xe abstractC0601Xe, float f, AbstractC2190pt abstractC2190pt, int i) {
        this.l.c.h(o4, b(abstractC0601Xe, abstractC2190pt, f, null, i, 1));
    }

    public final Ew0 b(AbstractC0601Xe abstractC0601Xe, AbstractC2190pt abstractC2190pt, float f, C0444Rd c0444Rd, int i, int i2) {
        Ew0 ew0D = d(abstractC2190pt);
        Paint paint = (Paint) ew0D.b;
        if (abstractC0601Xe != null) {
            abstractC0601Xe.a(f, f(), ew0D);
        } else {
            if (((Shader) ew0D.c) != null) {
                ew0D.c = null;
                paint.setShader(null);
            }
            long jB = AbstractC0752ap.b(paint.getColor());
            long j = C0190Hi.b;
            if (!C0190Hi.c(jB, j)) {
                ew0D.f(j);
            }
            if (paint.getAlpha() / 255.0f != f) {
                ew0D.d(f);
            }
        }
        if (!F3.c((C0444Rd) ew0D.d, c0444Rd)) {
            ew0D.g(c0444Rd);
        }
        if (ew0D.a != i) {
            ew0D.e(i);
        }
        if (paint.isFilterBitmap() == i2) {
            return ew0D;
        }
        paint.setFilterBitmap(true ^ (i2 == 0));
        return ew0D;
    }

    public final void c(C2493t4 c2493t4, C0444Rd c0444Rd) {
        this.l.c.b(c2493t4, b(null, C2103oy.a, 1.0f, c0444Rd, 3, 1));
    }

    public final Ew0 d(AbstractC2190pt abstractC2190pt) {
        if (F3.c(abstractC2190pt, C2103oy.a)) {
            Ew0 ew0 = this.n;
            if (ew0 != null) {
                return ew0;
            }
            Ew0 ew0B = AbstractC0662Zn.b();
            ew0B.j(0);
            this.n = ew0B;
            return ew0B;
        }
        if (!(abstractC2190pt instanceof C1395hb0)) {
            throw new C2170pj();
        }
        Ew0 ew0B2 = this.f827o;
        if (ew0B2 == null) {
            ew0B2 = AbstractC0662Zn.b();
            ew0B2.j(1);
            this.f827o = ew0B2;
        }
        Paint paint = (Paint) ew0B2.b;
        float strokeWidth = paint.getStrokeWidth();
        C1395hb0 c1395hb0 = (C1395hb0) abstractC2190pt;
        float f = c1395hb0.a;
        if (strokeWidth != f) {
            paint.setStrokeWidth(f);
        }
        int iB = ew0B2.b();
        int i = c1395hb0.c;
        if (iB != i) {
            ew0B2.h(i);
        }
        float strokeMiter = paint.getStrokeMiter();
        float f2 = c1395hb0.b;
        if (strokeMiter != f2) {
            paint.setStrokeMiter(f2);
        }
        int iC = ew0B2.c();
        int i2 = c1395hb0.d;
        if (iC == i2) {
            return ew0B2;
        }
        ew0B2.i(i2);
        return ew0B2;
    }

    @Override // o.InterfaceC2281qr
    public final float e() {
        return this.l.a.e();
    }

    @Override // o.InterfaceC2095ot
    public final EnumC1280gK getLayoutDirection() {
        return this.l.b;
    }

    @Override // o.InterfaceC2095ot
    public final void j0(long j, long j2, long j3, long j4, AbstractC2190pt abstractC2190pt) {
        int i = (int) (j2 >> 32);
        int i2 = (int) (j2 & 4294967295L);
        this.l.c.q(Float.intBitsToFloat(i), Float.intBitsToFloat(i2), Float.intBitsToFloat((int) (j3 >> 32)) + Float.intBitsToFloat(i), Float.intBitsToFloat((int) (j3 & 4294967295L)) + Float.intBitsToFloat(i2), Float.intBitsToFloat((int) (j4 >> 32)), Float.intBitsToFloat((int) (j4 & 4294967295L)), a(this, j, abstractC2190pt, 3));
    }

    @Override // o.InterfaceC2095ot
    public final void o(long j, float f, float f2, long j2, long j3, AbstractC2190pt abstractC2190pt) {
        int i = (int) (j2 >> 32);
        int i2 = (int) (j2 & 4294967295L);
        this.l.c.a(Float.intBitsToFloat(i), Float.intBitsToFloat(i2), Float.intBitsToFloat((int) (j3 >> 32)) + Float.intBitsToFloat(i), Float.intBitsToFloat((int) (j3 & 4294967295L)) + Float.intBitsToFloat(i2), f, f2, a(this, j, abstractC2190pt, 3));
    }

    @Override // o.InterfaceC2281qr
    public final float q() {
        return this.l.a.q();
    }

    @Override // o.InterfaceC2095ot
    public final void s0(int i, long j, long j2, long j3) {
        int i2 = (int) (j2 >> 32);
        int i3 = (int) (j2 & 4294967295L);
        this.l.c.l(Float.intBitsToFloat(i2), Float.intBitsToFloat(i3), Float.intBitsToFloat((int) (j3 >> 32)) + Float.intBitsToFloat(i2), Float.intBitsToFloat((int) (j3 & 4294967295L)) + Float.intBitsToFloat(i3), a(this, j, C2103oy.a, i));
    }

    @Override // o.InterfaceC2095ot
    public final void t(float f, long j, long j2) {
        this.l.c.c(f, j2, a(this, j, C2103oy.a, 3));
    }
}
