From 3bd73388114f851dcb67d1ce38966e4d22fd1d22 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Mon, 21 May 2012 16:52:25 -0700 Subject: Limit the size of a ScreenNail. bug:6528366 This bug was happened because we are trying to make a texture beyond the max size allowed in GL. Here is what we do in this CL: 1. Limit the size of a screen nail 2. Print warning message, if we try to allocate a texture beyond the size 3. Don't show fall-back animation if the image is not loaded yet. Change-Id: I004b1138efd0eef7ba11aa89556f67743ca46745 --- src/com/android/gallery3d/app/PhotoDataAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/com/android/gallery3d/app/PhotoDataAdapter.java') diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index 6ba1ff69b..29154a082 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -415,7 +415,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { // Create a default ScreenNail if the real one is not available yet. if (entry.screenNail == null) { - entry.screenNail = newDefaultScreenNail(item); + entry.screenNail = newPlaceholderScreenNail(item); if (offset == 0) updateTileProvider(entry); } @@ -632,7 +632,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { // If this is a temporary item, don't try to get its bitmap because // it won't be available. We will get its bitmap after a data reload. if (isTemporaryItem(mItem)) { - return newDefaultScreenNail(mItem); + return newPlaceholderScreenNail(mItem); } Bitmap bitmap = mItem.requestImage(MediaItem.TYPE_THUMBNAIL).run(jc); @@ -687,7 +687,7 @@ public class PhotoDataAdapter implements PhotoPage.Model { // Create a default ScreenNail when a ScreenNail is needed, but we don't yet // have one available (because the image data is still being saved, or the // Bitmap is still being loaded. - private ScreenNail newDefaultScreenNail(MediaItem item) { + private ScreenNail newPlaceholderScreenNail(MediaItem item) { int width = item.getWidth(); int height = item.getHeight(); return new BitmapScreenNail(width, height); -- cgit v1.2.3