diff options
| author | Chris Craik <ccraik@google.com> | 2013-06-13 00:36:37 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-06-13 00:36:37 +0000 |
| commit | af0fa4fd739aae14733615b6ee9a6b9ca025c628 (patch) | |
| tree | 9b8ac5e410c98777daf2f0fc4ee3706e0616d5b6 /libs/hwui/DisplayList.cpp | |
| parent | 4d5c4e21d3a714aa9690303f9f68957ebbec6790 (diff) | |
| parent | 9846de68f1b4f2720da421e5242017c28cfc93ed (diff) | |
| download | frameworks_base-af0fa4fd739aae14733615b6ee9a6b9ca025c628.zip frameworks_base-af0fa4fd739aae14733615b6ee9a6b9ca025c628.tar.gz frameworks_base-af0fa4fd739aae14733615b6ee9a6b9ca025c628.tar.bz2 | |
Merge "Remove crash workarounds, add logging"
Diffstat (limited to 'libs/hwui/DisplayList.cpp')
| -rw-r--r-- | libs/hwui/DisplayList.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp index b2d9915..f25ec2d 100644 --- a/libs/hwui/DisplayList.cpp +++ b/libs/hwui/DisplayList.cpp @@ -44,13 +44,14 @@ void DisplayList::outputLogBuffer(int fd) { } DisplayList::DisplayList(const DisplayListRenderer& recorder) : - mTransformMatrix(NULL), mTransformCamera(NULL), mTransformMatrix3D(NULL), + mDestroyed(false), mTransformMatrix(NULL), mTransformCamera(NULL), mTransformMatrix3D(NULL), mStaticMatrix(NULL), mAnimationMatrix(NULL) { initFromDisplayListRenderer(recorder); } DisplayList::~DisplayList() { + mDestroyed = true; clearResources(); } @@ -63,7 +64,6 @@ void DisplayList::destroyDisplayListDeferred(DisplayList* displayList) { void DisplayList::clearResources() { mDisplayListData = NULL; - mSize = 0; // TODO: shouldn't be needed, WAR possible use after delete mClipRectOp = NULL; mSaveLayerOp = NULL; @@ -169,6 +169,10 @@ void DisplayList::initFromDisplayListRenderer(const DisplayListRenderer& recorde mSaveLayerOp = new (alloc) SaveLayerOp(); mSaveOp = new (alloc) SaveOp(); mRestoreToCountOp = new (alloc) RestoreToCountOp(); + if (CC_UNLIKELY(!mSaveOp)) { // temporary debug logging + ALOGW("Error: %s's SaveOp not allocated, size %d", getName(), mSize); + CRASH(); + } mFunctorCount = recorder.getFunctorCount(); @@ -480,7 +484,11 @@ void DisplayList::replay(ReplayStateStruct& replayStruct, const int level) { */ template <class T> void DisplayList::iterate(OpenGLRenderer& renderer, T& handler, const int level) { - if (mSize == 0 || mAlpha <= 0 || CC_UNLIKELY(!mSaveOp)) { // TODO: shouldn't need mSaveOp check + if (CC_UNLIKELY(mDestroyed)) { // temporary debug logging + ALOGW("Error: %s is drawing after destruction, size %d", getName(), mSize); + CRASH(); + } + if (mSize == 0 || mAlpha <= 0) { DISPLAY_LIST_LOGD("%*sEmpty display list (%p, %s)", level * 2, "", this, mName.string()); return; } |
