diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-02-19 18:11:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-06 09:51:33 +0200 |
commit | 2371ec96dad2a8433df212858674b53d9b213c9e (patch) | |
tree | dd553fca679d1eafe6e3bc17d5140d1d697868a7 /tools/qmlprofiler/qmlprofilerclient.cpp | |
parent | 788b8bbff92b8fe7563501db7708c2ac87b4e361 (diff) |
Properly support all events in trace files and clean up a bit.
In particular, use both message and range type to identify events so
that we can get rid of the messy type aliasing.
Task-number: QTBUG-36953
Change-Id: I691a7501aa285f78f7ce5b7017ef50628f44fcf7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerclient.cpp')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerclient.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tools/qmlprofiler/qmlprofilerclient.cpp b/tools/qmlprofiler/qmlprofilerclient.cpp index 23a75d0576..9322158280 100644 --- a/tools/qmlprofiler/qmlprofilerclient.cpp +++ b/tools/qmlprofiler/qmlprofilerclient.cpp @@ -188,7 +188,34 @@ void QmlProfilerClient::messageReceived(const QByteArray &data) } } else if (messageType == QQmlProfilerService::Complete) { emit complete(); - + } else if (messageType == QQmlProfilerService::SceneGraphFrame) { + int sgEventType; + int count = 0; + qint64 params[5]; + + stream >> sgEventType; + while (!stream.atEnd()) { + stream >> params[count++]; + } + while (count<5) + params[count++] = 0; + emit sceneGraphFrame((QQmlProfilerService::SceneGraphFrameType)sgEventType, time, + params[0], params[1], params[2], params[3], params[4]); + d->maximumTime = qMax(time, d->maximumTime); + } else if (messageType == QQmlProfilerService::PixmapCacheEvent) { + int pixEvTy, width = 0, height = 0, refcount = 0; + QString pixUrl; + stream >> pixEvTy >> pixUrl; + if (pixEvTy == (int)QQmlProfilerService::PixmapReferenceCountChanged || + pixEvTy == (int)QQmlProfilerService::PixmapCacheCountChanged) { + stream >> refcount; + } else if (pixEvTy == (int)QQmlProfilerService::PixmapSizeKnown) { + stream >> width >> height; + refcount = 1; + } + emit pixmapCache((QQmlProfilerService::PixmapEventType)pixEvTy, time, + QmlEventLocation(pixUrl,0,0), width, height, refcount); + d->maximumTime = qMax(time, d->maximumTime); } else { int range; stream >> range; |