summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2022-03-17 18:57:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-03-17 18:57:43 +0000
commit84858344466bebc0e39999670b48b282fd6bee2d (patch)
tree66ee31fd9a4844130a1252605d8a0d3cd1e3d98e
parent2f28ac5c3c224ab2974a787b59b184c1a26a51dd (diff)
parentf935dae4b656920c9ffae4338dbfa9ec90e9a242 (diff)
downloadsystemui-84858344466bebc0e39999670b48b282fd6bee2d.tar.gz
Merge "Use HARDWARE ALPHA_8 Bitmaps" into tm-dev
-rw-r--r--iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
index fc37dac..95e0b0f 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
@@ -594,6 +594,11 @@ public abstract class BaseIconCache {
Bitmap monoBitmap = Bitmap.createBitmap(
icon.getWidth(), icon.getHeight(), Config.ALPHA_8);
monoBitmap.copyPixelsFromBuffer(ByteBuffer.wrap(data));
+ Bitmap hwMonoBitmap = monoBitmap.copy(Config.HARDWARE, false /*isMutable*/);
+ if (hwMonoBitmap != null) {
+ monoBitmap.recycle();
+ monoBitmap = hwMonoBitmap;
+ }
try (BaseIconFactory factory = getIconFactory()) {
entry.bitmap.setMonoIcon(monoBitmap, factory);
}