diff options
author | Owen Lin <owenlin@google.com> | 2012-05-18 11:30:26 -0700 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2012-05-22 14:28:35 -0700 |
commit | 68386e085d3e2338be74996ff99672ff849467cb (patch) | |
tree | 74e1bcd78e4c172ecbd04946f1a5c4c624d265fd /src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java | |
parent | c5c5f2558e9ed3bc46a94c5515481b1dac9ffd77 (diff) | |
download | android_packages_apps_Snap-68386e085d3e2338be74996ff99672ff849467cb.tar.gz android_packages_apps_Snap-68386e085d3e2338be74996ff99672ff849467cb.tar.bz2 android_packages_apps_Snap-68386e085d3e2338be74996ff99672ff849467cb.zip |
Add a new state uploading to UploadedTexture.
This state means the texture is being uploaded in background and should
not be drawn now to prevent janking.
Sometimes, we may lose GLContext and we will need to reupload
textures again. In this case, we would like to upload these texture in
foreground instead of using TextureUploader.
(for simplicity since this won't happen too often).
bug: 6519344
Change-Id: Ic5d7547c6a0eb4b044b79aa0eb4eb52397faac03
Diffstat (limited to 'src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java')
-rw-r--r-- | src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java b/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java index b0e615392..ac810336d 100644 --- a/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java +++ b/src/com/android/gallery3d/ui/AlbumSetSlotRenderer.java @@ -99,9 +99,9 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer { } } - private static Texture checkTexture(GLCanvas canvas, Texture texture) { - return ((texture == null) || ((texture instanceof UploadedTexture) - && !((UploadedTexture) texture).isContentValid(canvas))) + private static Texture checkTexture(Texture texture) { + return ((texture instanceof UploadedTexture) + && ((UploadedTexture) texture).isUploading()) ? null : texture; } @@ -142,7 +142,7 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer { GLCanvas canvas, AlbumSetEntry entry, int width, int height) { int renderRequestFlags = 0; - Texture content = checkTexture(canvas, entry.content); + Texture content = checkTexture(entry.content); if (content == null) { content = mWaitLoadingTexture; entry.isWaitLoadingDisplayed = true; @@ -173,7 +173,7 @@ public class AlbumSetSlotRenderer extends AbstractSlotRenderer { GLCanvas canvas, AlbumSetEntry entry, int width, int height) { // We show the loading message only when the album is still loading // (Not when we are still preparing the label) - Texture content = checkTexture(canvas, entry.label); + Texture content = checkTexture(entry.label); if (entry.album == null) { content = mDataWindow.getLoadingTexture(); } |