package defpackage;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PorterDuff;
import android.graphics.Shader;
import java.util.ArrayList;

/* JADX INFO: renamed from: ᵛᵤᵸ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2802 {

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public static final Matrix f10752 = new Matrix();

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final Path f10753;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public float f10754;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public Boolean f10755;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final Matrix f10756;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public String f10757;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public Paint f10758;

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public final C3310 f10759;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public int f10760;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public float f10761;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final Path f10762;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final C3739 f10763;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public float f10764;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public Paint f10765;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public float f10766;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public PathMeasure f10767;

    public C2802() {
        this.f10756 = new Matrix();
        this.f10754 = 0.0f;
        this.f10766 = 0.0f;
        this.f10761 = 0.0f;
        this.f10764 = 0.0f;
        this.f10760 = 255;
        this.f10757 = null;
        this.f10755 = null;
        this.f10759 = new C3310(0);
        this.f10763 = new C3739();
        this.f10762 = new Path();
        this.f10753 = new Path();
    }

    public C2802(C2802 c2802) {
        this.f10756 = new Matrix();
        this.f10754 = 0.0f;
        this.f10766 = 0.0f;
        this.f10761 = 0.0f;
        this.f10764 = 0.0f;
        this.f10760 = 255;
        this.f10757 = null;
        this.f10755 = null;
        C3310 c3310 = new C3310(0);
        this.f10759 = c3310;
        this.f10763 = new C3739(c2802.f10763, c3310);
        this.f10762 = new Path(c2802.f10762);
        this.f10753 = new Path(c2802.f10753);
        this.f10754 = c2802.f10754;
        this.f10766 = c2802.f10766;
        this.f10761 = c2802.f10761;
        this.f10764 = c2802.f10764;
        this.f10760 = c2802.f10760;
        this.f10757 = c2802.f10757;
        String str = c2802.f10757;
        if (str != null) {
            c3310.put(str, this);
        }
        this.f10755 = c2802.f10755;
    }

    public float getAlpha() {
        return getRootAlpha() / 255.0f;
    }

    public int getRootAlpha() {
        return this.f10760;
    }

    public void setAlpha(float f) {
        setRootAlpha((int) (f * 255.0f));
    }

    public void setRootAlpha(int i) {
        this.f10760 = i;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m6782(C3739 c3739, Matrix matrix, Canvas canvas, int i, int i2) {
        int i3;
        float f;
        int i4;
        float f2;
        Matrix matrix2 = c3739.f14191;
        ArrayList arrayList = c3739.f14186;
        matrix2.set(matrix);
        Matrix matrix3 = c3739.f14191;
        matrix3.preConcat(c3739.f14190);
        canvas.save();
        char c = 0;
        int i5 = 0;
        while (i5 < arrayList.size()) {
            AbstractC1525 abstractC1525 = (AbstractC1525) arrayList.get(i5);
            if (abstractC1525 instanceof C3739) {
                m6782((C3739) abstractC1525, matrix3, canvas, i, i2);
            } else if (abstractC1525 instanceof AbstractC4829) {
                AbstractC4829 abstractC4829 = (AbstractC4829) abstractC1525;
                float f3 = i / this.f10761;
                float f4 = i2 / this.f10764;
                float fMin = Math.min(f3, f4);
                Matrix matrix4 = this.f10756;
                matrix4.set(matrix3);
                matrix4.postScale(f3, f4);
                float[] fArr = {0.0f, 1.0f, 1.0f, 0.0f};
                matrix3.mapVectors(fArr);
                float fHypot = (float) Math.hypot(fArr[c], fArr[1]);
                boolean z = c;
                i3 = i5;
                float fHypot2 = (float) Math.hypot(fArr[2], fArr[3]);
                float f5 = (fArr[z ? 1 : 0] * fArr[3]) - (fArr[1] * fArr[2]);
                float fMax = Math.max(fHypot, fHypot2);
                float fAbs = fMax > 0.0f ? Math.abs(f5) / fMax : 0.0f;
                if (fAbs != 0.0f) {
                    Path path = this.f10762;
                    path.reset();
                    C1385[] c1385Arr = abstractC4829.f18410;
                    if (c1385Arr != null) {
                        C1385.m3962(c1385Arr, path);
                    }
                    Path path2 = this.f10753;
                    path2.reset();
                    if (abstractC4829 instanceof C0039) {
                        path2.setFillType(abstractC4829.f18409 == 0 ? Path.FillType.WINDING : Path.FillType.EVEN_ODD);
                        path2.addPath(path, matrix4);
                        canvas.clipPath(path2);
                    } else {
                        C3861 c3861 = (C3861) abstractC4829;
                        float f6 = c3861.f14757;
                        if (f6 != 0.0f || c3861.f14753 != 1.0f) {
                            float f7 = c3861.f14755;
                            float f8 = (f6 + f7) % 1.0f;
                            float f9 = (c3861.f14753 + f7) % 1.0f;
                            if (this.f10767 == null) {
                                this.f10767 = new PathMeasure();
                            }
                            this.f10767.setPath(path, z);
                            float length = this.f10767.getLength();
                            float f10 = f8 * length;
                            float f11 = f9 * length;
                            path.reset();
                            PathMeasure pathMeasure = this.f10767;
                            if (f10 > f11) {
                                pathMeasure.getSegment(f10, length, path, true);
                                f = 0.0f;
                                this.f10767.getSegment(0.0f, f11, path, true);
                            } else {
                                f = 0.0f;
                                pathMeasure.getSegment(f10, f11, path, true);
                            }
                            path.rLineTo(f, f);
                        }
                        path2.addPath(path, matrix4);
                        C1404 c1404 = c3861.f14758;
                        if (((Shader) c1404.f5807) == null && c1404.f5808 == 0) {
                            f2 = 255.0f;
                            i4 = 16777215;
                        } else {
                            if (this.f10758 == null) {
                                i4 = 16777215;
                                Paint paint = new Paint(1);
                                this.f10758 = paint;
                                paint.setStyle(Paint.Style.FILL);
                            } else {
                                i4 = 16777215;
                            }
                            Paint paint2 = this.f10758;
                            Shader shader = (Shader) c1404.f5807;
                            if (shader != null) {
                                shader.setLocalMatrix(matrix4);
                                paint2.setShader(shader);
                                paint2.setAlpha(Math.round(c3861.f14748 * 255.0f));
                                f2 = 255.0f;
                            } else {
                                paint2.setShader(null);
                                paint2.setAlpha(255);
                                int i6 = c1404.f5808;
                                float f12 = c3861.f14748;
                                PorterDuff.Mode mode = C1235.f5200;
                                f2 = 255.0f;
                                paint2.setColor((i6 & i4) | (((int) (Color.alpha(i6) * f12)) << 24));
                            }
                            paint2.setColorFilter(null);
                            path2.setFillType(c3861.f18409 == 0 ? Path.FillType.WINDING : Path.FillType.EVEN_ODD);
                            canvas.drawPath(path2, paint2);
                        }
                        C1404 c14042 = c3861.f14756;
                        if (((Shader) c14042.f5807) != null || c14042.f5808 != 0) {
                            if (this.f10765 == null) {
                                Paint paint3 = new Paint(1);
                                this.f10765 = paint3;
                                paint3.setStyle(Paint.Style.STROKE);
                            }
                            Paint paint4 = this.f10765;
                            Paint.Join join = c3861.f14750;
                            if (join != null) {
                                paint4.setStrokeJoin(join);
                            }
                            Paint.Cap cap = c3861.f14752;
                            if (cap != null) {
                                paint4.setStrokeCap(cap);
                            }
                            paint4.setStrokeMiter(c3861.f14749);
                            Shader shader2 = (Shader) c14042.f5807;
                            if (shader2 != null) {
                                shader2.setLocalMatrix(matrix4);
                                paint4.setShader(shader2);
                                paint4.setAlpha(Math.round(c3861.f14754 * f2));
                            } else {
                                paint4.setShader(null);
                                paint4.setAlpha(255);
                                int i7 = c14042.f5808;
                                float f13 = c3861.f14754;
                                PorterDuff.Mode mode2 = C1235.f5200;
                                paint4.setColor((i7 & i4) | (((int) (Color.alpha(i7) * f13)) << 24));
                            }
                            paint4.setColorFilter(null);
                            paint4.setStrokeWidth(c3861.f14751 * fMin * fAbs);
                            canvas.drawPath(path2, paint4);
                        }
                    }
                }
                i5 = i3 + 1;
                c = 0;
            }
            i3 = i5;
            i5 = i3 + 1;
            c = 0;
        }
        canvas.restore();
    }
}
