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

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

Merge "Validate position and matrix for txs" into main

parents 86302813 ebc2e2eb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -496,6 +496,7 @@ void ASurfaceTransaction_setCrop(ASurfaceTransaction* _Nonnull transaction,

/**
 * Specifies the position in the parent's space where the surface will be drawn.
 * Only permits finite values to be set.
 *
 * \param x The x position to render the surface.
 * \param y The y position to render the surface.
@@ -519,6 +520,7 @@ void ASurfaceTransaction_setBufferTransform(ASurfaceTransaction* _Nonnull transa

/**
 * Sets an x and y scale of a surface with (0, 0) as the centerpoint of the scale.
 * Only permits finite values to be set.
 *
 * \param xScale The scale in the x direction. Must be greater than 0.
 * \param yScale The scale in the y direction. Must be greater than 0.
+3 −0
Original line number Diff line number Diff line
@@ -1335,6 +1335,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setPosit
        mStatus = BAD_INDEX;
        return *this;
    }
    LOG_ALWAYS_FATAL_IF(!isfinite(x) || !isfinite(y), "setPosition called with infinite values");
    s->what |= layer_state_t::ePositionChanged;
    s->x = x;
    s->y = y;
@@ -1475,6 +1476,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setMatri
        mStatus = BAD_INDEX;
        return *this;
    }
    LOG_ALWAYS_FATAL_IF(!isfinite(dsdx) || !isfinite(dtdx) || !isfinite(dtdy) || !isfinite(dsdy),
                        "setMatrix called with infinite values");
    s->what |= layer_state_t::eMatrixChanged;
    layer_state_t::matrix22_t matrix;
    matrix.dsdx = dsdx;