OSDN Git Service

frameworks/base: reduce the setTransactions
authorSanjeev Jakkilinki <sanjeevj@codeaurora.org>
Tue, 25 Apr 2017 10:47:54 +0000 (16:17 +0530)
committerArne Coucheron <arco68@gmail.com>
Mon, 10 Jul 2017 05:17:48 +0000 (07:17 +0200)
reduce the setTransactions from window manager service to
reduce the janks during animations for more numbered layers

Change-Id: Idb7a6d65b0602a6bbee01dc88411f1ebee453515

services/core/java/com/android/server/wm/DimLayer.java

index 052b2f5..4e00176 100644 (file)
@@ -193,13 +193,14 @@ public class DimLayer {
         }
 
         if (mDimSurface != null) {
-            mDimSurface.setPosition(mBounds.left, mBounds.top);
-            mDimSurface.setSize(mBounds.width(), mBounds.height());
-            if (DEBUG_DIM_LAYER) Slog.v(TAG,
-                    "adjustBounds user=" + mUser.toShortString() + " mBounds=" + mBounds);
+            if(!mLastBounds.equals(mBounds)) {
+                 mDimSurface.setPosition(mBounds.left, mBounds.top);
+                 mDimSurface.setSize(mBounds.width(), mBounds.height());
+                 if (DEBUG_DIM_LAYER) Slog.v(TAG,
+                        "adjustBounds user=" + mUser.toShortString() + " mBounds=" + mBounds);
+                 mLastBounds.set(mBounds);
+           }
         }
-
-        mLastBounds.set(mBounds);
     }
 
     private void getBoundsForFullscreen(Rect outBounds) {