diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-04-18 00:12:56 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-18 00:12:56 +0000 |
commit | 953dc47fea26368a2958f3b4bfd94fc2ae929d51 (patch) | |
tree | 69f7f401acf41e689ebce534ef487d82d1c9f11d /src | |
parent | 781ede10dd7996acf53dcbc4e5b7af12414b307b (diff) | |
parent | 311420ffb28609f2cd437f0ff77efea2f56d38ed (diff) | |
download | android_packages_apps_Trebuchet-953dc47fea26368a2958f3b4bfd94fc2ae929d51.tar.gz android_packages_apps_Trebuchet-953dc47fea26368a2958f3b4bfd94fc2ae929d51.tar.bz2 android_packages_apps_Trebuchet-953dc47fea26368a2958f3b4bfd94fc2ae929d51.zip |
Fixing adaptive icon bounds caching
am: 311420ffb2
Change-Id: I3a7c7a698b3559ca31f218991540114d38210d94
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/graphics/IconNormalizer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher3/graphics/IconNormalizer.java b/src/com/android/launcher3/graphics/IconNormalizer.java index 13f322e8b..34d0b727c 100644 --- a/src/com/android/launcher3/graphics/IconNormalizer.java +++ b/src/com/android/launcher3/graphics/IconNormalizer.java @@ -74,6 +74,8 @@ public class IconNormalizer { private final Paint mPaintMaskShapeOutline; private final byte[] mPixels; private final int[] mPixelsARGB; + + private final Rect mAdaptiveIconBounds; private float mAdaptiveIconScale; // for each y, stores the position of the leftmost x and the rightmost x @@ -99,6 +101,7 @@ public class IconNormalizer { mLeftBorder = new float[mMaxSize]; mRightBorder = new float[mMaxSize]; mBounds = new Rect(); + mAdaptiveIconBounds = new Rect(); // Needed for isShape() method mBitmapARGB = Bitmap.createBitmap(mMaxSize, mMaxSize, Bitmap.Config.ARGB_8888); @@ -231,7 +234,7 @@ public class IconNormalizer { if (Utilities.isAtLeastO() && d instanceof AdaptiveIconDrawable && mAdaptiveIconScale != SCALE_NOT_INITIALIZED) { if (outBounds != null) { - outBounds.set(mBounds); + outBounds.set(mAdaptiveIconBounds); } return mAdaptiveIconScale; } @@ -347,6 +350,7 @@ public class IconNormalizer { if (Utilities.isAtLeastO() && d instanceof AdaptiveIconDrawable && mAdaptiveIconScale == SCALE_NOT_INITIALIZED) { mAdaptiveIconScale = scale; + mAdaptiveIconBounds.set(mBounds); } return scale; } |