From f1adfc490e9f58d653359b941cdbb5b9dad554b0 Mon Sep 17 00:00:00 2001 From: kayiz Date: Fri, 6 Dec 2013 11:06:52 +0800 Subject: Gallery2: fix screen flashing after rotating pictures After rotating a picture, it needs to redraw the bitmap, but the bitmap can not be available immediately, and it will draw a rectange of placeholder color (gray) first, then it redraw the bitmap, this make it seems like the screen flashing. We draw the placeholder color only if the texture is null. CRs-Fixed: 570056 Change-Id: I28bc65ba674906f39eae3d872988fe96511a3ecb --- src/com/android/gallery3d/ui/TiledScreenNail.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/gallery3d/ui/TiledScreenNail.java b/src/com/android/gallery3d/ui/TiledScreenNail.java index 860e230bb..0ade9389c 100644 --- a/src/com/android/gallery3d/ui/TiledScreenNail.java +++ b/src/com/android/gallery3d/ui/TiledScreenNail.java @@ -153,7 +153,7 @@ public class TiledScreenNail implements ScreenNail { @Override public void draw(GLCanvas canvas, int x, int y, int width, int height) { - if (mTexture == null || !mTexture.isReady()) { + if (mTexture == null) { if (mAnimationStartTime == ANIMATION_NOT_NEEDED) { mAnimationStartTime = ANIMATION_NEEDED; } @@ -177,7 +177,7 @@ public class TiledScreenNail implements ScreenNail { @Override public void draw(GLCanvas canvas, RectF source, RectF dest) { - if (mTexture == null || !mTexture.isReady()) { + if (mTexture == null) { canvas.fillRect(dest.left, dest.top, dest.width(), dest.height(), mPlaceholderColor); return; -- cgit v1.2.3