summaryrefslogtreecommitdiff
path: root/gui/apitrace.cpp
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2013-10-11 18:02:26 -0400
committerZack Rusin <zack@kde.org>2013-10-11 18:04:12 -0400
commitd9d9d22837705de6a2c42ad3f9b23223a2b98fe0 (patch)
treef3fbebaa2fb0ae6bce32c5448defc3a1854f42cc /gui/apitrace.cpp
parent52fc2b017b6914afb3799601b6e93f9306af0058 (diff)
Implement grouping of calls.
Use glPushDebugGroup and glPopDebugGroup to create nested groups of calls. It makes it easy to neatly group related calls (e.g. from nested function calls) into subgroups.
Diffstat (limited to 'gui/apitrace.cpp')
-rw-r--r--gui/apitrace.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/gui/apitrace.cpp b/gui/apitrace.cpp
index 671fc683..db574179 100644
--- a/gui/apitrace.cpp
+++ b/gui/apitrace.cpp
@@ -19,9 +19,9 @@ ApiTrace::ApiTrace()
connect(m_loader, SIGNAL(framesLoaded(const QList<ApiTraceFrame*>)),
this, SLOT(addFrames(const QList<ApiTraceFrame*>)));
connect(m_loader,
- SIGNAL(frameContentsLoaded(ApiTraceFrame*,QVector<ApiTraceCall*>,quint64)),
+ SIGNAL(frameContentsLoaded(ApiTraceFrame*,QVector<ApiTraceCall*>, QVector<ApiTraceCall*>,quint64)),
this,
- SLOT(loaderFrameLoaded(ApiTraceFrame*,QVector<ApiTraceCall*>,quint64)));
+ SLOT(loaderFrameLoaded(ApiTraceFrame*,QVector<ApiTraceCall*>,QVector<ApiTraceCall*>,quint64)));
connect(m_loader, SIGNAL(guessedApi(int)),
this, SLOT(guessedApi(int)));
connect(m_loader, SIGNAL(finishedParsing()),
@@ -107,7 +107,7 @@ int ApiTrace::numCallsInFrame(int idx) const
{
const ApiTraceFrame *frame = frameAt(idx);
if (frame) {
- return frame->numChildren();
+ return frame->numTotalCalls();
} else {
return 0;
}
@@ -263,6 +263,7 @@ void ApiTrace::finishedParsing()
}
void ApiTrace::loaderFrameLoaded(ApiTraceFrame *frame,
+ const QVector<ApiTraceCall*> &topLevelItems,
const QVector<ApiTraceCall*> &calls,
quint64 binaryDataSize)
{
@@ -270,7 +271,7 @@ void ApiTrace::loaderFrameLoaded(ApiTraceFrame *frame,
if (!frame->isLoaded()) {
emit beginLoadingFrame(frame, calls.size());
- frame->setCalls(calls, binaryDataSize);
+ frame->setCalls(topLevelItems, calls, binaryDataSize);
emit endLoadingFrame(frame);
m_loadingFrames.remove(frame);
}
@@ -444,7 +445,7 @@ int ApiTrace::callInFrame(int callIdx) const
for (int frameIdx = 0; frameIdx < m_frames.size(); ++frameIdx) {
const ApiTraceFrame *frame = m_frames[frameIdx];
unsigned numCallsInFrame = frame->isLoaded()
- ? frame->numChildren()
+ ? frame->numTotalCalls()
: frame->numChildrenToLoad();
unsigned firstCall = numCalls;
unsigned endCall = numCalls + numCallsInFrame;