package androidx.compose.ui.platform;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.RecordingCanvas;
import android.graphics.RenderNode;
import android.os.Build;
import androidx.compose.ui.graphics.a;

/* loaded from: classes.dex */
public final class h2 implements f1 {

    /* renamed from: a, reason: collision with root package name */
    private final r f2448a;

    /* renamed from: b, reason: collision with root package name */
    private final RenderNode f2449b = new RenderNode("Compose");

    /* renamed from: c, reason: collision with root package name */
    private int f2450c = androidx.compose.ui.graphics.a.f2231a.a();

    public h2(r rVar) {
        this.f2448a = rVar;
    }

    @Override // androidx.compose.ui.platform.f1
    public void A(Outline outline) {
        this.f2449b.setOutline(outline);
    }

    @Override // androidx.compose.ui.platform.f1
    public boolean B() {
        return this.f2449b.getClipToBounds();
    }

    @Override // androidx.compose.ui.platform.f1
    public int C() {
        return this.f2449b.getTop();
    }

    @Override // androidx.compose.ui.platform.f1
    public void D(int i10) {
        this.f2449b.setAmbientShadowColor(i10);
    }

    @Override // androidx.compose.ui.platform.f1
    public boolean E() {
        return this.f2449b.getClipToOutline();
    }

    @Override // androidx.compose.ui.platform.f1
    public void F(boolean z10) {
        this.f2449b.setClipToOutline(z10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void G(s1.b0 b0Var, s1.f1 f1Var, dn.l lVar) {
        RecordingCanvas beginRecording = this.f2449b.beginRecording();
        Canvas b10 = b0Var.a().b();
        b0Var.a().z(beginRecording);
        s1.b a10 = b0Var.a();
        if (f1Var != null) {
            a10.n();
            s1.a0.w(a10, f1Var, 0, 2, null);
        }
        lVar.invoke(a10);
        if (f1Var != null) {
            a10.x();
        }
        b0Var.a().z(b10);
        this.f2449b.endRecording();
    }

    @Override // androidx.compose.ui.platform.f1
    public boolean H(boolean z10) {
        return this.f2449b.setHasOverlappingRendering(z10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void I(int i10) {
        this.f2449b.setSpotShadowColor(i10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void J(Matrix matrix) {
        this.f2449b.getMatrix(matrix);
    }

    @Override // androidx.compose.ui.platform.f1
    public float K() {
        return this.f2449b.getElevation();
    }

    @Override // androidx.compose.ui.platform.f1
    public void a(float f10) {
        this.f2449b.setAlpha(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public float b() {
        return this.f2449b.getAlpha();
    }

    @Override // androidx.compose.ui.platform.f1
    public void c(float f10) {
        this.f2449b.setRotationY(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void d(float f10) {
        this.f2449b.setRotationZ(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void e(float f10) {
        this.f2449b.setTranslationY(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void f(float f10) {
        this.f2449b.setScaleY(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public int g() {
        return this.f2449b.getLeft();
    }

    @Override // androidx.compose.ui.platform.f1
    public int getHeight() {
        return this.f2449b.getHeight();
    }

    @Override // androidx.compose.ui.platform.f1
    public int getWidth() {
        return this.f2449b.getWidth();
    }

    @Override // androidx.compose.ui.platform.f1
    public void h() {
        this.f2449b.discardDisplayList();
    }

    @Override // androidx.compose.ui.platform.f1
    public void i(float f10) {
        this.f2449b.setScaleX(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void j(float f10) {
        this.f2449b.setTranslationX(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void k(s1.m1 m1Var) {
        if (Build.VERSION.SDK_INT >= 31) {
            i2.f2457a.a(this.f2449b, m1Var);
        }
    }

    @Override // androidx.compose.ui.platform.f1
    public void l(float f10) {
        this.f2449b.setCameraDistance(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void m(float f10) {
        this.f2449b.setRotationX(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public int n() {
        return this.f2449b.getRight();
    }

    @Override // androidx.compose.ui.platform.f1
    public boolean p() {
        return this.f2449b.hasDisplayList();
    }

    @Override // androidx.compose.ui.platform.f1
    public void q(int i10) {
        this.f2449b.offsetLeftAndRight(i10);
    }

    @Override // androidx.compose.ui.platform.f1
    public int r() {
        return this.f2449b.getBottom();
    }

    @Override // androidx.compose.ui.platform.f1
    public void s(Canvas canvas) {
        canvas.drawRenderNode(this.f2449b);
    }

    @Override // androidx.compose.ui.platform.f1
    public void t(int i10) {
        RenderNode renderNode = this.f2449b;
        a.C0062a c0062a = androidx.compose.ui.graphics.a.f2231a;
        if (androidx.compose.ui.graphics.a.e(i10, c0062a.c())) {
            renderNode.setUseCompositingLayer(true, null);
            renderNode.setHasOverlappingRendering(true);
        } else if (androidx.compose.ui.graphics.a.e(i10, c0062a.b())) {
            renderNode.setUseCompositingLayer(false, null);
            renderNode.setHasOverlappingRendering(false);
        } else {
            renderNode.setUseCompositingLayer(false, null);
            renderNode.setHasOverlappingRendering(true);
        }
        this.f2450c = i10;
    }

    @Override // androidx.compose.ui.platform.f1
    public void u(float f10) {
        this.f2449b.setPivotX(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void v(boolean z10) {
        this.f2449b.setClipToBounds(z10);
    }

    @Override // androidx.compose.ui.platform.f1
    public boolean w(int i10, int i11, int i12, int i13) {
        return this.f2449b.setPosition(i10, i11, i12, i13);
    }

    @Override // androidx.compose.ui.platform.f1
    public void x(float f10) {
        this.f2449b.setPivotY(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void y(float f10) {
        this.f2449b.setElevation(f10);
    }

    @Override // androidx.compose.ui.platform.f1
    public void z(int i10) {
        this.f2449b.offsetTopAndBottom(i10);
    }
}
