Add debug markers to OpenGLRenderer

These markers will be used to group the GL commands by View in the
OpenGL ES debugging tool. This will help correlate individual GL
calls to higher level components like Views.

Change-Id: I73607ba2e7224a80ac32527968261ee008f049c6
This commit is contained in:
Romain Guy
2012-01-30 17:41:55 -08:00
parent 275345b087
commit 13631f3da8
13 changed files with 94 additions and 10 deletions

View File

@ -19,9 +19,10 @@
#include "DisplayListLogBuffer.h"
#include "DisplayListRenderer.h"
#include <utils/String8.h>
#include "Caches.h"
#include <utils/String8.h>
namespace android {
namespace uirenderer {
@ -217,7 +218,7 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) {
indent[i] = ' ';
}
indent[count] = '\0';
ALOGD("%sStart display list (%p)", (char*) indent + 2, this);
ALOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string());
int saveCount = renderer.getSaveCount() - 1;
@ -562,9 +563,11 @@ bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level)
indent[i] = ' ';
}
indent[count] = '\0';
DISPLAY_LIST_LOGD("%sStart display list (%p)", (char*) indent + 2, this);
DISPLAY_LIST_LOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string());
#endif
renderer.startMark(mName.string());
DisplayListLogBuffer& logBuffer = DisplayListLogBuffer::getInstance();
int saveCount = renderer.getSaveCount() - 1;
while (!mReader.eof()) {
@ -575,7 +578,9 @@ bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level)
case DrawGLFunction: {
Functor *functor = (Functor *) getInt();
DISPLAY_LIST_LOGD("%s%s %p", (char*) indent, OP_NAMES[op], functor);
renderer.startMark("GL functor");
needsInvalidate |= renderer.callDrawGLFunction(functor, dirty);
renderer.endMark();
}
break;
case Save: {
@ -934,6 +939,8 @@ bool DisplayList::replay(OpenGLRenderer& renderer, Rect& dirty, uint32_t level)
}
}
renderer.endMark();
DISPLAY_LIST_LOGD("%sDone, returning %d", (char*) indent + 2, needsInvalidate);
return needsInvalidate;
}