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

Commit ae457bae authored by Vishnu Nair's avatar Vishnu Nair Committed by Automerger Merge Worker
Browse files

Merge "SurfaceView: Update transform hint only if the view is visible" into sc-dev am: 861ba140

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

Change-Id: I32755b9750b1c8f5b64c0f125a5f977f3f331af0
parents 513b4646 861ba140
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1081,7 +1081,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            || mWindowSpaceTop != mLocation[1];
        final boolean layoutSizeChanged = getWidth() != mScreenRect.width()
            || getHeight() != mScreenRect.height();
        final boolean hintChanged = viewRoot.getSurfaceTransformHint() != mTransformHint;
        final boolean hintChanged = (viewRoot.getSurfaceTransformHint() != mTransformHint)
                && mRequestedVisible;

        if (creating || formatChanged || sizeChanged || visibleChanged ||
                (mUseAlpha && alphaChanged) || windowVisibleChanged ||
@@ -1227,7 +1228,9 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            // Therefore, we must explicitly recreate the {@link Surface} in these
            // cases.
            if (mUseBlastAdapter) {
                if (mBlastBufferQueue != null) {
                    mSurface.transferFrom(mBlastBufferQueue.createSurfaceWithHandle());
                }
            } else {
                mSurface.createFrom(mSurfaceControl);
            }
@@ -1237,7 +1240,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
    private void setBufferSize(Transaction transaction) {
        if (mUseBlastAdapter) {
            mBlastSurfaceControl.setTransformHint(mTransformHint);
            mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight, mFormat);
            if (mBlastBufferQueue != null) {
                mBlastBufferQueue.update(mBlastSurfaceControl, mSurfaceWidth, mSurfaceHeight,
                        mFormat);
            }
        } else {
            transaction.setBufferSize(mSurfaceControl, mSurfaceWidth, mSurfaceHeight);
        }