package o;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.PorterDuffXfermode;
import android.os.Build;
import android.view.RenderNode;
import java.util.concurrent.atomic.AtomicBoolean;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.iE, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1466iE implements InterfaceC1178fE {
    public static final AtomicBoolean w = new AtomicBoolean(true);
    public final C0006Ag b;
    public final C3113zg c;
    public final RenderNode d;
    public long e;
    public Paint f;
    public Matrix g;
    public boolean h;
    public long i;
    public int j;
    public int k;
    public float l;
    public boolean m;
    public float n;

    /* renamed from: o, reason: collision with root package name */
    public float f580o;
    public float p;
    public long q;
    public long r;
    public float s;
    public boolean t;
    public boolean u;
    public boolean v;

    public C1466iE(C2207q3 c2207q3, C0006Ag c0006Ag, C3113zg c3113zg) {
        this.b = c0006Ag;
        this.c = c3113zg;
        RenderNode renderNodeCreate = RenderNode.create("Compose", c2207q3);
        this.d = renderNodeCreate;
        this.e = 0L;
        this.i = 0L;
        if (w.getAndSet(false)) {
            renderNodeCreate.setScaleX(renderNodeCreate.getScaleX());
            renderNodeCreate.setScaleY(renderNodeCreate.getScaleY());
            renderNodeCreate.setTranslationX(renderNodeCreate.getTranslationX());
            renderNodeCreate.setTranslationY(renderNodeCreate.getTranslationY());
            renderNodeCreate.setElevation(renderNodeCreate.getElevation());
            renderNodeCreate.setRotation(renderNodeCreate.getRotation());
            renderNodeCreate.setRotationX(renderNodeCreate.getRotationX());
            renderNodeCreate.setRotationY(renderNodeCreate.getRotationY());
            renderNodeCreate.setCameraDistance(renderNodeCreate.getCameraDistance());
            renderNodeCreate.setPivotX(renderNodeCreate.getPivotX());
            renderNodeCreate.setPivotY(renderNodeCreate.getPivotY());
            renderNodeCreate.setClipToOutline(renderNodeCreate.getClipToOutline());
            renderNodeCreate.setClipToBounds(false);
            renderNodeCreate.setAlpha(renderNodeCreate.getAlpha());
            renderNodeCreate.isValid();
            renderNodeCreate.setLeftTopRightBottom(0, 0, 0, 0);
            renderNodeCreate.offsetLeftAndRight(0);
            renderNodeCreate.offsetTopAndBottom(0);
            if (Build.VERSION.SDK_INT >= 28) {
                AbstractC0968d20.c(renderNodeCreate, AbstractC0968d20.a(renderNodeCreate));
                AbstractC0968d20.d(renderNodeCreate, AbstractC0968d20.b(renderNodeCreate));
            }
            AbstractC0872c20.a(renderNodeCreate);
            renderNodeCreate.setLayerType(0);
            renderNodeCreate.setHasOverlappingRendering(renderNodeCreate.hasOverlappingRendering());
        }
        renderNodeCreate.setClipToBounds(false);
        O(0);
        this.j = 0;
        this.k = 3;
        this.l = 1.0f;
        this.n = 1.0f;
        this.f580o = 1.0f;
        long j = C0190Hi.b;
        this.q = j;
        this.r = j;
        this.s = 8.0f;
    }

    @Override // o.InterfaceC1178fE
    public final void A(float f) {
        this.f580o = f;
        this.d.setScaleY(f);
    }

    @Override // o.InterfaceC1178fE
    public final void B(InterfaceC2923xg interfaceC2923xg) {
        Canvas canvas = U2.a;
        ((T2) interfaceC2923xg).a.drawRenderNode(this.d);
    }

    @Override // o.InterfaceC1178fE
    public final Matrix C() {
        Matrix matrix = this.g;
        if (matrix == null) {
            matrix = new Matrix();
            this.g = matrix;
        }
        this.d.getMatrix(matrix);
        return matrix;
    }

    @Override // o.InterfaceC1178fE
    public final void D(int i, int i2, long j) {
        int i3 = (int) (j >> 32);
        int i4 = (int) (4294967295L & j);
        this.d.setLeftTopRightBottom(i, i2, i + i3, i2 + i4);
        if (C1470iI.a(this.e, j)) {
            return;
        }
        if (this.m) {
            this.d.setPivotX(i3 / 2.0f);
            this.d.setPivotY(i4 / 2.0f);
        }
        this.e = j;
    }

    @Override // o.InterfaceC1178fE
    public final float E() {
        return 0.0f;
    }

    @Override // o.InterfaceC1178fE
    public final void F(float f) {
        this.s = f;
        this.d.setCameraDistance(-f);
    }

    @Override // o.InterfaceC1178fE
    public final float G() {
        return this.p;
    }

    @Override // o.InterfaceC1178fE
    public final boolean H() {
        return this.d.isValid();
    }

    @Override // o.InterfaceC1178fE
    public final float I() {
        return this.f580o;
    }

    @Override // o.InterfaceC1178fE
    public final float J() {
        return 0.0f;
    }

    @Override // o.InterfaceC1178fE
    public final int K() {
        return this.k;
    }

    @Override // o.InterfaceC1178fE
    public final void L(long j) {
        if ((9223372034707292159L & j) == 9205357640488583168L) {
            this.m = true;
            this.d.setPivotX(((int) (this.e >> 32)) / 2.0f);
            this.d.setPivotY(((int) (4294967295L & this.e)) / 2.0f);
        } else {
            this.m = false;
            this.d.setPivotX(Float.intBitsToFloat((int) (j >> 32)));
            this.d.setPivotY(Float.intBitsToFloat((int) (j & 4294967295L)));
        }
    }

    @Override // o.InterfaceC1178fE
    public final long M() {
        return this.q;
    }

    public final void N() {
        boolean z = this.t;
        boolean z2 = false;
        boolean z3 = z && !this.h;
        if (z && this.h) {
            z2 = true;
        }
        if (z3 != this.u) {
            this.u = z3;
            this.d.setClipToBounds(z3);
        }
        if (z2 != this.v) {
            this.v = z2;
            this.d.setClipToOutline(z2);
        }
    }

    public final void O(int i) {
        RenderNode renderNode = this.d;
        if (i == 1) {
            renderNode.setLayerType(2);
            renderNode.setLayerPaint(this.f);
            renderNode.setHasOverlappingRendering(true);
        } else if (i == 2) {
            renderNode.setLayerType(0);
            renderNode.setLayerPaint(this.f);
            renderNode.setHasOverlappingRendering(false);
        } else {
            renderNode.setLayerType(0);
            renderNode.setLayerPaint(this.f);
            renderNode.setHasOverlappingRendering(true);
        }
    }

    public final void P() {
        int i = this.j;
        if (i != 1 && this.k == 3) {
            O(i);
        } else {
            O(1);
        }
    }

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

    @Override // o.InterfaceC1178fE
    public final void b() {
        this.d.setRotationX(0.0f);
    }

    @Override // o.InterfaceC1178fE
    public final void c(float f) {
        this.l = f;
        this.d.setAlpha(f);
    }

    @Override // o.InterfaceC1178fE
    public final void d(InterfaceC2281qr interfaceC2281qr, EnumC1280gK enumC1280gK, C1082eE c1082eE, C2769w c2769w) {
        Canvas canvasStart = this.d.start(Math.max((int) (this.e >> 32), (int) (this.i >> 32)), Math.max((int) (this.e & 4294967295L), (int) (this.i & 4294967295L)));
        try {
            T2 t2 = this.b.a;
            Canvas canvas = t2.a;
            t2.a = canvasStart;
            C3113zg c3113zg = this.c;
            C3126zm0 c3126zm0 = c3113zg.m;
            long jO = C1884mi0.O(this.e);
            C3018yg c3018yg = ((C3113zg) c3126zm0.f831o).l;
            InterfaceC2281qr interfaceC2281qr2 = c3018yg.a;
            EnumC1280gK enumC1280gK2 = c3018yg.b;
            InterfaceC2923xg interfaceC2923xgX = c3126zm0.x();
            long jD = c3126zm0.D();
            C1082eE c1082eE2 = (C1082eE) c3126zm0.n;
            c3126zm0.R(interfaceC2281qr);
            c3126zm0.S(enumC1280gK);
            c3126zm0.Q(t2);
            c3126zm0.T(jO);
            c3126zm0.n = c1082eE;
            t2.n();
            try {
                c2769w.g(c3113zg);
                t2.k();
                c3126zm0.R(interfaceC2281qr2);
                c3126zm0.S(enumC1280gK2);
                c3126zm0.Q(interfaceC2923xgX);
                c3126zm0.T(jD);
                c3126zm0.n = c1082eE2;
                t2.a = canvas;
                this.d.end(canvasStart);
            } catch (Throwable th) {
                t2.k();
                C3126zm0 c3126zm02 = c3113zg.m;
                c3126zm02.R(interfaceC2281qr2);
                c3126zm02.S(enumC1280gK2);
                c3126zm02.Q(interfaceC2923xgX);
                c3126zm02.T(jD);
                c3126zm02.n = c1082eE2;
                throw th;
            }
        } catch (Throwable th2) {
            this.d.end(canvasStart);
            throw th2;
        }
    }

    @Override // o.InterfaceC1178fE
    public final float e() {
        return this.n;
    }

    @Override // o.InterfaceC1178fE
    public final void f(float f) {
        this.p = f;
        this.d.setElevation(f);
    }

    @Override // o.InterfaceC1178fE
    public final float g() {
        return 0.0f;
    }

    @Override // o.InterfaceC1178fE
    public final void h() {
        this.d.setTranslationY(0.0f);
    }

    @Override // o.InterfaceC1178fE
    public final void i() {
        this.d.setRotationY(0.0f);
    }

    @Override // o.InterfaceC1178fE
    public final long j() {
        return this.r;
    }

    @Override // o.InterfaceC1178fE
    public final void k(long j) {
        if (Build.VERSION.SDK_INT >= 28) {
            this.q = j;
            AbstractC0968d20.c(this.d, AbstractC0752ap.g0(j));
        }
    }

    @Override // o.InterfaceC1178fE
    public final void l(Outline outline, long j) {
        this.i = j;
        this.d.setOutline(outline);
        this.h = outline != null;
        N();
    }

    @Override // o.InterfaceC1178fE
    public final void m() {
        P();
    }

    @Override // o.InterfaceC1178fE
    public final void n(float f) {
        this.n = f;
        this.d.setScaleX(f);
    }

    @Override // o.InterfaceC1178fE
    public final void o(int i) {
        if (this.k == i) {
            return;
        }
        this.k = i;
        Paint paint = this.f;
        if (paint == null) {
            paint = new Paint();
            this.f = paint;
        }
        paint.setXfermode(new PorterDuffXfermode(AbstractC1692kh0.R(i)));
        P();
    }

    @Override // o.InterfaceC1178fE
    public final float p() {
        return this.s;
    }

    @Override // o.InterfaceC1178fE
    public final void q() {
        AbstractC0872c20.a(this.d);
    }

    @Override // o.InterfaceC1178fE
    public final float r() {
        return 0.0f;
    }

    @Override // o.InterfaceC1178fE
    public final void s() {
        this.d.setTranslationX(0.0f);
    }

    @Override // o.InterfaceC1178fE
    public final void t(boolean z) {
        this.t = z;
        N();
    }

    @Override // o.InterfaceC1178fE
    public final int u() {
        return this.j;
    }

    @Override // o.InterfaceC1178fE
    public final float v() {
        return 0.0f;
    }

    @Override // o.InterfaceC1178fE
    public final C0444Rd w() {
        return null;
    }

    @Override // o.InterfaceC1178fE
    public final void x(int i) {
        this.j = i;
        P();
    }

    @Override // o.InterfaceC1178fE
    public final void y() {
        this.d.setRotation(0.0f);
    }

    @Override // o.InterfaceC1178fE
    public final void z(long j) {
        if (Build.VERSION.SDK_INT >= 28) {
            this.r = j;
            AbstractC0968d20.d(this.d, AbstractC0752ap.g0(j));
        }
    }
}
