From 3127c2a471dbefda916701d9b3837ce109ea7d49 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 26 Jan 2016 18:48:44 -0800 Subject: [PATCH] Start drawing immediately We used to have a condition to start drawing only in the second traversal, which added a delay of about 10-15ms. We believe that we don't need this anymore, because we have other means of synchronizing the app transition animation with the app drawing - we wait for all surfaces to be drawn in window manager. Bug: 21035872 Change-Id: I5094a1377817dc7e0a2392cc8f522e99cd7b4d6e --- core/java/android/view/ViewRootImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 5d41477d3c0f7..25eecc490ea94 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -2099,7 +2099,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(); @@ -2148,6 +2148,7 @@ public final class ViewRootImpl implements ViewParent, } } } + private void handleOutOfResourcesException(Surface.OutOfResourcesException e) { Log.e(mTag, "OutOfResourcesException initializing HW surface", e); try {