summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2014-09-24 07:31:29 -0700
committerChet Haase <chet@google.com>2014-09-24 07:31:29 -0700
commit8eb48d26ccbde07140da3e798ca32182814ea237 (patch)
treeab784cb40177de9f1118b884b2cc5d1057979a19 /services
parent2610a1ba5d2657932d46b818472c2713bec7293e (diff)
downloadframeworks_base-8eb48d26ccbde07140da3e798ca32182814ea237.zip
frameworks_base-8eb48d26ccbde07140da3e798ca32182814ea237.tar.gz
frameworks_base-8eb48d26ccbde07140da3e798ca32182814ea237.tar.bz2
Avoid drawing the starting window twice
Logic in WindowState caused a delayed layout on the starting window, which forced another layout/draw pass, which was unnecessary. Making the resize call happen sooner means that that request gets lumped in with a pending layout request, so there's only one resulting draw. This saves not only the second drawing operation, but also the creation of an extra buffer in SurfaceFlinger for that second draw request. This buffer is temporary, but can be quite large on some devices and push the system over the memory edge in extreme situations. It's difficult to track this memory usage difference as the buffer resides at a very low level in the system. But you can see in systrace that the second allocation (and the second draw) is not happening after the fix. Issue #17570761 Constrain starting window to only one buffer Change-Id: I0e0fff7efdc812730706afccbfb020dea3f8d3e2
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 0baa2be..b4a7f04 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1373,7 +1373,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
final Rect stableInsets = mLastStableInsets;
final boolean reportDraw = mWinAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING;
final Configuration newConfig = configChanged ? mConfiguration : null;
- if (mClient instanceof IWindow.Stub) {
+ if (mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_STARTING
+ && mClient instanceof IWindow.Stub) {
// To prevent deadlock simulate one-way call if win.mClient is a local object.
mService.mH.post(new Runnable() {
@Override