Rabbit-R1/original r1/java/sources/androidx/compose/foundation/BorderKt.java

137 lines
10 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.compose.foundation;
import androidx.compose.ui.Modifier;
import androidx.compose.ui.draw.CacheDrawScope;
import androidx.compose.ui.draw.DrawResult;
import androidx.compose.ui.geometry.CornerRadius;
import androidx.compose.ui.geometry.CornerRadiusKt;
import androidx.compose.ui.geometry.Offset;
import androidx.compose.ui.geometry.RoundRect;
import androidx.compose.ui.graphics.AndroidPath_androidKt;
import androidx.compose.ui.graphics.Brush;
import androidx.compose.ui.graphics.Path;
import androidx.compose.ui.graphics.PathOperation;
import androidx.compose.ui.graphics.RectangleShapeKt;
import androidx.compose.ui.graphics.Shape;
import androidx.compose.ui.graphics.SolidColor;
import androidx.compose.ui.graphics.drawscope.ContentDrawScope;
import androidx.compose.ui.graphics.drawscope.DrawScope;
import androidx.compose.ui.graphics.drawscope.DrawStyle;
import androidx.compose.ui.graphics.drawscope.Fill;
import androidx.compose.ui.graphics.drawscope.Stroke;
import androidx.core.location.LocationRequestCompat;
import io.sentry.protocol.ViewHierarchyNode;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: Border.kt */
@Metadata(d1 = {"\u0000f\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\u001a\u0018\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0001H\u0002\u001a(\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0004\u001a\u00020\u00012\u0006\u0010\b\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\nH\u0002\u001a\u001c\u0010\u000b\u001a\u00020\f*\u00020\f2\u0006\u0010\u000b\u001a\u00020\r2\b\b\u0002\u0010\u000e\u001a\u00020\u000f\u001a/\u0010\u000b\u001a\u00020\f*\u00020\f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u000e\u001a\u00020\u000fø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0014\u0010\u0015\u001a1\u0010\u000b\u001a\u00020\f*\u00020\f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0016\u001a\u00020\u00172\b\b\u0002\u0010\u000e\u001a\u00020\u000fø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u0018\u0010\u0019\u001a\f\u0010\u001a\u001a\u00020\u001b*\u00020\u001cH\u0002\u001aA\u0010\u001d\u001a\u00020\u001b*\u00020\u001c2\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020!2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\"\u001a\u00020\u0003H\u0002ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b#\u0010$\u001a!\u0010%\u001a\u00020&*\u00020&2\u0006\u0010'\u001a\u00020\u0003H\u0002ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b(\u0010)\u0082\u0002\u000b\n\u0005\\u001e0\u0001\n\u0002\b\u0019¨\u0006*"}, d2 = {"createInsetRoundedRect", "Landroidx/compose/ui/geometry/RoundRect;", "widthPx", "", "roundedRect", "createRoundRectPath", "Landroidx/compose/ui/graphics/Path;", "targetPath", "strokeWidth", "fillArea", "", "border", "Landroidx/compose/ui/Modifier;", "Landroidx/compose/foundation/BorderStroke;", "shape", "Landroidx/compose/ui/graphics/Shape;", ViewHierarchyNode.JsonKeys.WIDTH, "Landroidx/compose/ui/unit/Dp;", "brush", "Landroidx/compose/ui/graphics/Brush;", "border-ziNgDLE", "(Landroidx/compose/ui/Modifier;FLandroidx/compose/ui/graphics/Brush;Landroidx/compose/ui/graphics/Shape;)Landroidx/compose/ui/Modifier;", "color", "Landroidx/compose/ui/graphics/Color;", "border-xT4_qwU", "(Landroidx/compose/ui/Modifier;FJLandroidx/compose/ui/graphics/Shape;)Landroidx/compose/ui/Modifier;", "drawContentWithoutBorder", "Landroidx/compose/ui/draw/DrawResult;", "Landroidx/compose/ui/draw/CacheDrawScope;", "drawRectBorder", "topLeft", "Landroidx/compose/ui/geometry/Offset;", "borderSize", "Landroidx/compose/ui/geometry/Size;", "strokeWidthPx", "drawRectBorder-NsqcLGU", "(Landroidx/compose/ui/draw/CacheDrawScope;Landroidx/compose/ui/graphics/Brush;JJZF)Landroidx/compose/ui/draw/DrawResult;", "shrink", "Landroidx/compose/ui/geometry/CornerRadius;", "value", "shrink-Kibmq7A", "(JF)J", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
/* loaded from: classes.dex */
public final class BorderKt {
public static /* synthetic */ Modifier border$default(Modifier modifier, BorderStroke borderStroke, Shape shape, int i, Object obj) {
if ((i & 2) != 0) {
shape = RectangleShapeKt.getRectangleShape();
}
return border(modifier, borderStroke, shape);
}
public static final Modifier border(Modifier modifier, BorderStroke border, Shape shape) {
Intrinsics.checkNotNullParameter(modifier, "<this>");
Intrinsics.checkNotNullParameter(border, "border");
Intrinsics.checkNotNullParameter(shape, "shape");
return m182borderziNgDLE(modifier, border.getWidth(), border.getBrush(), shape);
}
/* renamed from: border-xT4_qwU$default, reason: not valid java name */
public static /* synthetic */ Modifier m181borderxT4_qwU$default(Modifier modifier, float f, long j, Shape shape, int i, Object obj) {
if ((i & 4) != 0) {
shape = RectangleShapeKt.getRectangleShape();
}
return m180borderxT4_qwU(modifier, f, j, shape);
}
/* renamed from: border-xT4_qwU, reason: not valid java name */
public static final Modifier m180borderxT4_qwU(Modifier border, float f, long j, Shape shape) {
Intrinsics.checkNotNullParameter(border, "$this$border");
Intrinsics.checkNotNullParameter(shape, "shape");
return m182borderziNgDLE(border, f, new SolidColor(j, null), shape);
}
/* renamed from: border-ziNgDLE, reason: not valid java name */
public static final Modifier m182borderziNgDLE(Modifier border, float f, Brush brush, Shape shape) {
Intrinsics.checkNotNullParameter(border, "$this$border");
Intrinsics.checkNotNullParameter(brush, "brush");
Intrinsics.checkNotNullParameter(shape, "shape");
return border.then(new BorderModifierNodeElement(f, brush, shape, null));
}
/* JADX INFO: Access modifiers changed from: private */
public static final DrawResult drawContentWithoutBorder(CacheDrawScope cacheDrawScope) {
return cacheDrawScope.onDrawWithContent(new Function1<ContentDrawScope, Unit>() { // from class: androidx.compose.foundation.BorderKt$drawContentWithoutBorder$1
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(ContentDrawScope contentDrawScope) {
invoke2(contentDrawScope);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(ContentDrawScope onDrawWithContent) {
Intrinsics.checkNotNullParameter(onDrawWithContent, "$this$onDrawWithContent");
onDrawWithContent.drawContent();
}
});
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: drawRectBorder-NsqcLGU, reason: not valid java name */
public static final DrawResult m183drawRectBorderNsqcLGU(CacheDrawScope cacheDrawScope, final Brush brush, long j, long j2, boolean z, float f) {
final long m2416getZeroF1C5BW0 = z ? Offset.INSTANCE.m2416getZeroF1C5BW0() : j;
final long m2306getSizeNHjbRc = z ? cacheDrawScope.m2306getSizeNHjbRc() : j2;
final DrawStyle stroke = z ? Fill.INSTANCE : new Stroke(f, 0.0f, 0, 0, null, 30, null);
return cacheDrawScope.onDrawWithContent(new Function1<ContentDrawScope, Unit>() { // from class: androidx.compose.foundation.BorderKt$drawRectBorder$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(ContentDrawScope contentDrawScope) {
invoke2(contentDrawScope);
return Unit.INSTANCE;
}
/* renamed from: invoke, reason: avoid collision after fix types in other method */
public final void invoke2(ContentDrawScope onDrawWithContent) {
Intrinsics.checkNotNullParameter(onDrawWithContent, "$this$onDrawWithContent");
onDrawWithContent.drawContent();
DrawScope.m3176drawRectAsUm42w$default(onDrawWithContent, Brush.this, m2416getZeroF1C5BW0, m2306getSizeNHjbRc, 0.0f, stroke, null, 0, LocationRequestCompat.QUALITY_LOW_POWER, null);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static final Path createRoundRectPath(Path path, RoundRect roundRect, float f, boolean z) {
path.reset();
path.addRoundRect(roundRect);
if (!z) {
Path Path = AndroidPath_androidKt.Path();
Path.addRoundRect(createInsetRoundedRect(f, roundRect));
path.mo2533opN5in7k0(path, Path, PathOperation.INSTANCE.m2924getDifferenceb3I0S0c());
}
return path;
}
private static final RoundRect createInsetRoundedRect(float f, RoundRect roundRect) {
return new RoundRect(f, f, roundRect.getWidth() - f, roundRect.getHeight() - f, m184shrinkKibmq7A(roundRect.m2450getTopLeftCornerRadiuskKHJgLs(), f), m184shrinkKibmq7A(roundRect.m2451getTopRightCornerRadiuskKHJgLs(), f), m184shrinkKibmq7A(roundRect.m2449getBottomRightCornerRadiuskKHJgLs(), f), m184shrinkKibmq7A(roundRect.m2448getBottomLeftCornerRadiuskKHJgLs(), f), null);
}
/* JADX INFO: Access modifiers changed from: private */
/* renamed from: shrink-Kibmq7A, reason: not valid java name */
public static final long m184shrinkKibmq7A(long j, float f) {
return CornerRadiusKt.CornerRadius(Math.max(0.0f, CornerRadius.m2375getXimpl(j) - f), Math.max(0.0f, CornerRadius.m2376getYimpl(j) - f));
}
}