package androidx.emoji2.text;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
import p041n0.C1494a;

/* renamed from: androidx.emoji2.text.i */
/* loaded from: classes.dex */
public class C0241i {

    /* renamed from: d */
    public static final ThreadLocal<C1494a> f1101d = new ThreadLocal<>();

    /* renamed from: a */
    public final int f1102a;

    /* renamed from: b */
    public final C0255p f1103b;

    /* renamed from: c */
    public volatile int f1104c = 0;

    public C0241i(C0255p c0255p, int i) {
        this.f1103b = c0255p;
        this.f1102a = i;
    }

    /* renamed from: a */
    public void m4372a(Canvas canvas, float f, float f2, Paint paint) {
        Typeface m4316g = this.f1103b.m4316g();
        Typeface typeface = paint.getTypeface();
        paint.setTypeface(m4316g);
        canvas.drawText(this.f1103b.m4320c(), this.f1102a * 2, 2, f, f2, paint);
        paint.setTypeface(typeface);
    }

    /* renamed from: b */
    public int m4371b(int i) {
        return m4366g().m1169h(i);
    }

    /* renamed from: c */
    public int m4370c() {
        return m4366g().m1168i();
    }

    /* renamed from: d */
    public int m4369d() {
        return this.f1104c;
    }

    /* renamed from: e */
    public short m4368e() {
        return m4366g().m1166k();
    }

    /* renamed from: f */
    public int m4367f() {
        return m4366g().m1165l();
    }

    /* renamed from: g */
    public final C1494a m4366g() {
        ThreadLocal<C1494a> threadLocal = f1101d;
        C1494a c1494a = threadLocal.get();
        if (c1494a == null) {
            c1494a = new C1494a();
            threadLocal.set(c1494a);
        }
        this.f1103b.m4319d().m1158j(c1494a, this.f1102a);
        return c1494a;
    }

    /* renamed from: h */
    public short m4365h() {
        return m4366g().m1164m();
    }

    /* renamed from: i */
    public short m4364i() {
        return m4366g().m1163n();
    }

    /* renamed from: j */
    public boolean m4363j() {
        return m4366g().m1167j();
    }

    /* renamed from: k */
    public void m4362k(boolean z) {
        this.f1104c = z ? 2 : 1;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(super.toString());
        sb.append(", id:");
        sb.append(Integer.toHexString(m4367f()));
        sb.append(", codepoints:");
        int m4370c = m4370c();
        for (int i = 0; i < m4370c; i++) {
            sb.append(Integer.toHexString(m4371b(i)));
            sb.append(" ");
        }
        return sb.toString();
    }
}