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

Commit cacc7541 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: I4ddbeafe604f4d6195efd43463154d73069c9864
parents 2e9c5a6a 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);