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

Commit fc736869 authored by John Reck's avatar John Reck
Browse files

Switch to pbuffer surface sooner

Bug: 27286867

If the system/app is slow, it might take too long to
stop drawing. Switch the ordering of destroying stuff so
that we switch to the pbuffer surface first, then do
cleanup

Change-Id: If64a3dbb71bb9fd53567231590436a89b2f1a09e
parent c96955d9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1078,8 +1078,10 @@ public final class ViewRootImpl implements ViewParent,
                scheduleTraversals();
            } else {
                if (mAttachInfo.mHardwareRenderer != null) {
                    mAttachInfo.mHardwareRenderer.destroyHardwareResources(mView);
                    // TODO: Temporary to help track down b/27286867
                    Log.d(mTag, "WindowStopped on " + getTitle());
                    mAttachInfo.mHardwareRenderer.updateSurface(null);
                    mAttachInfo.mHardwareRenderer.destroyHardwareResources(mView);
                }
            }
        }
+6 −0
Original line number Diff line number Diff line
@@ -270,6 +270,12 @@ bool EglManager::makeCurrent(EGLSurface surface, EGLint* errOut) {
        // Ensure we always have a valid surface & context
        surface = mPBufferSurface;
    }
    // TODO: Temporary to help diagnose b/27286867
    if (mCurrentSurface == mPBufferSurface || surface == mPBufferSurface) {
        ALOGD("Switching from surface %p%s to %p%s", mCurrentSurface,
                mCurrentSurface == mPBufferSurface ? " (pbuffer)" : "",
                        surface, surface == mPBufferSurface ? " (pbuffer)" : "");
    }
    if (!eglMakeCurrent(mEglDisplay, surface, surface, mEglContext)) {
        if (errOut) {
            *errOut = eglGetError();