mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
353 lines
23 KiB
Java
353 lines
23 KiB
Java
package androidx.compose.ui.platform;
|
|
|
|
import android.graphics.Matrix;
|
|
import android.view.View;
|
|
import androidx.compose.ui.geometry.MutableRect;
|
|
import androidx.compose.ui.geometry.Offset;
|
|
import androidx.compose.ui.geometry.SizeKt;
|
|
import androidx.compose.ui.graphics.AndroidCanvas_androidKt;
|
|
import androidx.compose.ui.graphics.AndroidPaint_androidKt;
|
|
import androidx.compose.ui.graphics.Canvas;
|
|
import androidx.compose.ui.graphics.CanvasHolder;
|
|
import androidx.compose.ui.graphics.ColorKt;
|
|
import androidx.compose.ui.graphics.Paint;
|
|
import androidx.compose.ui.graphics.Path;
|
|
import androidx.compose.ui.graphics.RectangleShapeKt;
|
|
import androidx.compose.ui.graphics.RenderEffect;
|
|
import androidx.compose.ui.graphics.Shape;
|
|
import androidx.compose.ui.graphics.TransformOrigin;
|
|
import androidx.compose.ui.layout.GraphicLayerInfo;
|
|
import androidx.compose.ui.node.OwnedLayer;
|
|
import androidx.compose.ui.unit.Density;
|
|
import androidx.compose.ui.unit.IntOffset;
|
|
import androidx.compose.ui.unit.IntSize;
|
|
import androidx.compose.ui.unit.LayoutDirection;
|
|
import io.sentry.protocol.ViewHierarchyNode;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.JvmStatic;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* compiled from: RenderNodeLayer.android.kt */
|
|
@Metadata(d1 = {"\u0000º\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u0007\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0001\u0018\u0000 h2\u00020\u00012\u00020\u0002:\u0002hiB/\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\b0\u0006\u0012\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\b0\n¢\u0006\u0002\u0010\u000bJ\u0010\u0010(\u001a\u00020\b2\u0006\u0010)\u001a\u00020\u0007H\u0002J\b\u0010*\u001a\u00020\bH\u0016J\u0010\u0010+\u001a\u00020\b2\u0006\u0010)\u001a\u00020\u0007H\u0016J\b\u0010,\u001a\u00020\bH\u0016J\u001d\u0010-\u001a\u00020\b2\u0006\u0010.\u001a\u00020/H\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b0\u00101J\u001d\u00102\u001a\u00020\u000f2\u0006\u00103\u001a\u000204H\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b5\u00106J\u0018\u00107\u001a\u00020\b2\u0006\u00108\u001a\u0002092\u0006\u0010:\u001a\u00020\u000fH\u0016J%\u0010;\u001a\u0002042\u0006\u0010<\u001a\u0002042\u0006\u0010:\u001a\u00020\u000fH\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\b=\u0010>J\u001d\u0010?\u001a\u00020\b2\u0006\u00103\u001a\u00020@H\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\bA\u0010BJ\u001d\u0010C\u001a\u00020\b2\u0006\u0010D\u001a\u00020EH\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\bF\u0010BJ*\u0010G\u001a\u00020\b2\u0012\u0010\u0005\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\b0\u00062\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\b0\nH\u0016J\u001d\u0010H\u001a\u00020\b2\u0006\u0010.\u001a\u00020/H\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\bI\u00101J\b\u0010J\u001a\u00020\bH\u0002J\b\u0010K\u001a\u00020\bH\u0016J¯\u0001\u0010L\u001a\u00020\b2\u0006\u0010M\u001a\u00020N2\u0006\u0010O\u001a\u00020N2\u0006\u0010P\u001a\u00020N2\u0006\u0010Q\u001a\u00020N2\u0006\u0010R\u001a\u00020N2\u0006\u0010S\u001a\u00020N2\u0006\u0010T\u001a\u00020N2\u0006\u0010U\u001a\u00020N2\u0006\u0010V\u001a\u00020N2\u0006\u0010W\u001a\u00020N2\u0006\u0010%\u001a\u00020&2\u0006\u0010X\u001a\u00020Y2\u0006\u0010Z\u001a\u00020\u000f2\b\u0010[\u001a\u0004\u0018\u00010\\2\u0006\u0010]\u001a\u00020^2\u0006\u0010_\u001a\u00020^2\u0006\u0010`\u001a\u00020a2\u0006\u0010b\u001a\u00020c2\u0006\u0010d\u001a\u00020eH\u0016ø\u0001\u0001ø\u0001\u0000¢\u0006\u0004\bf\u0010gR\u000e\u0010\f\u001a\u00020\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\u0005\u001a\u0010\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\b\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u0016\u0010\t\u001a\n\u0012\u0004\u0012\u00020\b\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u0012\u001a\u00020\u000f2\u0006\u0010\u0011\u001a\u00020\u000f@BX\u0082\u000e¢\u0006\b\n\u0000\"\u0004\b\u0013\u0010\u0014R\u0014\u0010\u0015\u001a\u00020\u00168VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0017\u0010\u0018R\u0014\u0010\u0019\u001a\b\u0012\u0004\u0012\u00020\u001b0\u001aX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u001dX\u0082\u0004¢\u0006\u0002\n\u0000R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u001e\u0010\u001fR\u0014\u0010 \u001a\u00020\u00168VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b!\u0010\u0018R\u000e\u0010\"\u001a\u00020\u001bX\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010#\u001a\u0004\u0018\u00010$X\u0082\u000e¢\u0006\u0002\n\u0000R\u0019\u0010%\u001a\u00020&X\u0082\u000eø\u0001\u0000ø\u0001\u0001ø\u0001\u0002¢\u0006\u0004\n\u0002\u0010'\u0082\u0002\u000f\n\u0002\b\u0019\n\u0005\b¡\u001e0\u0001\n\u0002\b!¨\u0006j"}, d2 = {"Landroidx/compose/ui/platform/RenderNodeLayer;", "Landroidx/compose/ui/node/OwnedLayer;", "Landroidx/compose/ui/layout/GraphicLayerInfo;", "ownerView", "Landroidx/compose/ui/platform/AndroidComposeView;", "drawBlock", "Lkotlin/Function1;", "Landroidx/compose/ui/graphics/Canvas;", "", "invalidateParentLayer", "Lkotlin/Function0;", "(Landroidx/compose/ui/platform/AndroidComposeView;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)V", "canvasHolder", "Landroidx/compose/ui/graphics/CanvasHolder;", "drawnWithZ", "", "isDestroyed", "value", "isDirty", "setDirty", "(Z)V", "layerId", "", "getLayerId", "()J", "matrixCache", "Landroidx/compose/ui/platform/LayerMatrixCache;", "Landroidx/compose/ui/platform/DeviceRenderNode;", "outlineResolver", "Landroidx/compose/ui/platform/OutlineResolver;", "getOwnerView", "()Landroidx/compose/ui/platform/AndroidComposeView;", "ownerViewId", "getOwnerViewId", "renderNode", "softwareLayerPaint", "Landroidx/compose/ui/graphics/Paint;", "transformOrigin", "Landroidx/compose/ui/graphics/TransformOrigin;", "J", "clipRenderNode", "canvas", "destroy", "drawLayer", "invalidate", "inverseTransform", "matrix", "Landroidx/compose/ui/graphics/Matrix;", "inverseTransform-58bKbWc", "([F)V", "isInLayer", "position", "Landroidx/compose/ui/geometry/Offset;", "isInLayer-k-4lQ0M", "(J)Z", "mapBounds", "rect", "Landroidx/compose/ui/geometry/MutableRect;", "inverse", "mapOffset", "point", "mapOffset-8S9VItk", "(JZ)J", "move", "Landroidx/compose/ui/unit/IntOffset;", "move--gyyYBs", "(J)V", "resize", "size", "Landroidx/compose/ui/unit/IntSize;", "resize-ozmzZPI", "reuseLayer", "transform", "transform-58bKbWc", "triggerRepaint", "updateDisplayList", "updateLayerProperties", "scaleX", "", "scaleY", ViewHierarchyNode.JsonKeys.ALPHA, "translationX", "translationY", "shadowElevation", "rotationX", "rotationY", "rotationZ", "cameraDistance", "shape", "Landroidx/compose/ui/graphics/Shape;", "clip", "renderEffect", "Landroidx/compose/ui/graphics/RenderEffect;", "ambientShadowColor", "Landroidx/compose/ui/graphics/Color;", "spotShadowColor", "compositingStrategy", "Landroidx/compose/ui/graphics/CompositingStrategy;", "layoutDirection", "Landroidx/compose/ui/unit/LayoutDirection;", "density", "Landroidx/compose/ui/unit/Density;", "updateLayerProperties-dDxr-wY", "(FFFFFFFFFFJLandroidx/compose/ui/graphics/Shape;ZLandroidx/compose/ui/graphics/RenderEffect;JJILandroidx/compose/ui/unit/LayoutDirection;Landroidx/compose/ui/unit/Density;)V", "Companion", "UniqueDrawingIdApi29", "ui_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
public final class RenderNodeLayer implements OwnedLayer, GraphicLayerInfo {
|
|
private static final Function2<DeviceRenderNode, Matrix, Unit> getMatrix = new Function2<DeviceRenderNode, Matrix, Unit>() { // from class: androidx.compose.ui.platform.RenderNodeLayer$Companion$getMatrix$1
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Unit invoke(DeviceRenderNode deviceRenderNode, Matrix matrix) {
|
|
invoke2(deviceRenderNode, matrix);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
|
public final void invoke2(DeviceRenderNode rn, Matrix matrix) {
|
|
Intrinsics.checkNotNullParameter(rn, "rn");
|
|
Intrinsics.checkNotNullParameter(matrix, "matrix");
|
|
rn.getMatrix(matrix);
|
|
}
|
|
};
|
|
private final CanvasHolder canvasHolder;
|
|
private Function1<? super Canvas, Unit> drawBlock;
|
|
private boolean drawnWithZ;
|
|
private Function0<Unit> invalidateParentLayer;
|
|
private boolean isDestroyed;
|
|
private boolean isDirty;
|
|
private final LayerMatrixCache<DeviceRenderNode> matrixCache;
|
|
private final OutlineResolver outlineResolver;
|
|
private final AndroidComposeView ownerView;
|
|
private final DeviceRenderNode renderNode;
|
|
private Paint softwareLayerPaint;
|
|
private long transformOrigin;
|
|
|
|
public final AndroidComposeView getOwnerView() {
|
|
return this.ownerView;
|
|
}
|
|
|
|
public RenderNodeLayer(AndroidComposeView ownerView, Function1<? super Canvas, Unit> drawBlock, Function0<Unit> invalidateParentLayer) {
|
|
Intrinsics.checkNotNullParameter(ownerView, "ownerView");
|
|
Intrinsics.checkNotNullParameter(drawBlock, "drawBlock");
|
|
Intrinsics.checkNotNullParameter(invalidateParentLayer, "invalidateParentLayer");
|
|
this.ownerView = ownerView;
|
|
this.drawBlock = drawBlock;
|
|
this.invalidateParentLayer = invalidateParentLayer;
|
|
this.outlineResolver = new OutlineResolver(ownerView.getDensity());
|
|
this.matrixCache = new LayerMatrixCache<>(getMatrix);
|
|
this.canvasHolder = new CanvasHolder();
|
|
this.transformOrigin = TransformOrigin.INSTANCE.m3023getCenterSzJe1aQ();
|
|
RenderNodeApi29 renderNodeApi29 = new RenderNodeApi29(ownerView);
|
|
renderNodeApi29.setHasOverlappingRendering(true);
|
|
this.renderNode = renderNodeApi29;
|
|
}
|
|
|
|
private final void setDirty(boolean z) {
|
|
if (z != this.isDirty) {
|
|
this.isDirty = z;
|
|
this.ownerView.notifyLayerIsDirty$ui_release(this, z);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.layout.GraphicLayerInfo
|
|
public long getLayerId() {
|
|
return this.renderNode.getUniqueId();
|
|
}
|
|
|
|
@Override // androidx.compose.ui.layout.GraphicLayerInfo
|
|
public long getOwnerViewId() {
|
|
return UniqueDrawingIdApi29.getUniqueDrawingId(this.ownerView);
|
|
}
|
|
|
|
/* compiled from: RenderNodeLayer.android.kt */
|
|
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\bÃ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007¨\u0006\u0007"}, d2 = {"Landroidx/compose/ui/platform/RenderNodeLayer$UniqueDrawingIdApi29;", "", "()V", "getUniqueDrawingId", "", "view", "Landroid/view/View;", "ui_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
private static final class UniqueDrawingIdApi29 {
|
|
public static final UniqueDrawingIdApi29 INSTANCE = new UniqueDrawingIdApi29();
|
|
|
|
private UniqueDrawingIdApi29() {
|
|
}
|
|
|
|
@JvmStatic
|
|
public static final long getUniqueDrawingId(View view) {
|
|
Intrinsics.checkNotNullParameter(view, "view");
|
|
return view.getUniqueDrawingId();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: updateLayerProperties-dDxr-wY */
|
|
public void mo4142updateLayerPropertiesdDxrwY(float scaleX, float scaleY, float alpha, float translationX, float translationY, float shadowElevation, float rotationX, float rotationY, float rotationZ, float cameraDistance, long transformOrigin, Shape shape, boolean clip, RenderEffect renderEffect, long ambientShadowColor, long spotShadowColor, int compositingStrategy, LayoutDirection layoutDirection, Density density) {
|
|
Function0<Unit> function0;
|
|
Intrinsics.checkNotNullParameter(shape, "shape");
|
|
Intrinsics.checkNotNullParameter(layoutDirection, "layoutDirection");
|
|
Intrinsics.checkNotNullParameter(density, "density");
|
|
this.transformOrigin = transformOrigin;
|
|
boolean z = this.renderNode.getClipToOutline() && !this.outlineResolver.getOutlineClipSupported();
|
|
this.renderNode.setScaleX(scaleX);
|
|
this.renderNode.setScaleY(scaleY);
|
|
this.renderNode.setAlpha(alpha);
|
|
this.renderNode.setTranslationX(translationX);
|
|
this.renderNode.setTranslationY(translationY);
|
|
this.renderNode.setElevation(shadowElevation);
|
|
this.renderNode.setAmbientShadowColor(ColorKt.m2693toArgb8_81llA(ambientShadowColor));
|
|
this.renderNode.setSpotShadowColor(ColorKt.m2693toArgb8_81llA(spotShadowColor));
|
|
this.renderNode.setRotationZ(rotationZ);
|
|
this.renderNode.setRotationX(rotationX);
|
|
this.renderNode.setRotationY(rotationY);
|
|
this.renderNode.setCameraDistance(cameraDistance);
|
|
this.renderNode.setPivotX(TransformOrigin.m3018getPivotFractionXimpl(transformOrigin) * this.renderNode.getWidth());
|
|
this.renderNode.setPivotY(TransformOrigin.m3019getPivotFractionYimpl(transformOrigin) * this.renderNode.getHeight());
|
|
this.renderNode.setClipToOutline(clip && shape != RectangleShapeKt.getRectangleShape());
|
|
this.renderNode.setClipToBounds(clip && shape == RectangleShapeKt.getRectangleShape());
|
|
this.renderNode.setRenderEffect(renderEffect);
|
|
this.renderNode.mo4193setCompositingStrategyaDBOjCE(compositingStrategy);
|
|
boolean update = this.outlineResolver.update(shape, this.renderNode.getAlpha(), this.renderNode.getClipToOutline(), this.renderNode.getElevation(), layoutDirection, density);
|
|
this.renderNode.setOutline(this.outlineResolver.getOutline());
|
|
boolean z2 = this.renderNode.getClipToOutline() && !this.outlineResolver.getOutlineClipSupported();
|
|
if (z != z2 || (z2 && update)) {
|
|
invalidate();
|
|
} else {
|
|
triggerRepaint();
|
|
}
|
|
if (!this.drawnWithZ && this.renderNode.getElevation() > 0.0f && (function0 = this.invalidateParentLayer) != null) {
|
|
function0.invoke();
|
|
}
|
|
this.matrixCache.invalidate();
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: isInLayer-k-4lQ0M */
|
|
public boolean mo4137isInLayerk4lQ0M(long position) {
|
|
float m2400getXimpl = Offset.m2400getXimpl(position);
|
|
float m2401getYimpl = Offset.m2401getYimpl(position);
|
|
if (this.renderNode.getClipToBounds()) {
|
|
return 0.0f <= m2400getXimpl && m2400getXimpl < ((float) this.renderNode.getWidth()) && 0.0f <= m2401getYimpl && m2401getYimpl < ((float) this.renderNode.getHeight());
|
|
}
|
|
if (this.renderNode.getClipToOutline()) {
|
|
return this.outlineResolver.m4230isInOutlinek4lQ0M(position);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: resize-ozmzZPI */
|
|
public void mo4140resizeozmzZPI(long size) {
|
|
int m5043getWidthimpl = IntSize.m5043getWidthimpl(size);
|
|
int m5042getHeightimpl = IntSize.m5042getHeightimpl(size);
|
|
float f = m5043getWidthimpl;
|
|
this.renderNode.setPivotX(TransformOrigin.m3018getPivotFractionXimpl(this.transformOrigin) * f);
|
|
float f2 = m5042getHeightimpl;
|
|
this.renderNode.setPivotY(TransformOrigin.m3019getPivotFractionYimpl(this.transformOrigin) * f2);
|
|
DeviceRenderNode deviceRenderNode = this.renderNode;
|
|
if (deviceRenderNode.setPosition(deviceRenderNode.getLeft(), this.renderNode.getTop(), this.renderNode.getLeft() + m5043getWidthimpl, this.renderNode.getTop() + m5042getHeightimpl)) {
|
|
this.outlineResolver.m4231updateuvyYCjk(SizeKt.Size(f, f2));
|
|
this.renderNode.setOutline(this.outlineResolver.getOutline());
|
|
invalidate();
|
|
this.matrixCache.invalidate();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: move--gyyYBs */
|
|
public void mo4139movegyyYBs(long position) {
|
|
int left = this.renderNode.getLeft();
|
|
int top = this.renderNode.getTop();
|
|
int m5001getXimpl = IntOffset.m5001getXimpl(position);
|
|
int m5002getYimpl = IntOffset.m5002getYimpl(position);
|
|
if (left == m5001getXimpl && top == m5002getYimpl) {
|
|
return;
|
|
}
|
|
if (left != m5001getXimpl) {
|
|
this.renderNode.offsetLeftAndRight(m5001getXimpl - left);
|
|
}
|
|
if (top != m5002getYimpl) {
|
|
this.renderNode.offsetTopAndBottom(m5002getYimpl - top);
|
|
}
|
|
triggerRepaint();
|
|
this.matrixCache.invalidate();
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void invalidate() {
|
|
if (this.isDirty || this.isDestroyed) {
|
|
return;
|
|
}
|
|
this.ownerView.invalidate();
|
|
setDirty(true);
|
|
}
|
|
|
|
private final void triggerRepaint() {
|
|
WrapperRenderNodeLayerHelperMethods.INSTANCE.onDescendantInvalidated(this.ownerView);
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void drawLayer(Canvas canvas) {
|
|
Intrinsics.checkNotNullParameter(canvas, "canvas");
|
|
android.graphics.Canvas nativeCanvas = AndroidCanvas_androidKt.getNativeCanvas(canvas);
|
|
if (nativeCanvas.isHardwareAccelerated()) {
|
|
updateDisplayList();
|
|
boolean z = this.renderNode.getElevation() > 0.0f;
|
|
this.drawnWithZ = z;
|
|
if (z) {
|
|
canvas.enableZ();
|
|
}
|
|
this.renderNode.drawInto(nativeCanvas);
|
|
if (this.drawnWithZ) {
|
|
canvas.disableZ();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
float left = this.renderNode.getLeft();
|
|
float top = this.renderNode.getTop();
|
|
float right = this.renderNode.getRight();
|
|
float bottom = this.renderNode.getBottom();
|
|
if (this.renderNode.getAlpha() < 1.0f) {
|
|
Paint paint = this.softwareLayerPaint;
|
|
if (paint == null) {
|
|
paint = AndroidPaint_androidKt.Paint();
|
|
this.softwareLayerPaint = paint;
|
|
}
|
|
paint.setAlpha(this.renderNode.getAlpha());
|
|
nativeCanvas.saveLayer(left, top, right, bottom, paint.getInternalPaint());
|
|
} else {
|
|
canvas.save();
|
|
}
|
|
canvas.translate(left, top);
|
|
canvas.mo2496concat58bKbWc(this.matrixCache.m4208calculateMatrixGrdbGEg(this.renderNode));
|
|
clipRenderNode(canvas);
|
|
Function1<? super Canvas, Unit> function1 = this.drawBlock;
|
|
if (function1 != null) {
|
|
function1.invoke(canvas);
|
|
}
|
|
canvas.restore();
|
|
setDirty(false);
|
|
}
|
|
|
|
private final void clipRenderNode(Canvas canvas) {
|
|
if (this.renderNode.getClipToOutline() || this.renderNode.getClipToBounds()) {
|
|
this.outlineResolver.clipToOutline(canvas);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void updateDisplayList() {
|
|
if (this.isDirty || !this.renderNode.getHasDisplayList()) {
|
|
setDirty(false);
|
|
Path clipPath = (!this.renderNode.getClipToOutline() || this.outlineResolver.getOutlineClipSupported()) ? null : this.outlineResolver.getClipPath();
|
|
Function1<? super Canvas, Unit> function1 = this.drawBlock;
|
|
if (function1 != null) {
|
|
this.renderNode.record(this.canvasHolder, clipPath, function1);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void destroy() {
|
|
if (this.renderNode.getHasDisplayList()) {
|
|
this.renderNode.discardDisplayList();
|
|
}
|
|
this.drawBlock = null;
|
|
this.invalidateParentLayer = null;
|
|
this.isDestroyed = true;
|
|
setDirty(false);
|
|
this.ownerView.requestClearInvalidObservations();
|
|
this.ownerView.recycle$ui_release(this);
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: mapOffset-8S9VItk */
|
|
public long mo4138mapOffset8S9VItk(long point, boolean inverse) {
|
|
if (inverse) {
|
|
float[] m4207calculateInverseMatrixbWbORWo = this.matrixCache.m4207calculateInverseMatrixbWbORWo(this.renderNode);
|
|
return m4207calculateInverseMatrixbWbORWo != null ? androidx.compose.ui.graphics.Matrix.m2870mapMKHz9U(m4207calculateInverseMatrixbWbORWo, point) : Offset.INSTANCE.m2414getInfiniteF1C5BW0();
|
|
}
|
|
return androidx.compose.ui.graphics.Matrix.m2870mapMKHz9U(this.matrixCache.m4208calculateMatrixGrdbGEg(this.renderNode), point);
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void mapBounds(MutableRect rect, boolean inverse) {
|
|
Intrinsics.checkNotNullParameter(rect, "rect");
|
|
if (inverse) {
|
|
float[] m4207calculateInverseMatrixbWbORWo = this.matrixCache.m4207calculateInverseMatrixbWbORWo(this.renderNode);
|
|
if (m4207calculateInverseMatrixbWbORWo == null) {
|
|
rect.set(0.0f, 0.0f, 0.0f, 0.0f);
|
|
return;
|
|
} else {
|
|
androidx.compose.ui.graphics.Matrix.m2872mapimpl(m4207calculateInverseMatrixbWbORWo, rect);
|
|
return;
|
|
}
|
|
}
|
|
androidx.compose.ui.graphics.Matrix.m2872mapimpl(this.matrixCache.m4208calculateMatrixGrdbGEg(this.renderNode), rect);
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
public void reuseLayer(Function1<? super Canvas, Unit> drawBlock, Function0<Unit> invalidateParentLayer) {
|
|
Intrinsics.checkNotNullParameter(drawBlock, "drawBlock");
|
|
Intrinsics.checkNotNullParameter(invalidateParentLayer, "invalidateParentLayer");
|
|
setDirty(false);
|
|
this.isDestroyed = false;
|
|
this.drawnWithZ = false;
|
|
this.transformOrigin = TransformOrigin.INSTANCE.m3023getCenterSzJe1aQ();
|
|
this.drawBlock = drawBlock;
|
|
this.invalidateParentLayer = invalidateParentLayer;
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: transform-58bKbWc */
|
|
public void mo4141transform58bKbWc(float[] matrix) {
|
|
Intrinsics.checkNotNullParameter(matrix, "matrix");
|
|
androidx.compose.ui.graphics.Matrix.m2881timesAssign58bKbWc(matrix, this.matrixCache.m4208calculateMatrixGrdbGEg(this.renderNode));
|
|
}
|
|
|
|
@Override // androidx.compose.ui.node.OwnedLayer
|
|
/* renamed from: inverseTransform-58bKbWc */
|
|
public void mo4136inverseTransform58bKbWc(float[] matrix) {
|
|
Intrinsics.checkNotNullParameter(matrix, "matrix");
|
|
float[] m4207calculateInverseMatrixbWbORWo = this.matrixCache.m4207calculateInverseMatrixbWbORWo(this.renderNode);
|
|
if (m4207calculateInverseMatrixbWbORWo != null) {
|
|
androidx.compose.ui.graphics.Matrix.m2881timesAssign58bKbWc(matrix, m4207calculateInverseMatrixbWbORWo);
|
|
}
|
|
}
|
|
}
|