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

Commit 48402400 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Immediately start drawing when becoming visible

There was some old outdated logic about aborting draw if we have a
new surface. This isn't needed anymore and actually can cause up
to 5-10ms first draw delay for apps.

Test: AM/WM Presubmit CTS tests
Bug: 126612374
Bug: 123643797
Change-Id: I73d354efaee099e6a1ca1557e79440dc16e4976f
parent d96f4fa1
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -1986,7 +1986,6 @@ public final class ViewRootImpl implements ViewParent,
        mIsInTraversal = true;
        mWillDrawSoon = true;
        boolean windowSizeMayChange = false;
        boolean newSurface = false;
        boolean surfaceChanged = false;
        WindowManager.LayoutParams lp = mWindowAttributes;

@@ -2387,13 +2386,7 @@ public final class ViewRootImpl implements ViewParent,
                if (!hadSurface) {
                    if (mSurface.isValid()) {
                        // If we are creating a new surface, then we need to
                        // completely redraw it.  Also, when we get to the
                        // point of drawing it we will hold off and schedule
                        // a new traversal instead.  This is so we can tell the
                        // window manager about all of the windows being displayed
                        // before actually drawing them, so it can display then
                        // all at once.
                        newSurface = true;
                        // completely redraw it.
                        mFullRedrawNeeded = true;
                        mPreviousTransparentRegion.setEmpty();

@@ -2778,7 +2771,7 @@ public final class ViewRootImpl implements ViewParent,

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

        if (!cancelDraw && !newSurface) {
        if (!cancelDraw) {
            if (mPendingTransitions != null && mPendingTransitions.size() > 0) {
                for (int i = 0; i < mPendingTransitions.size(); ++i) {
                    mPendingTransitions.get(i).startChangingAnimations();