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

Commit 03c2c102 authored by Issei Suzuki's avatar Issei Suzuki
Browse files

DO NOT MERGE: Clean up SurfaceView.

Bug: 136538998
Test: no-op refactoring CL. Existing unit tests still pass.
Change-Id: Idd6c5871ed34880a053f3a43ab4f7aa3a466b548
parent 33727a0e
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -691,7 +691,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                try {
                    redrawNeeded |= visible && !mDrawFinished;

                    SurfaceHolder.Callback callbacks[] = null;
                    SurfaceHolder.Callback[] callbacks = null;

                    final boolean surfaceChanged = creating;
                    if (mSurfaceCreated && (surfaceChanged || (!visible && visibleChanged))) {
@@ -818,7 +818,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                if (!isHardwareAccelerated() || !mRtHandlingPositionUpdates) {
                    try {
                        if (DEBUG) Log.d(TAG, String.format("%d updateSurfacePosition UI, " +
                                "postion = [%d, %d, %d, %d]", System.identityHashCode(this),
                                "position = [%d, %d, %d, %d]", System.identityHashCode(this),
                                mScreenRect.left, mScreenRect.top,
                                mScreenRect.right, mScreenRect.bottom));
                        setParentSpaceRectangle(mScreenRect, -1);
@@ -841,9 +841,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
            mDeferredDestroySurfaceControl = null;
        }

        runOnUiThread(() -> {
            performDrawFinished();
        });
        runOnUiThread(this::performDrawFinished);
    }

    /**
@@ -917,7 +915,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
                if (DEBUG) {
                    Log.d(TAG, String.format(
                            "%d updateSurfacePosition RenderWorker, frameNr = %d, "
                                    + "postion = [%d, %d, %d, %d]",
                                    + "position = [%d, %d, %d, %d]",
                            System.identityHashCode(this), frameNumber,
                            left, top, right, bottom));
                }
@@ -953,7 +951,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
    };

    private SurfaceHolder.Callback[] getSurfaceCallbacks() {
        SurfaceHolder.Callback callbacks[];
        SurfaceHolder.Callback[] callbacks;
        synchronized (mCallbacks) {
            callbacks = new SurfaceHolder.Callback[mCallbacks.size()];
            mCallbacks.toArray(callbacks);
+1 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,7 @@ public final class ViewTreeObserver {
     * be called manually if you are forcing the drawing on a View or a hierarchy of Views
     * that are not attached to a Window or in the GONE state.
     *
     * @return True if the current draw should be canceled and resceduled, false otherwise.
     * @return True if the current draw should be canceled and rescheduled, false otherwise.
     */
    @SuppressWarnings("unchecked")
    public final boolean dispatchOnPreDraw() {