diff options
4 files changed, 21 insertions, 6 deletions
diff --git a/library/src/main/java/com/bumptech/glide/BitmapRequestBuilder.java b/library/src/main/java/com/bumptech/glide/BitmapRequestBuilder.java index 9d43c8cc..52fa9f8f 100644 --- a/library/src/main/java/com/bumptech/glide/BitmapRequestBuilder.java +++ b/library/src/main/java/com/bumptech/glide/BitmapRequestBuilder.java @@ -5,6 +5,7 @@ import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.os.ParcelFileDescriptor; import android.view.animation.Animation; + import com.bumptech.glide.load.DecodeFormat; import com.bumptech.glide.load.Encoder; import com.bumptech.glide.load.ResourceDecoder; @@ -39,7 +40,7 @@ public class BitmapRequestBuilder<ModelType, TranscodeType> extends GenericReque Bitmap, TranscodeType> { private final BitmapPool bitmapPool; private Downsampler downsampler = Downsampler.AT_LEAST; - private DecodeFormat decodeFormat = DecodeFormat.PREFER_RGB_565; + private DecodeFormat decodeFormat = DecodeFormat.ALWAYS_ARGB_8888; private ResourceDecoder<InputStream, Bitmap> imageDecoder; private ResourceDecoder<ParcelFileDescriptor, Bitmap> videoDecoder; private Glide glide; @@ -147,7 +148,7 @@ public class BitmapRequestBuilder<ModelType, TranscodeType> extends GenericReque /** * Sets the preferred format for {@link Bitmap}s decoded in this request. Defaults to - * {@link DecodeFormat#PREFER_RGB_565}. This replaces any previous calls to {@link #imageDecoder(ResourceDecoder)}, + * {@link DecodeFormat#ALWAYS_ARGB_8888}. This replaces any previous calls to {@link #imageDecoder(ResourceDecoder)}, * {@link #videoDecoder(ResourceDecoder)} and {@link #decoder(ResourceDecoder)} with default decoders with the * appropriate options set. * diff --git a/library/src/main/java/com/bumptech/glide/load/engine/Engine.java b/library/src/main/java/com/bumptech/glide/load/engine/Engine.java index 7aaf258d..a38dee4e 100644 --- a/library/src/main/java/com/bumptech/glide/load/engine/Engine.java +++ b/library/src/main/java/com/bumptech/glide/load/engine/Engine.java @@ -4,6 +4,7 @@ import android.os.Handler; import android.os.Looper; import android.os.MessageQueue; import android.util.Log; + import com.bumptech.glide.Priority; import com.bumptech.glide.load.Encoder; import com.bumptech.glide.load.Key; @@ -104,6 +105,9 @@ public class Engine implements EngineJobListener, MemoryCache.ResourceRemovedLis final String id = fetcher.getId(); EngineKey key = keyFactory.buildKey(id, width, height, cacheDecoder, decoder, transformation, encoder, transcoder, sourceEncoder); + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "loading: " + key); + } Resource cached = cache.remove(key); if (cached != null) { @@ -177,10 +181,19 @@ public class Engine implements EngineJobListener, MemoryCache.ResourceRemovedLis @Override public void onResourceReleased(Key cacheKey, Resource resource) { + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "released: " + cacheKey); + } activeResources.remove(cacheKey); if (resource.isCacheable()) { + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "recaching: " + cacheKey); + } cache.put(cacheKey, resource); } else { + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "recycling: " + cacheKey); + } resource.recycle(); } } diff --git a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/FileDescriptorBitmapDecoder.java b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/FileDescriptorBitmapDecoder.java index 15dc4904..fb056d43 100644 --- a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/FileDescriptorBitmapDecoder.java +++ b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/FileDescriptorBitmapDecoder.java @@ -2,10 +2,11 @@ package com.bumptech.glide.load.resource.bitmap; import android.graphics.Bitmap; import android.os.ParcelFileDescriptor; -import com.bumptech.glide.load.engine.Resource; + +import com.bumptech.glide.load.DecodeFormat; import com.bumptech.glide.load.ResourceDecoder; +import com.bumptech.glide.load.engine.Resource; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; -import com.bumptech.glide.load.DecodeFormat; import java.io.IOException; @@ -15,7 +16,7 @@ public class FileDescriptorBitmapDecoder implements ResourceDecoder<ParcelFileDe private DecodeFormat decodeFormat; public FileDescriptorBitmapDecoder(BitmapPool bitmapPool) { - this(new VideoBitmapDecoder(), bitmapPool, DecodeFormat.PREFER_RGB_565); + this(new VideoBitmapDecoder(), bitmapPool, DecodeFormat.ALWAYS_ARGB_8888); } public FileDescriptorBitmapDecoder(VideoBitmapDecoder bitmapDecoder, BitmapPool bitmapPool, diff --git a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder.java b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder.java index b8bdb5ba..0064e2fa 100644 --- a/library/src/main/java/com/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder.java +++ b/library/src/main/java/com/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder.java @@ -23,7 +23,7 @@ public class StreamBitmapDecoder implements ResourceDecoder<InputStream, Bitmap> } public StreamBitmapDecoder(BitmapPool bitmapPool) { - this(Downsampler.AT_LEAST, bitmapPool, DecodeFormat.PREFER_RGB_565); + this(Downsampler.AT_LEAST, bitmapPool, DecodeFormat.ALWAYS_ARGB_8888); } public StreamBitmapDecoder(Downsampler downsampler, BitmapPool bitmapPool, DecodeFormat decodeFormat) { |