diff options
author | Sam Judd <judds@google.com> | 2014-06-16 19:27:29 -0700 |
---|---|---|
committer | Sam Judd <judds@google.com> | 2014-06-16 19:27:29 -0700 |
commit | 4e93521eec37e6ced67c02fba9ba46ae96ec049b (patch) | |
tree | 370092a92965d4072706caca3a56ed5f62ddaf3a /third_party/gif_decoder | |
parent | f54f934159582081ef58a136412f420be209ad1b (diff) | |
download | glide-4e93521eec37e6ced67c02fba9ba46ae96ec049b.tar.gz |
Fix gifs showing images from recycled bitmaps.
Diffstat (limited to 'third_party/gif_decoder')
-rw-r--r-- | third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java index 131a9683..1ac010d7 100644 --- a/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java +++ b/third_party/gif_decoder/src/main/java/com/bumptech/glide/gifdecoder/GifDecoder.java @@ -25,6 +25,7 @@ package com.bumptech.glide.gifdecoder; */ import android.graphics.Bitmap; +import android.graphics.Color; import android.util.Log; import java.io.ByteArrayOutputStream; @@ -585,6 +586,9 @@ public class GifDecoder { Bitmap result = bitmapProvider.obtain(header.width, header.height, targetConfig); if (result == null) { result = Bitmap.createBitmap(header.width, header.height, targetConfig); + } else { + // If we're reusing a bitmap it may have other things drawn in it which we need to remove. + result.eraseColor(Color.TRANSPARENT); } return result; } |