Rabbit-R1/original r1/java/sources/androidx/compose/foundation/ImageKt.java
2024-05-21 17:08:36 -04:00

256 lines
19 KiB
Java

package androidx.compose.foundation;
import androidx.compose.runtime.Applier;
import androidx.compose.runtime.ComposablesKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.CompositionLocalMap;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.SkippableUpdater;
import androidx.compose.runtime.Updater;
import androidx.compose.ui.Alignment;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.draw.ClipKt;
import androidx.compose.ui.draw.PainterModifierKt;
import androidx.compose.ui.graphics.ColorFilter;
import androidx.compose.ui.graphics.FilterQuality;
import androidx.compose.ui.graphics.ImageBitmap;
import androidx.compose.ui.graphics.drawscope.DrawScope;
import androidx.compose.ui.graphics.painter.BitmapPainter;
import androidx.compose.ui.graphics.painter.BitmapPainterKt;
import androidx.compose.ui.graphics.painter.Painter;
import androidx.compose.ui.graphics.vector.ImageVector;
import androidx.compose.ui.graphics.vector.VectorPainter;
import androidx.compose.ui.graphics.vector.VectorPainterKt;
import androidx.compose.ui.layout.ContentScale;
import androidx.compose.ui.layout.LayoutKt;
import androidx.compose.ui.layout.Measurable;
import androidx.compose.ui.layout.MeasurePolicy;
import androidx.compose.ui.layout.MeasureResult;
import androidx.compose.ui.layout.MeasureScope;
import androidx.compose.ui.layout.Placeable;
import androidx.compose.ui.node.ComposeUiNode;
import androidx.compose.ui.semantics.Role;
import androidx.compose.ui.semantics.SemanticsModifierKt;
import androidx.compose.ui.semantics.SemanticsPropertiesKt;
import androidx.compose.ui.semantics.SemanticsPropertyReceiver;
import androidx.compose.ui.unit.Constraints;
import io.sentry.protocol.ViewHierarchyNode;
import java.util.List;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.functions.Function3;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Image.kt */
@Metadata(d1 = {"\u0000L\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001aS\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\b\b\u0002\u0010\f\u001a\u00020\r2\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0007¢\u0006\u0002\u0010\u0010\u001ae\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\b\b\u0002\u0010\f\u001a\u00020\r2\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\u000f2\b\b\u0002\u0010\u0011\u001a\u00020\u0012H\u0007ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0013\u0010\u0014\u001aS\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0015\u001a\u00020\u00162\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\b\b\u0002\u0010\f\u001a\u00020\r2\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0007¢\u0006\u0002\u0010\u0017\u001aS\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0018\u001a\u00020\u00192\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u000b2\b\b\u0002\u0010\f\u001a\u00020\r2\n\b\u0002\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0007¢\u0006\u0002\u0010\u001a\u0082\u0002\u000b\n\u0005\\u001e0\u0001\n\u0002\b\u0019¨\u0006\u001b"}, d2 = {"Image", "", "bitmap", "Landroidx/compose/ui/graphics/ImageBitmap;", "contentDescription", "", "modifier", "Landroidx/compose/ui/Modifier;", "alignment", "Landroidx/compose/ui/Alignment;", "contentScale", "Landroidx/compose/ui/layout/ContentScale;", ViewHierarchyNode.JsonKeys.ALPHA, "", "colorFilter", "Landroidx/compose/ui/graphics/ColorFilter;", "(Landroidx/compose/ui/graphics/ImageBitmap;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;FLandroidx/compose/ui/graphics/ColorFilter;Landroidx/compose/runtime/Composer;II)V", "filterQuality", "Landroidx/compose/ui/graphics/FilterQuality;", "Image-5h-nEew", "(Landroidx/compose/ui/graphics/ImageBitmap;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;FLandroidx/compose/ui/graphics/ColorFilter;ILandroidx/compose/runtime/Composer;II)V", "painter", "Landroidx/compose/ui/graphics/painter/Painter;", "(Landroidx/compose/ui/graphics/painter/Painter;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;FLandroidx/compose/ui/graphics/ColorFilter;Landroidx/compose/runtime/Composer;II)V", "imageVector", "Landroidx/compose/ui/graphics/vector/ImageVector;", "(Landroidx/compose/ui/graphics/vector/ImageVector;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;FLandroidx/compose/ui/graphics/ColorFilter;Landroidx/compose/runtime/Composer;II)V", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class ImageKt {
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Consider usage of the Image composable that consumes an optional FilterQuality parameter", replaceWith = @ReplaceWith(expression = "Image(bitmap, contentDescription, modifier, alignment, contentScale, alpha, colorFilter, DefaultFilterQuality)", imports = {"androidx.compose.foundation", "androidx.compose.ui.graphics.DefaultAlpha", "androidx.compose.ui.Alignment", "androidx.compose.ui.graphics.drawscope.DrawScope.Companion.DefaultFilterQuality", "androidx.compose.ui.layout.ContentScale.Fit"}))
public static final /* synthetic */ void Image(ImageBitmap bitmap, String str, Modifier modifier, Alignment alignment, ContentScale contentScale, float f, ColorFilter colorFilter, Composer composer, int i, int i2) {
Intrinsics.checkNotNullParameter(bitmap, "bitmap");
composer.startReplaceableGroup(-2123228673);
ComposerKt.sourceInformation(composer, "C(Image)P(2,4,6!1,5)96@4585L177:Image.kt#71ulvw");
Modifier.Companion companion = (i2 & 4) != 0 ? Modifier.INSTANCE : modifier;
Alignment center = (i2 & 8) != 0 ? Alignment.INSTANCE.getCenter() : alignment;
ContentScale fit = (i2 & 16) != 0 ? ContentScale.INSTANCE.getFit() : contentScale;
float f2 = (i2 & 32) != 0 ? 1.0f : f;
ColorFilter colorFilter2 = (i2 & 64) != 0 ? null : colorFilter;
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-2123228673, i, -1, "androidx.compose.foundation.Image (Image.kt:87)");
}
m224Image5hnEew(bitmap, str, companion, center, fit, f2, colorFilter2, FilterQuality.INSTANCE.m2735getLowfv9h1I(), composer, (i & 112) | 8 | (i & 896) | (i & 7168) | (57344 & i) | (458752 & i) | (i & 3670016), 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
}
/* renamed from: Image-5h-nEew, reason: not valid java name */
public static final void m224Image5hnEew(ImageBitmap bitmap, String str, Modifier modifier, Alignment alignment, ContentScale contentScale, float f, ColorFilter colorFilter, int i, Composer composer, int i2, int i3) {
Intrinsics.checkNotNullParameter(bitmap, "bitmap");
composer.startReplaceableGroup(-1396260732);
ComposerKt.sourceInformation(composer, "C(Image)P(2,4,7!1,5!,6:c#ui.graphics.FilterQuality)153@7224L73,154@7302L248:Image.kt#71ulvw");
Modifier modifier2 = (i3 & 4) != 0 ? Modifier.INSTANCE : modifier;
Alignment center = (i3 & 8) != 0 ? Alignment.INSTANCE.getCenter() : alignment;
ContentScale fit = (i3 & 16) != 0 ? ContentScale.INSTANCE.getFit() : contentScale;
float f2 = (i3 & 32) != 0 ? 1.0f : f;
ColorFilter colorFilter2 = (i3 & 64) != 0 ? null : colorFilter;
int m3184getDefaultFilterQualityfv9h1I = (i3 & 128) != 0 ? DrawScope.INSTANCE.m3184getDefaultFilterQualityfv9h1I() : i;
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(-1396260732, i2, -1, "androidx.compose.foundation.Image (Image.kt:143)");
}
composer.startReplaceableGroup(1157296644);
ComposerKt.sourceInformation(composer, "CC(remember)P(1):Composables.kt#9igjgp");
boolean changed = composer.changed(bitmap);
Object rememberedValue = composer.rememberedValue();
if (changed || rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = BitmapPainterKt.m3254BitmapPainterQZhYCtY$default(bitmap, 0L, 0L, m3184getDefaultFilterQualityfv9h1I, 6, null);
composer.updateRememberedValue(rememberedValue);
}
composer.endReplaceableGroup();
Image((BitmapPainter) rememberedValue, str, modifier2, center, fit, f2, colorFilter2, composer, (i2 & 112) | 8 | (i2 & 896) | (i2 & 7168) | (57344 & i2) | (458752 & i2) | (3670016 & i2), 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
}
public static final void Image(ImageVector imageVector, String str, Modifier modifier, Alignment alignment, ContentScale contentScale, float f, ColorFilter colorFilter, Composer composer, int i, int i2) {
Intrinsics.checkNotNullParameter(imageVector, "imageVector");
composer.startReplaceableGroup(1595907091);
ComposerKt.sourceInformation(composer, "C(Image)P(5,3,6!1,4)198@9330L34,197@9309L237:Image.kt#71ulvw");
Modifier.Companion companion = (i2 & 4) != 0 ? Modifier.INSTANCE : modifier;
Alignment center = (i2 & 8) != 0 ? Alignment.INSTANCE.getCenter() : alignment;
ContentScale fit = (i2 & 16) != 0 ? ContentScale.INSTANCE.getFit() : contentScale;
float f2 = (i2 & 32) != 0 ? 1.0f : f;
ColorFilter colorFilter2 = (i2 & 64) != 0 ? null : colorFilter;
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(1595907091, i, -1, "androidx.compose.foundation.Image (Image.kt:189)");
}
Image(VectorPainterKt.rememberVectorPainter(imageVector, composer, i & 14), str, companion, center, fit, f2, colorFilter2, composer, VectorPainter.$stable | (i & 112) | (i & 896) | (i & 7168) | (57344 & i) | (458752 & i) | (i & 3670016), 0);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
composer.endReplaceableGroup();
}
public static final void Image(final Painter painter, final String str, Modifier modifier, Alignment alignment, ContentScale contentScale, float f, ColorFilter colorFilter, Composer composer, final int i, final int i2) {
Modifier.Companion companion;
Intrinsics.checkNotNullParameter(painter, "painter");
Composer startRestartGroup = composer.startRestartGroup(1142754848);
ComposerKt.sourceInformation(startRestartGroup, "C(Image)P(6,3,5!1,4)255@11931L341:Image.kt#71ulvw");
Modifier modifier2 = (i2 & 4) != 0 ? Modifier.INSTANCE : modifier;
Alignment center = (i2 & 8) != 0 ? Alignment.INSTANCE.getCenter() : alignment;
ContentScale fit = (i2 & 16) != 0 ? ContentScale.INSTANCE.getFit() : contentScale;
float f2 = (i2 & 32) != 0 ? 1.0f : f;
ColorFilter colorFilter2 = (i2 & 64) != 0 ? null : colorFilter;
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(1142754848, i, -1, "androidx.compose.foundation.Image (Image.kt:235)");
}
startRestartGroup.startReplaceableGroup(-816794123);
ComposerKt.sourceInformation(startRestartGroup, "245@11667L103");
if (str != null) {
Modifier.Companion companion2 = Modifier.INSTANCE;
startRestartGroup.startReplaceableGroup(1157296644);
ComposerKt.sourceInformation(startRestartGroup, "CC(remember)P(1):Composables.kt#9igjgp");
boolean changed = startRestartGroup.changed(str);
Object rememberedValue = startRestartGroup.rememberedValue();
if (changed || rememberedValue == Composer.INSTANCE.getEmpty()) {
rememberedValue = (Function1) new Function1<SemanticsPropertyReceiver, Unit>() { // from class: androidx.compose.foundation.ImageKt$Image$semantics$1$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, str);
SemanticsPropertiesKt.m4270setRolekuIjeqM(semantics, Role.INSTANCE.m4259getImageo7Vup1c());
}
};
startRestartGroup.updateRememberedValue(rememberedValue);
}
startRestartGroup.endReplaceableGroup();
companion = SemanticsModifierKt.semantics$default(companion2, false, (Function1) rememberedValue, 1, null);
} else {
companion = Modifier.INSTANCE;
}
startRestartGroup.endReplaceableGroup();
Modifier paint$default = PainterModifierKt.paint$default(ClipKt.clipToBounds(modifier2.then(companion)), painter, false, center, fit, f2, colorFilter2, 2, null);
ImageKt$Image$2 imageKt$Image$2 = new MeasurePolicy() { // from class: androidx.compose.foundation.ImageKt$Image$2
@Override // androidx.compose.ui.layout.MeasurePolicy
/* renamed from: measure-3p2s80s */
public final MeasureResult mo21measure3p2s80s(MeasureScope Layout, List<? extends Measurable> list, long j) {
Intrinsics.checkNotNullParameter(Layout, "$this$Layout");
Intrinsics.checkNotNullParameter(list, "<anonymous parameter 0>");
return MeasureScope.layout$default(Layout, Constraints.m4841getMinWidthimpl(j), Constraints.m4840getMinHeightimpl(j), null, new Function1<Placeable.PlacementScope, Unit>() { // from class: androidx.compose.foundation.ImageKt$Image$2$measure$1
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(Placeable.PlacementScope layout) {
Intrinsics.checkNotNullParameter(layout, "$this$layout");
}
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Placeable.PlacementScope placementScope) {
invoke2(placementScope);
return Unit.INSTANCE;
}
}, 4, null);
}
};
startRestartGroup.startReplaceableGroup(-1323940314);
ComposerKt.sourceInformation(startRestartGroup, "CC(Layout)P(!1,2)77@3132L23,79@3222L420:Layout.kt#80mrfh");
int currentCompositeKeyHash = ComposablesKt.getCurrentCompositeKeyHash(startRestartGroup, 0);
CompositionLocalMap currentCompositionLocalMap = startRestartGroup.getCurrentCompositionLocalMap();
Function0<ComposeUiNode> constructor = ComposeUiNode.INSTANCE.getConstructor();
Function3<SkippableUpdater<ComposeUiNode>, Composer, Integer, Unit> modifierMaterializerOf = LayoutKt.modifierMaterializerOf(paint$default);
if (!(startRestartGroup.getApplier() instanceof Applier)) {
ComposablesKt.invalidApplier();
}
startRestartGroup.startReusableNode();
if (startRestartGroup.getInserting()) {
startRestartGroup.createNode(constructor);
} else {
startRestartGroup.useNode();
}
Composer m2273constructorimpl = Updater.m2273constructorimpl(startRestartGroup);
Updater.m2280setimpl(m2273constructorimpl, imageKt$Image$2, ComposeUiNode.INSTANCE.getSetMeasurePolicy());
Updater.m2280setimpl(m2273constructorimpl, currentCompositionLocalMap, ComposeUiNode.INSTANCE.getSetResolvedCompositionLocals());
Function2<ComposeUiNode, Integer, Unit> setCompositeKeyHash = ComposeUiNode.INSTANCE.getSetCompositeKeyHash();
if (m2273constructorimpl.getInserting() || !Intrinsics.areEqual(m2273constructorimpl.rememberedValue(), Integer.valueOf(currentCompositeKeyHash))) {
m2273constructorimpl.updateRememberedValue(Integer.valueOf(currentCompositeKeyHash));
m2273constructorimpl.apply(Integer.valueOf(currentCompositeKeyHash), setCompositeKeyHash);
}
modifierMaterializerOf.invoke(SkippableUpdater.m2264boximpl(SkippableUpdater.m2265constructorimpl(startRestartGroup)), startRestartGroup, 0);
startRestartGroup.startReplaceableGroup(2058660585);
ComposerKt.sourceInformationMarkerStart(startRestartGroup, -820198676, "C:Image.kt#71ulvw");
ComposerKt.sourceInformationMarkerEnd(startRestartGroup);
startRestartGroup.endReplaceableGroup();
startRestartGroup.endNode();
startRestartGroup.endReplaceableGroup();
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
ScopeUpdateScope endRestartGroup = startRestartGroup.endRestartGroup();
if (endRestartGroup == null) {
return;
}
final Modifier modifier3 = modifier2;
final Alignment alignment2 = center;
final ContentScale contentScale2 = fit;
final float f3 = f2;
final ColorFilter colorFilter3 = colorFilter2;
endRestartGroup.updateScope(new Function2<Composer, Integer, Unit>() { // from class: androidx.compose.foundation.ImageKt$Image$3
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
{
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) {
ImageKt.Image(Painter.this, str, modifier3, alignment2, contentScale2, f3, colorFilter3, composer2, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
}
});
}
}