Add Bitmap.compress to TRACE_TAG_RESOURCES
Bug: 16800719
TRACE_TAG_RESOURCES shows bitmap decoding, have it show
compressing as well
Change-Id: I04f62545be52698de5371a2594973fa336e7b2fa
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 4b00e22..4d0bb75 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.Trace;
import android.util.DisplayMetrics;
import java.io.OutputStream;
@@ -1004,8 +1005,11 @@
if (quality < 0 || quality > 100) {
throw new IllegalArgumentException("quality must be 0..100");
}
- return nativeCompress(mNativeBitmap, format.nativeInt, quality,
+ Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, "Bitmap.compress");
+ boolean result = nativeCompress(mNativeBitmap, format.nativeInt, quality,
stream, new byte[WORKING_COMPRESS_STORAGE]);
+ Trace.traceEnd(Trace.TRACE_TAG_RESOURCES);
+ return result;
}
/**