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

Commit 9ebb3c87 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 am: 573a5acf

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

Change-Id: If9065c2d74f75bcaea083f0a82bbe300c6df0476
parents 80f96246 573a5acf
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);