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

Commit 32f2817b authored by chaviw's avatar chaviw Committed by Chavi Weingarten
Browse files

Remove preserve surfaces

When using blast, there's no need to call preserve surfaces since the
client can synchronize layer changes with the incoming buffer in the
new size. If the client uses the WindowOrganizer.applySync call they can
ensure they only update the layer geometry in the same transaction that
the new buffer is submitted in.

When removing preserveSurfaces, we can also remove reparentChildren
since that was the only caller of reparentChildren

Test: Split with SurfaceView
Bug: 177557720
Change-Id: I4574ac0d3b8a63b13ac44846e729b73ca0f88f23
parent 114246c8
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -188,8 +188,6 @@ public final class SurfaceControl implements Parcelable {
            IBinder displayToken, int mode);
    private static native void nativeDeferTransactionUntil(long transactionObj, long nativeObject,
            long barrierObject, long frame);
    private static native void nativeReparentChildren(long transactionObj, long nativeObject,
            long newParentObject);
    private static native void nativeReparent(long transactionObj, long nativeObject,
            long newParentNativeObject);

@@ -2969,15 +2967,6 @@ public final class SurfaceControl implements Parcelable {
            return this;
        }

        /**
         * @hide
         */
        public Transaction reparentChildren(SurfaceControl sc, SurfaceControl newParent) {
            checkPreconditions(sc);
            nativeReparentChildren(mNativeObject, sc.mNativeObject, newParent.mNativeObject);
            return this;
        }

        /**
         * Re-parents a given layer to a new parent. Children inherit transform (position, scaling)
         * crop, visibility, and Z-ordering from their parents, as if the children were pixels within the
+0 −8
Original line number Diff line number Diff line
@@ -116,14 +116,6 @@ public final class WindowManagerGlobal {
     */
    public static final int RELAYOUT_INSETS_PENDING = 0x1;

    /**
     * Flag for relayout: the client may be currently using the current surface,
     * so if it is to be destroyed as a part of the relayout the destroy must
     * be deferred until later.  The client will call performDeferredDestroy()
     * when it is okay.
     */
    public static final int RELAYOUT_DEFER_SURFACE_DESTROY = 0x2;

    public static final int ADD_FLAG_IN_TOUCH_MODE = 0x1;
    public static final int ADD_FLAG_APP_VISIBLE = 0x2;
    public static final int ADD_FLAG_USE_TRIPLE_BUFFERING = 0x4;
+0 −12
Original line number Diff line number Diff line
@@ -1409,16 +1409,6 @@ static void nativeDeferTransactionUntil(JNIEnv* env, jclass clazz, jlong transac
    transaction->deferTransactionUntil_legacy(ctrl, barrier, frameNumber);
}

static void nativeReparentChildren(JNIEnv* env, jclass clazz, jlong transactionObj,
        jlong nativeObject,
        jlong newParentObject) {

    auto ctrl = reinterpret_cast<SurfaceControl *>(nativeObject);
    auto newParent = reinterpret_cast<SurfaceControl *>(newParentObject);
    auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
    transaction->reparentChildren(ctrl, newParent);
}

static void nativeReparent(JNIEnv* env, jclass clazz, jlong transactionObj,
        jlong nativeObject,
        jlong newParentObject) {
@@ -1838,8 +1828,6 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeGetProtectedContentSupport },
    {"nativeDeferTransactionUntil", "(JJJJ)V",
            (void*)nativeDeferTransactionUntil },
    {"nativeReparentChildren", "(JJJ)V",
            (void*)nativeReparentChildren } ,
    {"nativeReparent", "(JJJ)V",
            (void*)nativeReparent },
    {"nativeCaptureDisplay",
+0 −1
Original line number Diff line number Diff line
@@ -1365,7 +1365,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            return;
        }
        final boolean surfaceReady = w.isDrawn()  // Regular case
                || w.mWinAnimator.mSurfaceDestroyDeferred  // The preserved surface is still ready.
                || w.isDragResizeChanged();  // Waiting for relayoutWindow to call preserveSurface.
        final boolean needsLetterbox = surfaceReady && isLetterboxed(w);
        updateRoundedCorners(w);
+0 −1
Original line number Diff line number Diff line
@@ -932,7 +932,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
                    displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
                }
                win.destroySurfaceUnchecked();
                win.mWinAnimator.destroyPreservedSurfaceLocked(win.getSyncTransaction());
            } while (i > 0);
            mWmService.mDestroySurface.clear();
        }
Loading