summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2013-04-12 18:09:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-12 18:09:58 -0700
commitde1fae77b6947c8696229ca113a812bc0b79e821 (patch)
treeee45520fc843547fea61bc4941bb9344972a0a97 /graphics
parent5069101c08ff11e78bfab7eeb7360b0b12e3b54b (diff)
parent00c4c67069b9d13005ae072b8744c728aa73f99a (diff)
downloadframeworks_base-de1fae77b6947c8696229ca113a812bc0b79e821.zip
frameworks_base-de1fae77b6947c8696229ca113a812bc0b79e821.tar.gz
frameworks_base-de1fae77b6947c8696229ca113a812bc0b79e821.tar.bz2
am 00c4c670: am 301e95f2: Merge "Add a little more resource load tracing." into jb-mr2-dev
* commit '00c4c67069b9d13005ae072b8744c728aa73f99a': Add a little more resource load tracing.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/drawable/Drawable.java26
1 files changed, 21 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index 1a67970..66f7a5e 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -17,6 +17,7 @@
package android.graphics.drawable;
import android.graphics.Insets;
+import android.os.Trace;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -756,7 +757,12 @@ public abstract class Drawable {
* Create a drawable from an inputstream
*/
public static Drawable createFromStream(InputStream is, String srcName) {
- return createFromResourceStream(null, null, is, srcName, null);
+ Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, srcName != null ? srcName : "Unknown drawable");
+ try {
+ return createFromResourceStream(null, null, is, srcName, null);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_RESOURCES);
+ }
}
/**
@@ -765,7 +771,12 @@ public abstract class Drawable {
*/
public static Drawable createFromResourceStream(Resources res, TypedValue value,
InputStream is, String srcName) {
- return createFromResourceStream(res, value, is, srcName, null);
+ Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, srcName != null ? srcName : "Unknown drawable");
+ try {
+ return createFromResourceStream(res, value, is, srcName, null);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_RESOURCES);
+ }
}
/**
@@ -911,9 +922,14 @@ public abstract class Drawable {
return null;
}
- Bitmap bm = BitmapFactory.decodeFile(pathName);
- if (bm != null) {
- return drawableFromBitmap(null, bm, null, null, null, pathName);
+ Trace.traceBegin(Trace.TRACE_TAG_RESOURCES, pathName);
+ try {
+ Bitmap bm = BitmapFactory.decodeFile(pathName);
+ if (bm != null) {
+ return drawableFromBitmap(null, bm, null, null, null, pathName);
+ }
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_RESOURCES);
}
return null;