summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@digia.com>2013-08-07 15:46:15 +0200
committerChristiaan Janssen <christiaan.janssen@digia.com>2013-08-08 11:54:29 +0300
commit502d929c7ffa391f93b3b691c0687f045294352e (patch)
tree57c19ffb50dac06b45f434d6eae2e1b5d1ef8a5b
parentbfb419717c3488065b8c032f72fea9c0694ae12d (diff)
downloadqt-creator-qp-2.8.tar.gz
QmlProfiler: fix issues with SceneGraphModelProxyqp-2.8
Change-Id: I1d58b158b7afb805ea03f439ec12b37acc8925c7 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
-rw-r--r--plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp
index 129419e16b..86066261a6 100644
--- a/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp
+++ b/plugins/qmlprofilerextension/scenegraphtimelinemodel.cpp
@@ -142,9 +142,18 @@ const QString SceneGraphTimelineModel::categoryLabel(int categoryIndex) const
int SceneGraphTimelineModel::findFirstIndex(qint64 startTime) const
{
int candidate = findFirstIndexNoParents(startTime);
- // because there's two threads synchronized, the right index could be one off
- if (candidate > 0 && d->eventList[candidate-1].startTime + d->eventList[candidate-1].duration >= startTime)
- return candidate - 1;
+ // because there's two asynchronous threads in the display,
+ // check the former event in same thread for false positives
+ int i = candidate - 1;
+ while (i >= 0) {
+ if (d->eventList[candidate].sgEventType == d->eventList[i].sgEventType) {
+ if (d->eventList[i].startTime + d->eventList[i].duration >= startTime)
+ candidate = i;
+ else
+ break;
+ }
+ i--;
+ }
return candidate;
}
@@ -395,7 +404,9 @@ void SceneGraphTimelineModel::loadData()
for (int i=0; i < timingFieldCount; i++)
newEvent.timing[i] = 0;
- d->eventList << newEvent;
+ // Filter out events with incorrect timings due to interrupted thread on server side
+ if (newEvent.duration > 0 && newEvent.startTime > 0)
+ d->eventList << newEvent;
lastRenderEvent = d->eventList.count()-1;
}
@@ -445,7 +456,10 @@ void SceneGraphTimelineModel::loadData()
newEvent.timing[2] = event.numericData3;
newEvent.timing[3] = event.numericData4;
- d->eventList << newEvent;
+ // Filter out events with incorrect timings due to interrupted thread on server side
+ if (newEvent.duration > 0 && newEvent.startTime > 0)
+ d->eventList << newEvent;
+
break;
}
case SceneGraphWindowsAnimations: {