|
19 | 19 | import com.bumptech.glide.load.resource.bitmap.DownsampleStrategy.SampleSizeRounding;
|
20 | 20 | import com.bumptech.glide.request.RequestOptions;
|
21 | 21 | import com.bumptech.glide.request.target.Target;
|
| 22 | +import com.bumptech.glide.util.LogTime; |
22 | 23 | import com.bumptech.glide.util.Preconditions;
|
23 | 24 | import com.bumptech.glide.util.Util;
|
24 | 25 | import java.io.IOException;
|
@@ -216,6 +217,7 @@ private Bitmap decodeFromWrappedStreams(InputStream is,
|
216 | 217 | DecodeFormat decodeFormat, boolean isHardwareConfigAllowed, int requestedWidth,
|
217 | 218 | int requestedHeight, boolean fixBitmapToRequestedDimensions,
|
218 | 219 | DecodeCallbacks callbacks) throws IOException {
|
| 220 | + long startTime = LogTime.getLogTime(); |
219 | 221 |
|
220 | 222 | int[] sourceDimensions = getDimensions(is, options, callbacks, bitmapPool);
|
221 | 223 | int sourceWidth = sourceDimensions[0];
|
@@ -278,7 +280,7 @@ && shouldUsePool(is)) {
|
278 | 280 |
|
279 | 281 | if (Log.isLoggable(TAG, Log.VERBOSE)) {
|
280 | 282 | logDecode(sourceWidth, sourceHeight, sourceMimeType, options, downsampled,
|
281 |
| - requestedWidth, requestedHeight); |
| 283 | + requestedWidth, requestedHeight, startTime); |
282 | 284 | }
|
283 | 285 |
|
284 | 286 | Bitmap rotated = null;
|
@@ -518,15 +520,17 @@ private static boolean isScaling(BitmapFactory.Options options) {
|
518 | 520 | }
|
519 | 521 |
|
520 | 522 | private static void logDecode(int sourceWidth, int sourceHeight, String outMimeType,
|
521 |
| - BitmapFactory.Options options, Bitmap result, int requestedWidth, int requestedHeight) { |
| 523 | + BitmapFactory.Options options, Bitmap result, int requestedWidth, int requestedHeight, |
| 524 | + long startTime) { |
522 | 525 | Log.v(TAG, "Decoded " + getBitmapString(result)
|
523 | 526 | + " from [" + sourceWidth + "x" + sourceHeight + "] " + outMimeType
|
524 | 527 | + " with inBitmap " + getInBitmapString(options)
|
525 | 528 | + " for [" + requestedWidth + "x" + requestedHeight + "]"
|
526 | 529 | + ", sample size: " + options.inSampleSize
|
527 | 530 | + ", density: " + options.inDensity
|
528 | 531 | + ", target density: " + options.inTargetDensity
|
529 |
| - + ", thread: " + Thread.currentThread().getName()); |
| 532 | + + ", thread: " + Thread.currentThread().getName() |
| 533 | + + ", duration: " + LogTime.getElapsedMillis(startTime)); |
530 | 534 | }
|
531 | 535 |
|
532 | 536 | private static String getInBitmapString(BitmapFactory.Options options) {
|
|
0 commit comments