diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-04-28 15:57:12 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2016-05-09 08:20:22 +0000 |
commit | 8d15633a22d5fb72db3342626e001bfbcf0e0d7b (patch) | |
tree | c63c6d7e735f5f1acce5df2e2780f560c71ff6b7 /src/plugins/qmlprofiler/pixmapcachemodel.cpp | |
parent | 61d94c5ccd12f676079a0d4c1fa7c4c0c73fc609 (diff) |
QmlProfiler: Add a QmlTypedEvent and extend QmlEvent
The QmlTypedEvent is mainly useful to read a generic QmlEvent and
QmlEventType from a QPacket. QmlEventType has a stream operator to do
exactly that. QmlEvent also gets further options to store 32-bit data
in addition to 64- and 8-bit data. Also, with the more generic storage
layout we can reduce the memory consumption of range events by 50%.
This comes at the cost of additional memory allocations for non-range
events, but as non-range events are significantly less frequent than
range events, this is a good tradeoff. Finally the new storage layout
lends itself to efficient serialization, which will help when
developing new storage and transfer formats for QML traces.
Change-Id: I420de68b0142f23c8fb2ca8b329d7ffe69c83fe0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/pixmapcachemodel.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/pixmapcachemodel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.cpp b/src/plugins/qmlprofiler/pixmapcachemodel.cpp index 3adace69c70..37392181d14 100644 --- a/src/plugins/qmlprofiler/pixmapcachemodel.cpp +++ b/src/plugins/qmlprofiler/pixmapcachemodel.cpp @@ -211,15 +211,15 @@ void PixmapCacheModel::loadData() // We can't have cached it before we knew the size Q_ASSERT(i->cacheState != Cached); - i->size.setWidth(event.numericData(0)); - i->size.setHeight(event.numericData(1)); + i->size.setWidth(event.number<qint32>(0)); + i->size.setHeight(event.number<qint32>(1)); newEvent.sizeIndex = i - pixmap.sizes.begin(); break; } if (newEvent.sizeIndex == -1) { newEvent.sizeIndex = pixmap.sizes.length(); - pixmap.sizes << PixmapState(event.numericData(0), event.numericData(1)); + pixmap.sizes << PixmapState(event.number<qint32>(0), event.number<qint32>(1)); } PixmapState &state = pixmap.sizes[newEvent.sizeIndex]; @@ -234,8 +234,8 @@ void PixmapCacheModel::loadData() case PixmapCacheCountChanged: {// Cache Size Changed Event pixmapStartTime = event.timestamp() + 1; // delay 1 ns for proper sorting - bool uncache = cumulatedCount > event.numericData(2); - cumulatedCount = event.numericData(2); + bool uncache = cumulatedCount > event.number<qint32>(2); + cumulatedCount = event.number<qint32>(2); qint64 pixSize = 0; // First try to find a preferred pixmap, which either is Corrupt and will be uncached |