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

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

Merge "ViewRootImpl: Pass buffer to finishDrawing when requested" into rvc-dev am: 0a57530b

Change-Id: I62a6036bfed4d319f7e4ef64ee93102899ef5c3d
parents 08003705 0a57530b
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -3017,6 +3017,10 @@ public final class ViewRootImpl implements ViewParent,
        if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) {
            reportNextDraw();
        }
        if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) {
            reportNextDraw();
            setUseBLASTSyncTransaction();
        }

        boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible;

@@ -3725,7 +3729,7 @@ public final class ViewRootImpl implements ViewParent,
            if (needFrameCompleteCallback) {
                final Handler handler = mAttachInfo.mHandler;
                mAttachInfo.mThreadedRenderer.setFrameCompleteCallback((long frameNr) -> {
                        finishBLASTSync();
                        finishBLASTSync(!reportNextDraw);
                        handler.postAtFrontOfQueue(() -> {
                            if (reportNextDraw) {
                                // TODO: Use the frame number
@@ -3759,7 +3763,7 @@ public final class ViewRootImpl implements ViewParent,
            if (usingAsyncReport && !canUseAsync) {
                mAttachInfo.mThreadedRenderer.setFrameCompleteCallback(null);
                usingAsyncReport = false;
                finishBLASTSync();
                finishBLASTSync(true /* apply */);
            }
        } finally {
            mIsDrawing = false;
@@ -9576,10 +9580,15 @@ public final class ViewRootImpl implements ViewParent,
        mNextDrawUseBLASTSyncTransaction = true;
    }

    private void finishBLASTSync() {
    private void finishBLASTSync(boolean apply) {
        if (mNextReportConsumeBLAST) {
            mNextReportConsumeBLAST = false;

            if (apply) {
                mRtBLASTSyncTransaction.apply();
            } else {
                mSurfaceChangedTransaction.merge(mRtBLASTSyncTransaction);
            }
        }
    }

+8 −0
Original line number Diff line number Diff line
@@ -101,6 +101,14 @@ public final class WindowManagerGlobal {
     */
    public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 0x40;

    /**
     * This flag indicates the client should not directly submit it's next frame,
     * but instead should pass it in the postDrawTransaction of
     * {@link WindowManagerService#finishDrawing}. This is used by the WM
     * BLASTSyncEngine to synchronize rendering of multiple windows.
     */
    public static final int RELAYOUT_RES_BLAST_SYNC = 0x80;

    /**
     * Flag for relayout: the client will be later giving
     * internal insets; as a result, the window will not impact other window
+4 −0
Original line number Diff line number Diff line
@@ -2577,4 +2577,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<

        return willSync;
    }

    boolean useBLASTSync() {
        return mUsingBLASTSyncTransaction;
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.REMOVE_CONTENT_MODE_UNDEFINED;
import static android.view.WindowManagerGlobal.ADD_OKAY;
import static android.view.WindowManagerGlobal.RELAYOUT_DEFER_SURFACE_DESTROY;
import static android.view.WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC;
import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_INVALID;

@@ -2110,6 +2111,10 @@ public class WindowManagerService extends IWindowManager.Stub
                win.finishSeamlessRotation(false /* timeout */);
            }

            if (win.useBLASTSync()) {
                result |= RELAYOUT_RES_BLAST_SYNC;
            }

            int attrChanges = 0;
            int flagChanges = 0;
            int privateFlagChanges = 0;
+8 −3
Original line number Diff line number Diff line
@@ -53,8 +53,9 @@ public class TaskOrganizerMultiWindowTest extends Activity {
                return true;
            }

            float x = e.getX(0);
            float x = e.getRawX(0);
            float ratio = (float) x / (float) getWidth() ;
            ratio = 1-ratio;

            LinearLayout.LayoutParams lp1 =
                new LinearLayout.LayoutParams(0,
@@ -172,10 +173,14 @@ public class TaskOrganizerMultiWindowTest extends Activity {
        setContentView(splitView);
    }

    private void addFlags(Intent intent) {
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
    }

    Intent makeSettingsIntent() {
        Intent intent = new Intent();
        intent.setAction(android.provider.Settings.ACTION_SETTINGS);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        addFlags(intent);
        return intent;
    }

@@ -183,7 +188,7 @@ public class TaskOrganizerMultiWindowTest extends Activity {
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_APP_CONTACTS);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        addFlags(intent);
        return intent;
    }

Loading