mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-19 12:23:19 +01:00
197 lines
12 KiB
Java
197 lines
12 KiB
Java
package androidx.compose.ui.draw;
|
|
|
|
import androidx.compose.runtime.internal.StabilityInferred;
|
|
import androidx.compose.ui.graphics.GraphicsContext;
|
|
import androidx.compose.ui.graphics.drawscope.ContentDrawScope;
|
|
import androidx.compose.ui.graphics.drawscope.DrawContext;
|
|
import androidx.compose.ui.graphics.drawscope.DrawScope;
|
|
import androidx.compose.ui.graphics.layer.GraphicsLayer;
|
|
import androidx.compose.ui.graphics.shadow.ShadowContext;
|
|
import androidx.compose.ui.unit.Density;
|
|
import androidx.compose.ui.unit.IntSizeKt;
|
|
import androidx.compose.ui.unit.LayoutDirection;
|
|
import com.facebook.react.uimanager.ViewProps;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@StabilityInferred(parameters = 1)
|
|
@Metadata(d1 = {"\u0000r\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001B\t\b\u0000¢\u0006\u0004\b\u0002\u0010\u0003J\u0006\u0010%\u001a\u00020&J\u0006\u0010'\u001a\u00020(JH\u0010)\u001a\u00020**\u00020&2\b\b\u0002\u0010+\u001a\u00020\u00012\b\b\u0002\u0010!\u001a\u00020\"2\b\b\u0002\u0010\u001d\u001a\u00020,2\u0017\u0010-\u001a\u0013\u0012\u0004\u0012\u00020\u0011\u0012\u0004\u0012\u00020*0.¢\u0006\u0002\b/¢\u0006\u0004\b0\u00101J\u001f\u00102\u001a\u00020\u000b2\u0017\u0010-\u001a\u0013\u0012\u0004\u0012\u000203\u0012\u0004\u0012\u00020*0.¢\u0006\u0002\b/J\u001f\u00104\u001a\u00020\u000b2\u0017\u0010-\u001a\u0013\u0012\u0004\u0012\u00020\u0011\u0012\u0004\u0012\u00020*0.¢\u0006\u0002\b/R\u001a\u0010\u0004\u001a\u00020\u0005X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u001c\u0010\n\u001a\u0004\u0018\u00010\u000bX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u001c\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015R\"\u0010\u0016\u001a\n\u0012\u0004\u0012\u00020\u0018\u0018\u00010\u0017X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001cR\u0011\u0010\u001d\u001a\u00020\u001e8F¢\u0006\u0006\u001a\u0004\b\u001f\u0010 R\u0011\u0010!\u001a\u00020\"8F¢\u0006\u0006\u001a\u0004\b#\u0010$R\u0014\u0010+\u001a\u0002058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b6\u00107R\u0014\u00108\u001a\u0002058VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b9\u00107¨\u0006:"}, d2 = {"Landroidx/compose/ui/draw/CacheDrawScope;", "Landroidx/compose/ui/unit/Density;", "<init>", "()V", "cacheParams", "Landroidx/compose/ui/draw/BuildDrawCacheParams;", "getCacheParams$ui_release", "()Landroidx/compose/ui/draw/BuildDrawCacheParams;", "setCacheParams$ui_release", "(Landroidx/compose/ui/draw/BuildDrawCacheParams;)V", "drawResult", "Landroidx/compose/ui/draw/DrawResult;", "getDrawResult$ui_release", "()Landroidx/compose/ui/draw/DrawResult;", "setDrawResult$ui_release", "(Landroidx/compose/ui/draw/DrawResult;)V", "contentDrawScope", "Landroidx/compose/ui/graphics/drawscope/ContentDrawScope;", "getContentDrawScope$ui_release", "()Landroidx/compose/ui/graphics/drawscope/ContentDrawScope;", "setContentDrawScope$ui_release", "(Landroidx/compose/ui/graphics/drawscope/ContentDrawScope;)V", "graphicsContextProvider", "Lkotlin/Function0;", "Landroidx/compose/ui/graphics/GraphicsContext;", "getGraphicsContextProvider$ui_release", "()Lkotlin/jvm/functions/Function0;", "setGraphicsContextProvider$ui_release", "(Lkotlin/jvm/functions/Function0;)V", "size", "Landroidx/compose/ui/geometry/Size;", "getSize-NH-jbRc", "()J", ViewProps.LAYOUT_DIRECTION, "Landroidx/compose/ui/unit/LayoutDirection;", "getLayoutDirection", "()Landroidx/compose/ui/unit/LayoutDirection;", "obtainGraphicsLayer", "Landroidx/compose/ui/graphics/layer/GraphicsLayer;", "obtainShadowContext", "Landroidx/compose/ui/graphics/shadow/ShadowContext;", "record", "", "density", "Landroidx/compose/ui/unit/IntSize;", "block", "Lkotlin/Function1;", "Lkotlin/ExtensionFunctionType;", "record-TdoYBX4", "(Landroidx/compose/ui/graphics/layer/GraphicsLayer;Landroidx/compose/ui/unit/Density;Landroidx/compose/ui/unit/LayoutDirection;JLkotlin/jvm/functions/Function1;)V", "onDrawBehind", "Landroidx/compose/ui/graphics/drawscope/DrawScope;", "onDrawWithContent", "", "getDensity", "()F", "fontScale", "getFontScale", "ui_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nDrawModifier.kt\nKotlin\n*S Kotlin\n*F\n+ 1 DrawModifier.kt\nandroidx/compose/ui/draw/CacheDrawScope\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,475:1\n1#2:476\n*E\n"})
|
|
/* loaded from: classes13.dex */
|
|
public final class CacheDrawScope implements Density {
|
|
public static final int $stable = 0;
|
|
|
|
@NotNull
|
|
private BuildDrawCacheParams cacheParams = EmptyBuildDrawCacheParams.INSTANCE;
|
|
|
|
@Nullable
|
|
private ContentDrawScope contentDrawScope;
|
|
|
|
@Nullable
|
|
private DrawResult drawResult;
|
|
|
|
@Nullable
|
|
private Function0<? extends GraphicsContext> graphicsContextProvider;
|
|
|
|
/* renamed from: record-TdoYBX4$default, reason: not valid java name */
|
|
public static /* synthetic */ void m4183recordTdoYBX4$default(CacheDrawScope cacheDrawScope, GraphicsLayer graphicsLayer, Density density, LayoutDirection layoutDirection, long j, Function1 function1, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
density = cacheDrawScope;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
layoutDirection = cacheDrawScope.getLayoutDirection();
|
|
}
|
|
if ((i & 4) != 0) {
|
|
j = IntSizeKt.m7550toIntSizeuvyYCjk(cacheDrawScope.m4184getSizeNHjbRc());
|
|
}
|
|
cacheDrawScope.m4185recordTdoYBX4(graphicsLayer, density, layoutDirection, j, function1);
|
|
}
|
|
|
|
@NotNull
|
|
/* renamed from: getCacheParams$ui_release, reason: from getter */
|
|
public final BuildDrawCacheParams getCacheParams() {
|
|
return this.cacheParams;
|
|
}
|
|
|
|
@Nullable
|
|
/* renamed from: getContentDrawScope$ui_release, reason: from getter */
|
|
public final ContentDrawScope getContentDrawScope() {
|
|
return this.contentDrawScope;
|
|
}
|
|
|
|
@Override // androidx.compose.ui.unit.Density
|
|
public float getDensity() {
|
|
return this.cacheParams.getDensity().getDensity();
|
|
}
|
|
|
|
@Nullable
|
|
/* renamed from: getDrawResult$ui_release, reason: from getter */
|
|
public final DrawResult getDrawResult() {
|
|
return this.drawResult;
|
|
}
|
|
|
|
@Override // androidx.compose.ui.unit.FontScaling
|
|
public float getFontScale() {
|
|
return this.cacheParams.getDensity().getFontScale();
|
|
}
|
|
|
|
@Nullable
|
|
public final Function0<GraphicsContext> getGraphicsContextProvider$ui_release() {
|
|
return this.graphicsContextProvider;
|
|
}
|
|
|
|
@NotNull
|
|
public final LayoutDirection getLayoutDirection() {
|
|
return this.cacheParams.getLayoutDirection();
|
|
}
|
|
|
|
/* renamed from: getSize-NH-jbRc, reason: not valid java name */
|
|
public final long m4184getSizeNHjbRc() {
|
|
return this.cacheParams.mo4182getSizeNHjbRc();
|
|
}
|
|
|
|
@NotNull
|
|
public final GraphicsLayer obtainGraphicsLayer() {
|
|
Function0<? extends GraphicsContext> function0 = this.graphicsContextProvider;
|
|
function0.getClass();
|
|
return function0.invoke().createGraphicsLayer();
|
|
}
|
|
|
|
@NotNull
|
|
public final ShadowContext obtainShadowContext() {
|
|
Function0<? extends GraphicsContext> function0 = this.graphicsContextProvider;
|
|
function0.getClass();
|
|
return function0.invoke().getShadowContext();
|
|
}
|
|
|
|
@NotNull
|
|
public final DrawResult onDrawBehind(@NotNull final Function1<? super DrawScope, Unit> block) {
|
|
return onDrawWithContent(new Function1<ContentDrawScope, Unit>() { // from class: androidx.compose.ui.draw.CacheDrawScope$onDrawBehind$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
|
public final void invoke2(ContentDrawScope contentDrawScope) {
|
|
block.invoke(contentDrawScope);
|
|
contentDrawScope.drawContent();
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(ContentDrawScope contentDrawScope) {
|
|
invoke2(contentDrawScope);
|
|
return Unit.INSTANCE;
|
|
}
|
|
});
|
|
}
|
|
|
|
@NotNull
|
|
public final DrawResult onDrawWithContent(@NotNull Function1<? super ContentDrawScope, Unit> block) {
|
|
DrawResult drawResult = new DrawResult(block);
|
|
this.drawResult = drawResult;
|
|
return drawResult;
|
|
}
|
|
|
|
/* renamed from: record-TdoYBX4, reason: not valid java name */
|
|
public final void m4185recordTdoYBX4(@NotNull GraphicsLayer graphicsLayer, @NotNull final Density density, @NotNull final LayoutDirection layoutDirection, long j, @NotNull final Function1<? super ContentDrawScope, Unit> function1) {
|
|
final ContentDrawScope contentDrawScope = this.contentDrawScope;
|
|
contentDrawScope.getClass();
|
|
final Density density2 = contentDrawScope.getDrawContext().getDensity();
|
|
final LayoutDirection layoutDirection2 = contentDrawScope.getDrawContext().getLayoutDirection();
|
|
contentDrawScope.mo5233recordJVtK1S4(graphicsLayer, j, new Function1<DrawScope, Unit>() { // from class: androidx.compose.ui.draw.CacheDrawScope$record$1$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
|
public final void invoke2(DrawScope drawScope) {
|
|
DrawContext drawContext = drawScope.getDrawContext();
|
|
Density density3 = density;
|
|
LayoutDirection layoutDirection3 = layoutDirection;
|
|
drawContext.setDensity(density3);
|
|
drawContext.setLayoutDirection(layoutDirection3);
|
|
try {
|
|
function1.invoke(contentDrawScope);
|
|
} finally {
|
|
DrawContext drawContext2 = drawScope.getDrawContext();
|
|
Density density4 = density2;
|
|
LayoutDirection layoutDirection4 = layoutDirection2;
|
|
drawContext2.setDensity(density4);
|
|
drawContext2.setLayoutDirection(layoutDirection4);
|
|
}
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(DrawScope drawScope) {
|
|
invoke2(drawScope);
|
|
return Unit.INSTANCE;
|
|
}
|
|
});
|
|
}
|
|
|
|
public final void setCacheParams$ui_release(@NotNull BuildDrawCacheParams buildDrawCacheParams) {
|
|
this.cacheParams = buildDrawCacheParams;
|
|
}
|
|
|
|
public final void setContentDrawScope$ui_release(@Nullable ContentDrawScope contentDrawScope) {
|
|
this.contentDrawScope = contentDrawScope;
|
|
}
|
|
|
|
public final void setDrawResult$ui_release(@Nullable DrawResult drawResult) {
|
|
this.drawResult = drawResult;
|
|
}
|
|
|
|
public final void setGraphicsContextProvider$ui_release(@Nullable Function0<? extends GraphicsContext> function0) {
|
|
this.graphicsContextProvider = function0;
|
|
}
|
|
}
|