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

Commit 57f3c59e authored by Rob Carr's avatar Rob Carr Committed by Automerger Merge Worker
Browse files

Merge "SurfaceView: Ensure position update listener sets at least once" into...

Merge "SurfaceView: Ensure position update listener sets at least once" into tm-dev am: f84837ff am: f0051a78

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



Change-Id: I20a1f15e0fab69596f14daccc49ae3dc6d359ddb
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2c936946 f0051a78
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1274,6 +1274,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
    private class SurfaceViewPositionUpdateListener implements RenderNode.PositionUpdateListener {
    private class SurfaceViewPositionUpdateListener implements RenderNode.PositionUpdateListener {
        private final int mRtSurfaceWidth;
        private final int mRtSurfaceWidth;
        private final int mRtSurfaceHeight;
        private final int mRtSurfaceHeight;
        private boolean mRtFirst = true;
        private final SurfaceControl.Transaction mPositionChangedTransaction =
        private final SurfaceControl.Transaction mPositionChangedTransaction =
                new SurfaceControl.Transaction();
                new SurfaceControl.Transaction();


@@ -1284,14 +1285,15 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall


        @Override
        @Override
        public void positionChanged(long frameNumber, int left, int top, int right, int bottom) {
        public void positionChanged(long frameNumber, int left, int top, int right, int bottom) {
            if (mRTLastReportedPosition.left == left
            if (!mRtFirst && (mRTLastReportedPosition.left == left
                    && mRTLastReportedPosition.top == top
                    && mRTLastReportedPosition.top == top
                    && mRTLastReportedPosition.right == right
                    && mRTLastReportedPosition.right == right
                    && mRTLastReportedPosition.bottom == bottom
                    && mRTLastReportedPosition.bottom == bottom
                    && mRTLastReportedSurfaceSize.x == mRtSurfaceWidth
                    && mRTLastReportedSurfaceSize.x == mRtSurfaceWidth
                    && mRTLastReportedSurfaceSize.y == mRtSurfaceHeight) {
                    && mRTLastReportedSurfaceSize.y == mRtSurfaceHeight)) {
                return;
                return;
            }
            }
            mRtFirst = false;
            try {
            try {
                if (DEBUG_POSITION) {
                if (DEBUG_POSITION) {
                    Log.d(TAG, String.format(
                    Log.d(TAG, String.format(