diff options
| author | 2016-02-26 15:01:52 -0800 | |
|---|---|---|
| committer | 2016-02-26 15:43:09 -0800 | |
| commit | fc736869aced442057e5a2c16a9591dca1f93295 (patch) | |
| tree | 2c6d93e824ed81ffccb35c6c782fbd34b534229a | |
| parent | c96955d9bb997b51be5fa929b5a67349d0459c3a (diff) | |
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
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 4 | ||||
| -rw-r--r-- | libs/hwui/renderthread/EglManager.cpp | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 2da725fdc1ba..c5b165321d91 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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); } } } diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp index ac6a28fe6289..8def7ad03d34 100644 --- a/libs/hwui/renderthread/EglManager.cpp +++ b/libs/hwui/renderthread/EglManager.cpp @@ -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(); |