diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2014-09-10 23:52:05 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2014-09-14 10:52:53 +0200 |
commit | faa982e7beda54bf28e0dbf1488428093bbbf485 (patch) | |
tree | fe23f0f6c899f2b93da12c789a529564054a107e /src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java | |
parent | 94c617a88428b64dfd486f4a3ed28547e09ef9c8 (diff) | |
download | android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.tar.gz android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.tar.bz2 android_packages_wallpapers_PhotoPhase-faa982e7beda54bf28e0dbf1488428093bbbf485.zip |
photophase: use etc1 compression when available
When avaliable this help to decrease the memory footprint. ETC1 compression
requieres to:
- be supported by opengl
- picture couldn't have an alpha channel
- compression times shouldn't be too higher (< 1000 ms)
- initial pictures doesn't be compressed (to speed up boot)
Change-Id: I87e41db3ca7f2ccb82d4af2763609f11d7e67121
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java')
-rw-r--r-- | src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java b/src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java index bbd3dec..ebfb4f6 100644 --- a/src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java +++ b/src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java @@ -41,6 +41,7 @@ public class BitmapUtils { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferQualityOverSpeed = false; options.inPreferredConfig = Bitmap.Config.RGB_565; + options.inDither = false; return BitmapFactory.decodeStream(bitmap, null, options); } @@ -56,6 +57,7 @@ public class BitmapUtils { // First decode with inJustDecodeBounds=true to check dimensions final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; + options.inPreferredConfig = Bitmap.Config.RGB_565; BitmapFactory.decodeFile(file.getAbsolutePath(), options); // Calculate inSampleSize (use 1024 as maximum size, the minimum supported @@ -70,7 +72,6 @@ public class BitmapUtils { options.inPreferQualityOverSpeed = false; options.inPurgeable = true; options.inInputShareable = true; - options.inDither = true; Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath(), options); if (bitmap == null) { return null; |