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

Commit 7780fa9e authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Ensure that the pip transaction matrix has only scale & rotation info" into sc-dev

parents 4ab79fdb a4b44114
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -43,16 +43,18 @@ public class PipSurfaceTransactionHelper {
    public PictureInPictureSurfaceTransaction scale(
            SurfaceControl.Transaction tx, SurfaceControl leash,
            Rect sourceBounds, Rect destinationBounds) {
        float positionX = destinationBounds.left;
        float positionY = destinationBounds.top;
        mTmpSourceRectF.set(sourceBounds);
        mTmpDestinationRectF.set(destinationBounds);
        mTmpDestinationRectF.offsetTo(0, 0);
        mTmpTransform.setRectToRect(mTmpSourceRectF, mTmpDestinationRectF, Matrix.ScaleToFit.FILL);
        final float cornerRadius = getScaledCornerRadius(sourceBounds, destinationBounds);
        tx.setMatrix(leash, mTmpTransform, mTmpFloat9)
                .setPosition(leash, mTmpDestinationRectF.left, mTmpDestinationRectF.top)
                .setPosition(leash, positionX, positionY)
                .setCornerRadius(leash, cornerRadius);
        return new PictureInPictureSurfaceTransaction(
                mTmpDestinationRectF.left, mTmpDestinationRectF.top,
                mTmpFloat9, 0 /* rotation */, cornerRadius, sourceBounds);
                positionX, positionY, mTmpFloat9, 0 /* rotation */, cornerRadius, sourceBounds);
    }

    public PictureInPictureSurfaceTransaction scale(
@@ -61,6 +63,7 @@ public class PipSurfaceTransactionHelper {
            float degree, float positionX, float positionY) {
        mTmpSourceRectF.set(sourceBounds);
        mTmpDestinationRectF.set(destinationBounds);
        mTmpDestinationRectF.offsetTo(0, 0);
        mTmpTransform.setRectToRect(mTmpSourceRectF, mTmpDestinationRectF, Matrix.ScaleToFit.FILL);
        mTmpTransform.postRotate(degree, 0, 0);
        final float cornerRadius = getScaledCornerRadius(sourceBounds, destinationBounds);