Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 607ae9ad authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Check preconditions for position and matrix for txs" into main

parents 1af65663 48308570
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3380,7 +3380,8 @@ public final class SurfaceControl implements Parcelable {

        /**
         * Sets the SurfaceControl to the specified position relative to the parent
         * SurfaceControl
         * SurfaceControl. Assumes that the position values are finite. Otherwise, an
         * exception is thrown.
         *
         * @param sc The SurfaceControl to change position
         * @param x the X position
@@ -3390,6 +3391,8 @@ public final class SurfaceControl implements Parcelable {
        @NonNull
        public Transaction setPosition(@NonNull SurfaceControl sc, float x, float y) {
            checkPreconditions(sc);
            Preconditions.checkArgument(Float.isFinite(x), "Infinite x position");
            Preconditions.checkArgument(Float.isFinite(y), "Infinite y position");
            if (SurfaceControlRegistry.sCallStackDebuggingEnabled) {
                SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging(
                        "setPosition", this, sc, "x=" + x + " y=" + y);
@@ -3626,6 +3629,10 @@ public final class SurfaceControl implements Parcelable {
        public Transaction setMatrix(SurfaceControl sc,
                float dsdx, float dtdx, float dtdy, float dsdy) {
            checkPreconditions(sc);
            Preconditions.checkArgument(Float.isFinite(dsdx), "Infinite matrix dsdx");
            Preconditions.checkArgument(Float.isFinite(dtdx), "Infinite matrix dtdx");
            Preconditions.checkArgument(Float.isFinite(dtdy), "Infinite matrix dtdy");
            Preconditions.checkArgument(Float.isFinite(dsdy), "Infinite matrix dsdy");
            if (SurfaceControlRegistry.sCallStackDebuggingEnabled) {
                SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging(
                        "setMatrix", this, sc,
@@ -3638,7 +3645,7 @@ public final class SurfaceControl implements Parcelable {

        /**
         * Sets the transform and position of a {@link SurfaceControl} from a 3x3 transformation
         * matrix.
         * matrix. Assumes that the matrix values are finite. Otherwise, an exception is thrown.
         *
         * @param sc     SurfaceControl to set matrix of
         * @param matrix The matrix to apply.