diff options
| author | 2013-05-09 13:07:52 -0700 | |
|---|---|---|
| committer | 2013-05-09 17:00:46 -0700 | |
| commit | d4b43b3cf3ee109a5251228dcc1d9bc3c25ff150 (patch) | |
| tree | 979b473feacf5620c5b9c1e8c8af30367ded106f | |
| parent | 5d6dc425287e5651e3a1fdc32591b8791dd9dd18 (diff) | |
Fix off by one error in log tracking
bug:8875715
Additionally moves op logging before the op is executed, to print
correctly, in pre-order traversal
Change-Id: I4e9566261f8363c73739d183e6d82b854f72ffad
| -rw-r--r-- | libs/hwui/DeferredDisplayList.cpp | 4 | ||||
| -rw-r--r-- | libs/hwui/DisplayList.cpp | 2 | ||||
| -rw-r--r-- | libs/hwui/DisplayListLogBuffer.cpp | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp index f0084f205577..9323a3ae676a 100644 --- a/libs/hwui/DeferredDisplayList.cpp +++ b/libs/hwui/DeferredDisplayList.cpp @@ -98,8 +98,8 @@ public: #if DEBUG_DISPLAY_LIST_OPS_AS_EVENTS renderer.eventMark(op->name()); #endif - status |= op->applyDraw(renderer, dirty); logBuffer.writeCommand(0, op->name()); + status |= op->applyDraw(renderer, dirty); #if DEBUG_MERGE_BEHAVIOR Rect& bounds = mOps[i]->state.mBounds; @@ -200,10 +200,10 @@ public: } DrawOp* op = mOps[0]; - status_t status = op->multiDraw(renderer, dirty, mOps, mBounds); DisplayListLogBuffer& buffer = DisplayListLogBuffer::getInstance(); buffer.writeCommand(0, "multiDraw"); buffer.writeCommand(1, op->name()); + status_t status = op->multiDraw(renderer, dirty, mOps, mBounds); #if DEBUG_MERGE_BEHAVIOR renderer.drawScreenSpaceColorRect(mBounds.left, mBounds.top, mBounds.right, mBounds.bottom, diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp index 3c587976d007..c11741c12638 100644 --- a/libs/hwui/DisplayList.cpp +++ b/libs/hwui/DisplayList.cpp @@ -511,8 +511,8 @@ void DisplayList::iterate(OpenGLRenderer& renderer, T& handler, const int level) for (unsigned int i = 0; i < mDisplayListData->displayListOps.size(); i++) { DisplayListOp *op = mDisplayListData->displayListOps[i]; - handler(op, saveCount, mClipToBounds); logBuffer.writeCommand(level, op->name()); + handler(op, saveCount, mClipToBounds); } DISPLAY_LIST_LOGD("%*sRestoreToCount %d", (level + 1) * 2, "", restoreTo); diff --git a/libs/hwui/DisplayListLogBuffer.cpp b/libs/hwui/DisplayListLogBuffer.cpp index f039fcd9571f..45aaccac7abe 100644 --- a/libs/hwui/DisplayListLogBuffer.cpp +++ b/libs/hwui/DisplayListLogBuffer.cpp @@ -77,12 +77,13 @@ void DisplayListLogBuffer::outputCommands(FILE *file) if (tmpBufferPtr == mEnd) { break; } + + fprintf(file, "%*s%s\n", 2 * tmpBufferPtr->level, "", tmpBufferPtr->label); + OpLog* nextOp = tmpBufferPtr++; if (tmpBufferPtr > mBufferLast) { tmpBufferPtr = mBufferFirst; } - - fprintf(file, "%*s%s\n", tmpBufferPtr->level*2, "", tmpBufferPtr->label); } } |