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

Commit 386fd704 authored by Robert Carr's avatar Robert Carr
Browse files

Fix SurfaceView Background

When refactoring to not use global transaction when setting
position  I failed to account for the forwarding done by the
background wrapper.

Bug: 76099976
Bug: 76110573
Test: Manual. go/wm-smoke
Change-Id: I2cff8e571f12e69cefbd1ea35538fd71beaf1ec4
parent 9b29e5ca
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -787,18 +787,26 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
            Surface viewRootSurface, long nextViewRootFrameNumber) {
    }

    private void setParentSpaceRectangle(Rect position, long frameNumber) {
        ViewRootImpl viewRoot = getViewRootImpl();

    private void applySurfaceTransforms(SurfaceControl surface, Rect position, long frameNumber) {
        if (frameNumber > 0) {
            mRtTransaction.deferTransactionUntilSurface(mSurfaceControl, viewRoot.mSurface,
            final ViewRootImpl viewRoot = getViewRootImpl();

            mRtTransaction.deferTransactionUntilSurface(surface, viewRoot.mSurface,
                    frameNumber);
        }
        mRtTransaction.setPosition(mSurfaceControl,position.left, position.top);
        mRtTransaction.setMatrix(mSurfaceControl,

        mRtTransaction.setPosition(surface, position.left, position.top);
        mRtTransaction.setMatrix(surface,
                position.width() / (float) mSurfaceWidth,
                0.0f, 0.0f,
                position.height() / (float) mSurfaceHeight);
    }

    private void setParentSpaceRectangle(Rect position, long frameNumber) {
        final ViewRootImpl viewRoot = getViewRootImpl();

        applySurfaceTransforms(mSurfaceControl, position, frameNumber);
        applySurfaceTransforms(mSurfaceControl.mBackgroundControl, position, frameNumber);

        applyChildSurfaceTransaction_renderWorker(mRtTransaction, viewRoot.mSurface,
                frameNumber);
@@ -1100,7 +1108,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
    };

    class SurfaceControlWithBackground extends SurfaceControl {
        private SurfaceControl mBackgroundControl;
        SurfaceControl mBackgroundControl;
        private boolean mOpaque = true;
        public boolean mVisible = false;