Rabbit-R1/switch port/java/sources/androidx/compose/foundation/CanvasKt.java
2024-05-21 17:08:36 -04:00

153 lines
8.5 KiB
Java

package androidx.compose.foundation;
import androidx.compose.foundation.layout.SpacerKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.draw.DrawModifierKt;
import androidx.compose.ui.graphics.drawscope.DrawScope;
import androidx.compose.ui.semantics.SemanticsModifierKt;
import androidx.compose.ui.semantics.SemanticsPropertiesKt;
import androidx.compose.ui.semantics.SemanticsPropertyReceiver;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Canvas.kt */
@Metadata(d1 = {"\u0000&\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a.\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0017\u0010\u0004\u001a\u0013\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00010\u0005¢\u0006\u0002\b\u0007H\u0007¢\u0006\u0002\u0010\b\u001a6\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\n2\u0017\u0010\u0004\u001a\u0013\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00010\u0005¢\u0006\u0002\b\u0007H\u0007¢\u0006\u0002\u0010\u000b¨\u0006\f"}, d2 = {"Canvas", "", "modifier", "Landroidx/compose/ui/Modifier;", "onDraw", "Lkotlin/Function1;", "Landroidx/compose/ui/graphics/drawscope/DrawScope;", "Lkotlin/ExtensionFunctionType;", "(Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;I)V", "contentDescription", "", "(Landroidx/compose/ui/Modifier;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;I)V", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class CanvasKt {
public static final void Canvas(final Modifier modifier, final Function1<? super DrawScope, Unit> onDraw, Composer composer, final int i) {
int i2;
Intrinsics.checkNotNullParameter(modifier, "modifier");
Intrinsics.checkNotNullParameter(onDraw, "onDraw");
Composer startRestartGroup = composer.startRestartGroup(-932836462);
ComposerKt.sourceInformation(startRestartGroup, "C(Canvas)42@1876L35:Canvas.kt#71ulvw");
if ((i & 14) == 0) {
i2 = (startRestartGroup.changed(modifier) ? 4 : 2) | i;
} else {
i2 = i;
}
if ((i & 112) == 0) {
i2 |= startRestartGroup.changedInstance(onDraw) ? 32 : 16;
}
if ((i2 & 91) == 18 && startRestartGroup.getSkipping()) {
startRestartGroup.skipToGroupEnd();
} else {
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-932836462, i, -1, "androidx.compose.foundation.Canvas (Canvas.kt:41)");
}
SpacerKt.Spacer(DrawModifierKt.drawBehind(modifier, onDraw), startRestartGroup, 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.CanvasKt$Canvas$1
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(2);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Unit invoke(Composer composer2, Integer num) {
invoke(composer2, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(Composer composer2, int i3) {
CanvasKt.Canvas(Modifier.this, onDraw, composer2, RecomposeScopeImplKt.updateChangedFlags(i | 1));
}
});
}
public static final void Canvas(final Modifier modifier, final String contentDescription, final Function1<? super DrawScope, Unit> onDraw, Composer composer, final int i) {
int i2;
Intrinsics.checkNotNullParameter(modifier, "modifier");
Intrinsics.checkNotNullParameter(contentDescription, "contentDescription");
Intrinsics.checkNotNullParameter(onDraw, "onDraw");
Composer startRestartGroup = composer.startRestartGroup(-1162737955);
ComposerKt.sourceInformation(startRestartGroup, "C(Canvas)P(1)64@3203L48,64@3158L94:Canvas.kt#71ulvw");
if ((i & 14) == 0) {
i2 = (startRestartGroup.changed(modifier) ? 4 : 2) | i;
} else {
i2 = i;
}
if ((i & 112) == 0) {
i2 |= startRestartGroup.changed(contentDescription) ? 32 : 16;
}
if ((i & 896) == 0) {
i2 |= startRestartGroup.changedInstance(onDraw) ? 256 : 128;
}
if ((i2 & 731) == 146 && startRestartGroup.getSkipping()) {
startRestartGroup.skipToGroupEnd();
} else {
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1162737955, i2, -1, "androidx.compose.foundation.Canvas (Canvas.kt:63)");
}
Modifier drawBehind = DrawModifierKt.drawBehind(modifier, onDraw);
startRestartGroup.startReplaceableGroup(1157296644);
ComposerKt.sourceInformation(startRestartGroup, "CC(remember)P(1):Composables.kt#9igjgp");
boolean changed = startRestartGroup.changed(contentDescription);
Object rememberedValue = startRestartGroup.rememberedValue();
if (changed || rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = (Function1) new Function1<SemanticsPropertyReceiver, Unit>() { // from class: androidx.compose.foundation.CanvasKt$Canvas$2$1
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
super(1);
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(SemanticsPropertyReceiver semanticsPropertyReceiver) {
invoke2(semanticsPropertyReceiver);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(SemanticsPropertyReceiver semantics) {
Intrinsics.checkNotNullParameter(semantics, "$this$semantics");
SemanticsPropertiesKt.setContentDescription(semantics, contentDescription);
}
};
startRestartGroup.updateRememberedValue(rememberedValue);
}
startRestartGroup.endReplaceableGroup();
SpacerKt.Spacer(SemanticsModifierKt.semantics$default(drawBehind, false, (Function1) rememberedValue, 1, null), startRestartGroup, 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.CanvasKt$Canvas$3
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
/* JADX WARN: Multi-variable type inference failed */
{
super(2);
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Unit invoke(Composer composer2, Integer num) {
invoke(composer2, num.intValue());
return Unit.INSTANCE;
}
public final void invoke(Composer composer2, int i3) {
CanvasKt.Canvas(Modifier.this, contentDescription, onDraw, composer2, RecomposeScopeImplKt.updateChangedFlags(i | 1));
}
});
}
}