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

Commit 573a5acf authored by Winson Chung's avatar Winson Chung Committed by Automerger Merge Worker
Browse files

Merge "Ensure that the pip transaction matrix has only scale & rotation info"...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15184134

Change-Id: Ice578477b4464791fec5dee08e4297a9e7d4e5ba
parents 89e935b8 7780fa9e
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);