summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-02-19 23:33:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-02-19 23:34:30 +0000
commit9943155b4db517deb72bd433d1cc9916bd84ae70 (patch)
tree7f4a95986752891a5e4428aec70519da6a5890b3 /core/java
parent22cb5b37a572270788f00881727f483da373ec05 (diff)
parentd17043dcb49d4f060349a8bd58abcddcf3bac9a2 (diff)
downloadframeworks_base-9943155b4db517deb72bd433d1cc9916bd84ae70.zip
frameworks_base-9943155b4db517deb72bd433d1cc9916bd84ae70.tar.gz
frameworks_base-9943155b4db517deb72bd433d1cc9916bd84ae70.tar.bz2
Merge "Show Dalvik stack trace if an exception happens at draw time External bug: http://code.google.com/p/android/issues/detail?id=49379"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/HardwareRenderer.java52
1 files changed, 21 insertions, 31 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index c6e145f..7929112 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -444,16 +444,6 @@ public abstract class HardwareRenderer {
/**
* Creates a new display list that can be used to record batches of
* drawing operations.
- *
- * @return A new display list.
- */
- public DisplayList createDisplayList() {
- return createDisplayList(null);
- }
-
- /**
- * Creates a new display list that can be used to record batches of
- * drawing operations.
*
* @param name The name of the display list, used for debugging purpose. May be null.
*
@@ -1356,31 +1346,25 @@ public abstract class HardwareRenderer {
dirty = beginFrame(canvas, dirty, surfaceState);
+ DisplayList displayList = buildDisplayList(view, canvas);
+
int saveCount = 0;
int status = DisplayList.STATUS_DONE;
try {
- view.mRecreateDisplayList = (view.mPrivateFlags & View.PFLAG_INVALIDATED)
- == View.PFLAG_INVALIDATED;
- view.mPrivateFlags &= ~View.PFLAG_INVALIDATED;
-
- long buildDisplayListStartTime = startBuildDisplayListProfiling();
- canvas.clearLayerUpdates();
-
- DisplayList displayList = buildDisplayList(view);
status = prepareFrame(dirty);
saveCount = canvas.save();
callbacks.onHardwarePreDraw(canvas);
- endBuildDisplayListProfiling(buildDisplayListStartTime);
-
if (displayList != null) {
status = drawDisplayList(attachInfo, canvas, displayList, status);
} else {
// Shouldn't reach here
view.draw(canvas);
}
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "An error has occurred while drawing:", e);
} finally {
callbacks.onHardwarePostDraw(canvas);
canvas.restoreToCount(saveCount);
@@ -1408,6 +1392,23 @@ public abstract class HardwareRenderer {
return false;
}
+ private DisplayList buildDisplayList(View view, HardwareCanvas canvas) {
+ view.mRecreateDisplayList = (view.mPrivateFlags & View.PFLAG_INVALIDATED)
+ == View.PFLAG_INVALIDATED;
+ view.mPrivateFlags &= ~View.PFLAG_INVALIDATED;
+
+ long buildDisplayListStartTime = startBuildDisplayListProfiling();
+ canvas.clearLayerUpdates();
+
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, "getDisplayList");
+ DisplayList displayList = view.getDisplayList();
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+
+ endBuildDisplayListProfiling(buildDisplayListStartTime);
+
+ return displayList;
+ }
+
abstract void drawProfileData(View.AttachInfo attachInfo);
private Rect beginFrame(HardwareCanvas canvas, Rect dirty, int surfaceState) {
@@ -1455,17 +1456,6 @@ public abstract class HardwareRenderer {
}
}
- private static DisplayList buildDisplayList(View view) {
- DisplayList displayList;
- Trace.traceBegin(Trace.TRACE_TAG_VIEW, "getDisplayList");
- try {
- displayList = view.getDisplayList();
- } finally {
- Trace.traceEnd(Trace.TRACE_TAG_VIEW);
- }
- return displayList;
- }
-
private int prepareFrame(Rect dirty) {
int status;
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "prepareFrame");