package u0;

import J4.c;
import h1.m;
import kotlin.jvm.internal.o;
import m1.g;
import o0.C2632c;
import p.C2646H;
import p0.AbstractC2686D;
import p0.AbstractC2715v;
import p0.InterfaceC2712s;
import p0.O;
import r0.InterfaceC2866e;

/* JADX INFO: renamed from: u0.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC2959b {
    public static final int $stable = 8;
    private AbstractC2715v colorFilter;
    private O layerPaint;
    private boolean useLayer;
    private float alpha = 1.0f;
    private m layoutDirection = m.f16628a;
    private final c drawLambda = new C2646H(this, 3);

    /* JADX INFO: renamed from: draw-x_KDEd0$default, reason: not valid java name */
    public static /* synthetic */ void m1217drawx_KDEd0$default(AbstractC2959b abstractC2959b, InterfaceC2866e interfaceC2866e, long j4, float f6, AbstractC2715v abstractC2715v, int i6, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: draw-x_KDEd0");
        }
        if ((i6 & 2) != 0) {
            f6 = 1.0f;
        }
        float f7 = f6;
        if ((i6 & 4) != 0) {
            abstractC2715v = null;
        }
        abstractC2959b.m1218drawx_KDEd0(interfaceC2866e, j4, f7, abstractC2715v);
    }

    public abstract boolean applyAlpha(float f6);

    public abstract boolean applyColorFilter(AbstractC2715v abstractC2715v);

    public boolean applyLayoutDirection(m mVar) {
        return false;
    }

    /* JADX INFO: renamed from: draw-x_KDEd0, reason: not valid java name */
    public final void m1218drawx_KDEd0(InterfaceC2866e interfaceC2866e, long j4, float f6, AbstractC2715v abstractC2715v) {
        if (this.alpha != f6) {
            if (!applyAlpha(f6)) {
                if (f6 == 1.0f) {
                    O o6 = this.layerPaint;
                    if (o6 != null) {
                        ((I2.O) o6).e(f6);
                    }
                    this.useLayer = false;
                } else {
                    O oI = this.layerPaint;
                    if (oI == null) {
                        oI = AbstractC2686D.i();
                        this.layerPaint = oI;
                    }
                    ((I2.O) oI).e(f6);
                    this.useLayer = true;
                }
            }
            this.alpha = f6;
        }
        if (!o.c(this.colorFilter, abstractC2715v)) {
            if (!applyColorFilter(abstractC2715v)) {
                if (abstractC2715v == null) {
                    O o7 = this.layerPaint;
                    if (o7 != null) {
                        ((I2.O) o7).h(null);
                    }
                    this.useLayer = false;
                } else {
                    O oI2 = this.layerPaint;
                    if (oI2 == null) {
                        oI2 = AbstractC2686D.i();
                        this.layerPaint = oI2;
                    }
                    ((I2.O) oI2).h(abstractC2715v);
                    this.useLayer = true;
                }
            }
            this.colorFilter = abstractC2715v;
        }
        m layoutDirection = interfaceC2866e.getLayoutDirection();
        if (this.layoutDirection != layoutDirection) {
            applyLayoutDirection(layoutDirection);
            this.layoutDirection = layoutDirection;
        }
        int i6 = (int) (j4 >> 32);
        float fIntBitsToFloat = Float.intBitsToFloat((int) (interfaceC2866e.c() >> 32)) - Float.intBitsToFloat(i6);
        int i7 = (int) (j4 & 4294967295L);
        float fIntBitsToFloat2 = Float.intBitsToFloat((int) (interfaceC2866e.c() & 4294967295L)) - Float.intBitsToFloat(i7);
        ((l2.c) interfaceC2866e.a0().f21850c).f(0.0f, 0.0f, fIntBitsToFloat, fIntBitsToFloat2);
        if (f6 > 0.0f) {
            try {
                if (Float.intBitsToFloat(i6) > 0.0f && Float.intBitsToFloat(i7) > 0.0f) {
                    if (this.useLayer) {
                        float fIntBitsToFloat3 = Float.intBitsToFloat(i6);
                        C2632c c2632cB = g.b(0L, (((long) Float.floatToRawIntBits(Float.intBitsToFloat(i7))) & 4294967295L) | (Float.floatToRawIntBits(fIntBitsToFloat3) << 32));
                        InterfaceC2712s interfaceC2712sC = interfaceC2866e.a0().c();
                        O oI3 = this.layerPaint;
                        if (oI3 == null) {
                            oI3 = AbstractC2686D.i();
                            this.layerPaint = oI3;
                        }
                        try {
                            interfaceC2712sC.a(c2632cB, oI3);
                            onDraw(interfaceC2866e);
                            interfaceC2712sC.r();
                        } catch (Throwable th) {
                            interfaceC2712sC.r();
                            throw th;
                        }
                    } else {
                        onDraw(interfaceC2866e);
                    }
                }
            } catch (Throwable th2) {
                ((l2.c) interfaceC2866e.a0().f21850c).f(-0.0f, -0.0f, -fIntBitsToFloat, -fIntBitsToFloat2);
                throw th2;
            }
        }
        ((l2.c) interfaceC2866e.a0().f21850c).f(-0.0f, -0.0f, -fIntBitsToFloat, -fIntBitsToFloat2);
    }

    /* JADX INFO: renamed from: getIntrinsicSize-NH-jbRc */
    public abstract long mo288getIntrinsicSizeNHjbRc();

    public abstract void onDraw(InterfaceC2866e interfaceC2866e);
}
