From faa982e7beda54bf28e0dbf1488428093bbbf485 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Wed, 10 Sep 2014 23:52:05 +0200 Subject: 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 --- src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/cyanogenmod/wallpapers/photophase/utils/BitmapUtils.java') 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; -- cgit v1.2.3