summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-10-23 12:41:23 +0800
committerHung-ying Tyan <tyanh@google.com>2012-10-24 15:13:48 +0800
commit26e7a71df39c4b6923c0d36e32cc7ae0ebd72a05 (patch)
treefec298df725cc7a5e5e1456aad5874e222e79a1a /src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java
parentbbd30e0aab09feba5d3e038433895561ab255640 (diff)
downloadandroid_packages_apps_Snap-26e7a71df39c4b6923c0d36e32cc7ae0ebd72a05.tar.gz
android_packages_apps_Snap-26e7a71df39c4b6923c0d36e32cc7ae0ebd72a05.tar.bz2
android_packages_apps_Snap-26e7a71df39c4b6923c0d36e32cc7ae0ebd72a05.zip
Use TiledTexture for thumbnails.
1. Use TiledTexture for thumbnails to prevent jank in uploading big thumbnails. (e.g., 512 * 512) 2. Use larger thumbnails (DISPLAY_LONG_SIDE / 5). bug: 7381302 Change-Id: I7661d648373e893b40b2a0304037171760091e00
Diffstat (limited to 'src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java')
-rw-r--r--src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java b/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java
index 233a8003d..70d7c273a 100644
--- a/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java
+++ b/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java
@@ -106,13 +106,20 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer {
}
}
- private static Texture checkTexture(Texture texture) {
+ private static Texture checkLabelTexture(Texture texture) {
return ((texture instanceof UploadedTexture)
&& ((UploadedTexture) texture).isUploading())
? null
: texture;
}
+ private static Texture checkContentTexture(Texture texture) {
+ return ((texture instanceof TiledTexture)
+ && !((TiledTexture) texture).isReady())
+ ? null
+ : texture;
+ }
+
@Override
public int renderSlot(GLCanvas canvas, int index, int pass, int width, int height) {
AlbumSetEntry entry = mDataWindow.get(index);
@@ -155,7 +162,7 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer {
GLCanvas canvas, AlbumSetEntry entry, int width, int height) {
int renderRequestFlags = 0;
- Texture content = checkTexture(entry.content);
+ Texture content = checkContentTexture(entry.content);
if (content == null) {
content = mWaitLoadingTexture;
entry.isWaitLoadingDisplayed = true;
@@ -175,7 +182,7 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer {
protected int renderLabel(
GLCanvas canvas, AlbumSetEntry entry, int width, int height) {
- Texture content = checkTexture(entry.labelTexture);
+ Texture content = checkLabelTexture(entry.labelTexture);
if (content == null) {
content = mWaitLoadingTexture;
}