From 2371ec96dad2a8433df212858674b53d9b213c9e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 19 Feb 2014 18:11:41 +0100 Subject: 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 --- tools/qmlprofiler/qmlprofilerclient.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'tools/qmlprofiler/qmlprofilerclient.cpp') 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; -- cgit v1.2.3