package o;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Region;
import java.lang.reflect.InvocationTargetException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class T2 implements InterfaceC2923xg {
    public Canvas a = U2.a;
    public Rect b;
    public Rect c;

    @Override // o.InterfaceC2923xg
    public final void a(float f, float f2, float f3, float f4, float f5, float f6, Ew0 ew0) {
        this.a.drawArc(f, f2, f3, f4, f5, f6, false, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void b(C2493t4 c2493t4, Ew0 ew0) {
        this.a.drawBitmap(C1884mi0.k(c2493t4), Float.intBitsToFloat((int) 0), Float.intBitsToFloat((int) 0), (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void c(float f, long j, Ew0 ew0) {
        this.a.drawCircle(Float.intBitsToFloat((int) (j >> 32)), Float.intBitsToFloat((int) (j & 4294967295L)), f, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void d(float f, float f2) {
        this.a.scale(f, f2);
    }

    @Override // o.InterfaceC2923xg
    public final void e(float f) {
        this.a.rotate(f);
    }

    @Override // o.InterfaceC2923xg
    public final void g(long j, long j2, Ew0 ew0) {
        this.a.drawLine(Float.intBitsToFloat((int) (j >> 32)), Float.intBitsToFloat((int) (j & 4294967295L)), Float.intBitsToFloat((int) (j2 >> 32)), Float.intBitsToFloat((int) (j2 & 4294967295L)), (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void h(O4 o4, Ew0 ew0) {
        Canvas canvas = this.a;
        if (!(o4 instanceof O4)) {
            throw new UnsupportedOperationException("Unable to obtain android.graphics.Path");
        }
        canvas.drawPath(o4.a, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void i(float f, float f2, float f3, float f4, int i) {
        this.a.clipRect(f, f2, f3, f4, i == 0 ? Region.Op.DIFFERENCE : Region.Op.INTERSECT);
    }

    @Override // o.InterfaceC2923xg
    public final void j(float f, float f2) {
        this.a.translate(f, f2);
    }

    @Override // o.InterfaceC2923xg
    public final void k() {
        this.a.restore();
    }

    @Override // o.InterfaceC2923xg
    public final void l(float f, float f2, float f3, float f4, Ew0 ew0) {
        this.a.drawRect(f, f2, f3, f4, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void m(C2493t4 c2493t4, long j, long j2, long j3, Ew0 ew0) {
        if (this.b == null) {
            this.b = new Rect();
            this.c = new Rect();
        }
        Canvas canvas = this.a;
        Bitmap bitmapK = C1884mi0.k(c2493t4);
        Rect rect = this.b;
        int i = (int) (j >> 32);
        rect.left = i;
        int i2 = (int) (j & 4294967295L);
        rect.top = i2;
        rect.right = i + ((int) (j2 >> 32));
        rect.bottom = i2 + ((int) (j2 & 4294967295L));
        Rect rect2 = this.c;
        int i3 = (int) 0;
        rect2.left = i3;
        int i4 = (int) 0;
        rect2.top = i4;
        rect2.right = i3 + ((int) (j3 >> 32));
        rect2.bottom = i4 + ((int) (4294967295L & j3));
        canvas.drawBitmap(bitmapK, rect, rect2, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void n() {
        this.a.save();
    }

    @Override // o.InterfaceC2923xg
    public final void o(O4 o4) {
        Canvas canvas = this.a;
        if (!(o4 instanceof O4)) {
            throw new UnsupportedOperationException("Unable to obtain android.graphics.Path");
        }
        canvas.clipPath(o4.a, Region.Op.INTERSECT);
    }

    @Override // o.InterfaceC2923xg
    public final void p() throws IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
        IJ.l(this.a, false);
    }

    @Override // o.InterfaceC2923xg
    public final void q(float f, float f2, float f3, float f4, float f5, float f6, Ew0 ew0) {
        this.a.drawRoundRect(f, f2, f3, f4, f5, f6, (Paint) ew0.b);
    }

    @Override // o.InterfaceC2923xg
    public final void r(T00 t00, Ew0 ew0) {
        this.a.saveLayer(t00.a, t00.b, t00.c, t00.d, (Paint) ew0.b, 31);
    }

    @Override // o.InterfaceC2923xg
    public final void s(float[] fArr) {
        if (AbstractC1904ms0.o(fArr)) {
            return;
        }
        Matrix matrix = new Matrix();
        F3.P(matrix, fArr);
        this.a.concat(matrix);
    }

    @Override // o.InterfaceC2923xg
    public final void t() throws IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
        IJ.l(this.a, true);
    }
}
