diff options
author | Owen Lin <owenlin@google.com> | 2012-05-21 16:52:25 -0700 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2012-05-22 09:41:46 -0700 |
commit | 3bd73388114f851dcb67d1ce38966e4d22fd1d22 (patch) | |
tree | 0d210484fcac347f23abd0a349ad9a7dc7fca5ff /src/com/android/gallery3d/app/PhotoDataAdapter.java | |
parent | 7f9061790e1b67b6c674314ac41a399c550f8b88 (diff) | |
download | android_packages_apps_Snap-3bd73388114f851dcb67d1ce38966e4d22fd1d22.tar.gz android_packages_apps_Snap-3bd73388114f851dcb67d1ce38966e4d22fd1d22.tar.bz2 android_packages_apps_Snap-3bd73388114f851dcb67d1ce38966e4d22fd1d22.zip |
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
Diffstat (limited to 'src/com/android/gallery3d/app/PhotoDataAdapter.java')
-rw-r--r-- | src/com/android/gallery3d/app/PhotoDataAdapter.java | 6 |
1 files changed, 3 insertions, 3 deletions
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); |