Adapt to changes in QmlEventData

Change-Id: I2d01bb8b6684c9a9e3b2c4146f2101c31c7b0fa1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-11-13 15:38:56 +01:00
parent 6b1f863363
commit 499ac6ba6f
4 changed files with 65 additions and 65 deletions

View File

@@ -142,19 +142,19 @@ void InputEventsModel::loadData()
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex()];
if (!accepted(type)) if (!accepted(type))
continue; continue;
m_data.insert(insert(event.startTime, 0, type.detailType), m_data.insert(insert(event.startTime(), 0, type.detailType),
InputEvent(static_cast<QmlDebug::InputEventType>(event.numericData1), InputEvent(static_cast<QmlDebug::InputEventType>(event.numericData(0)),
event.numericData2, event.numericData3)); event.numericData(1), event.numericData(2)));
if (type.detailType == QmlDebug::Mouse) { if (type.detailType == QmlDebug::Mouse) {
if (m_mouseTypeId == -1) if (m_mouseTypeId == -1)
m_mouseTypeId = event.typeIndex; m_mouseTypeId = event.typeIndex();
} else if (m_keyTypeId == -1) { } else if (m_keyTypeId == -1) {
m_keyTypeId = event.typeIndex; m_keyTypeId = event.typeIndex();
} }
updateProgress(count(), simpleModel->getEvents().count()); updateProgress(count(), simpleModel->getEvents().count());
} }

View File

@@ -157,13 +157,13 @@ void MemoryUsageModel::loadData()
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex()];
while (!rangeStack.empty() && rangeStack.top().endTime < event.startTime) while (!rangeStack.empty() && rangeStack.top().endTime < event.startTime())
rangeStack.pop(); rangeStack.pop();
if (!accepted(type)) { if (!accepted(type)) {
if (type.rangeType != QmlDebug::MaximumRangeType) { if (type.rangeType != QmlDebug::MaximumRangeType) {
rangeStack.push(RangeStackFrame(event.typeIndex, event.startTime, rangeStack.push(RangeStackFrame(event.typeIndex(), event.startTime(),
event.startTime + event.duration)); event.startTime() + event.duration()));
} }
continue; continue;
} }
@@ -173,19 +173,19 @@ void MemoryUsageModel::loadData()
type.detailType == selectionId(currentUsageIndex) && type.detailType == selectionId(currentUsageIndex) &&
m_data[currentUsageIndex].originTypeIndex == rangeStack.top().originTypeIndex && m_data[currentUsageIndex].originTypeIndex == rangeStack.top().originTypeIndex &&
rangeStack.top().startTime < startTime(currentUsageIndex)) { rangeStack.top().startTime < startTime(currentUsageIndex)) {
m_data[currentUsageIndex].update(event.numericData1); m_data[currentUsageIndex].update(event.numericData(0));
currentUsage = m_data[currentUsageIndex].size; currentUsage = m_data[currentUsageIndex].size;
} else { } else {
MemoryAllocation allocation(event.typeIndex, currentUsage, MemoryAllocation allocation(event.typeIndex(), currentUsage,
rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex); rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex);
allocation.update(event.numericData1); allocation.update(event.numericData(0));
currentUsage = allocation.size; currentUsage = allocation.size;
if (currentUsageIndex != -1) { if (currentUsageIndex != -1) {
insertEnd(currentUsageIndex, insertEnd(currentUsageIndex,
event.startTime - startTime(currentUsageIndex) - 1); event.startTime() - startTime(currentUsageIndex) - 1);
} }
currentUsageIndex = insertStart(event.startTime, QmlDebug::SmallItem); currentUsageIndex = insertStart(event.startTime(), QmlDebug::SmallItem);
m_data.insert(currentUsageIndex, allocation); m_data.insert(currentUsageIndex, allocation);
} }
} }
@@ -196,20 +196,20 @@ void MemoryUsageModel::loadData()
m_data[currentJSHeapIndex].originTypeIndex == m_data[currentJSHeapIndex].originTypeIndex ==
rangeStack.top().originTypeIndex && rangeStack.top().originTypeIndex &&
rangeStack.top().startTime < startTime(currentJSHeapIndex)) { rangeStack.top().startTime < startTime(currentJSHeapIndex)) {
m_data[currentJSHeapIndex].update(event.numericData1); m_data[currentJSHeapIndex].update(event.numericData(0));
currentSize = m_data[currentJSHeapIndex].size; currentSize = m_data[currentJSHeapIndex].size;
} else { } else {
MemoryAllocation allocation(event.typeIndex, currentSize, MemoryAllocation allocation(event.typeIndex(), currentSize,
rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex); rangeStack.empty() ? -1 : rangeStack.top().originTypeIndex);
allocation.update(event.numericData1); allocation.update(event.numericData(0));
currentSize = allocation.size; currentSize = allocation.size;
if (currentSize > m_maxSize) if (currentSize > m_maxSize)
m_maxSize = currentSize; m_maxSize = currentSize;
if (currentJSHeapIndex != -1) if (currentJSHeapIndex != -1)
insertEnd(currentJSHeapIndex, insertEnd(currentJSHeapIndex,
event.startTime - startTime(currentJSHeapIndex) - 1); event.startTime() - startTime(currentJSHeapIndex) - 1);
currentJSHeapIndex = insertStart(event.startTime, type.detailType); currentJSHeapIndex = insertStart(event.startTime(), type.detailType);
m_data.insert(currentJSHeapIndex, allocation); m_data.insert(currentJSHeapIndex, allocation);
} }
} }

View File

@@ -171,13 +171,13 @@ void PixmapCacheModel::loadData()
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex()];
if (!accepted(type)) if (!accepted(type))
continue; continue;
PixmapCacheEvent newEvent; PixmapCacheEvent newEvent;
newEvent.pixmapEventType = static_cast<PixmapEventType>(type.detailType); newEvent.pixmapEventType = static_cast<PixmapEventType>(type.detailType);
qint64 pixmapStartTime = event.startTime; qint64 pixmapStartTime = event.startTime();
newEvent.urlIndex = -1; newEvent.urlIndex = -1;
for (QVector<Pixmap>::const_iterator it(m_pixmaps.cend()); it != m_pixmaps.cbegin();) { for (QVector<Pixmap>::const_iterator it(m_pixmaps.cend()); it != m_pixmaps.cbegin();) {
@@ -206,31 +206,31 @@ void PixmapCacheModel::loadData()
// We can't have cached it before we knew the size // We can't have cached it before we knew the size
Q_ASSERT(i->cacheState != Cached); Q_ASSERT(i->cacheState != Cached);
i->size.setWidth(event.numericData1); i->size.setWidth(event.numericData(0));
i->size.setHeight(event.numericData2); i->size.setHeight(event.numericData(1));
newEvent.sizeIndex = i - pixmap.sizes.begin(); newEvent.sizeIndex = i - pixmap.sizes.begin();
break; break;
} }
if (newEvent.sizeIndex == -1) { if (newEvent.sizeIndex == -1) {
newEvent.sizeIndex = pixmap.sizes.length(); newEvent.sizeIndex = pixmap.sizes.length();
pixmap.sizes << PixmapState(event.numericData1, event.numericData2); pixmap.sizes << PixmapState(event.numericData(0), event.numericData(1));
} }
PixmapState &state = pixmap.sizes[newEvent.sizeIndex]; PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
if (state.cacheState == ToBeCached) { if (state.cacheState == ToBeCached) {
lastCacheSizeEvent = updateCacheCount(lastCacheSizeEvent, pixmapStartTime, lastCacheSizeEvent = updateCacheCount(lastCacheSizeEvent, pixmapStartTime,
state.size.width() * state.size.height(), newEvent, state.size.width() * state.size.height(), newEvent,
event.typeIndex); event.typeIndex());
state.cacheState = Cached; state.cacheState = Cached;
} }
break; break;
} }
case PixmapCacheCountChanged: {// Cache Size Changed Event case PixmapCacheCountChanged: {// Cache Size Changed Event
pixmapStartTime = event.startTime + 1; // delay 1 ns for proper sorting pixmapStartTime = event.startTime() + 1; // delay 1 ns for proper sorting
bool uncache = cumulatedCount > event.numericData3; bool uncache = cumulatedCount > event.numericData(2);
cumulatedCount = event.numericData3; cumulatedCount = event.numericData(2);
qint64 pixSize = 0; qint64 pixSize = 0;
// First try to find a preferred pixmap, which either is Corrupt and will be uncached // First try to find a preferred pixmap, which either is Corrupt and will be uncached
@@ -281,7 +281,7 @@ void PixmapCacheModel::loadData()
} }
lastCacheSizeEvent = updateCacheCount(lastCacheSizeEvent, pixmapStartTime, pixSize, lastCacheSizeEvent = updateCacheCount(lastCacheSizeEvent, pixmapStartTime, pixSize,
newEvent, event.typeIndex); newEvent, event.typeIndex());
break; break;
} }
case PixmapLoadingStarted: { // Load case PixmapLoadingStarted: { // Load
@@ -301,7 +301,7 @@ void PixmapCacheModel::loadData()
PixmapState &state = pixmap.sizes[newEvent.sizeIndex]; PixmapState &state = pixmap.sizes[newEvent.sizeIndex];
state.loadState = Loading; state.loadState = Loading;
newEvent.typeId = event.typeIndex; newEvent.typeId = event.typeIndex();
state.started = insertStart(pixmapStartTime, newEvent.urlIndex + 1); state.started = insertStart(pixmapStartTime, newEvent.urlIndex + 1);
m_data.insert(state.started, newEvent); m_data.insert(state.started, newEvent);
break; break;
@@ -346,7 +346,7 @@ void PixmapCacheModel::loadData()
// If the pixmap loading wasn't started, start it at traceStartTime() // If the pixmap loading wasn't started, start it at traceStartTime()
if (state.loadState == Initial) { if (state.loadState == Initial) {
newEvent.pixmapEventType = PixmapLoadingStarted; newEvent.pixmapEventType = PixmapLoadingStarted;
newEvent.typeId = event.typeIndex; newEvent.typeId = event.typeIndex();
qint64 traceStart = modelManager()->traceTime()->startTime(); qint64 traceStart = modelManager()->traceTime()->startTime();
state.started = insert(traceStart, pixmapStartTime - traceStart, state.started = insert(traceStart, pixmapStartTime - traceStart,
newEvent.urlIndex + 1); newEvent.urlIndex + 1);

View File

@@ -136,7 +136,7 @@ void SceneGraphTimelineModel::loadData()
// combine the data of several eventtypes into two rows // combine the data of several eventtypes into two rows
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes(); const QVector<QmlProfilerDataModel::QmlEventTypeData> &types = simpleModel->getEventTypes();
foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) { foreach (const QmlProfilerDataModel::QmlEventData &event, simpleModel->getEvents()) {
const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex]; const QmlProfilerDataModel::QmlEventTypeData &type = types[event.typeIndex()];
if (!accepted(type)) if (!accepted(type))
continue; continue;
@@ -146,70 +146,70 @@ void SceneGraphTimelineModel::loadData()
// look incomplete if that was left out as the printf profiler lists it, too, and people // look incomplete if that was left out as the printf profiler lists it, too, and people
// are apparently comparing that. Unfortunately it is somewhat redundant as the other // are apparently comparing that. Unfortunately it is somewhat redundant as the other
// parts of the breakdown are usually very short. // parts of the breakdown are usually very short.
qint64 startTime = event.startTime - event.numericData1 - event.numericData2 - qint64 startTime = event.startTime() - event.numericData(0) - event.numericData(1) -
event.numericData3 - event.numericData4; event.numericData(2) - event.numericData(3);
startTime += insert(startTime, event.numericData1, event.typeIndex, RenderPreprocess); startTime += insert(startTime, event.numericData(0), event.typeIndex(), RenderPreprocess);
startTime += insert(startTime, event.numericData2, event.typeIndex, RenderUpdate); startTime += insert(startTime, event.numericData(1), event.typeIndex(), RenderUpdate);
startTime += insert(startTime, event.numericData3, event.typeIndex, RenderBind); startTime += insert(startTime, event.numericData(2), event.typeIndex(), RenderBind);
insert(startTime, event.numericData4, event.typeIndex, RenderRender); insert(startTime, event.numericData(3), event.typeIndex(), RenderRender);
break; break;
} }
case QmlDebug::SceneGraphAdaptationLayerFrame: { case QmlDebug::SceneGraphAdaptationLayerFrame: {
qint64 startTime = event.startTime - event.numericData2 - event.numericData3; qint64 startTime = event.startTime() - event.numericData(1) - event.numericData(2);
startTime += insert(startTime, event.numericData2, event.typeIndex, GlyphRender, startTime += insert(startTime, event.numericData(1), event.typeIndex(), GlyphRender,
event.numericData1); event.numericData(0));
insert(startTime, event.numericData3, event.typeIndex, GlyphStore, event.numericData1); insert(startTime, event.numericData(2), event.typeIndex(), GlyphStore, event.numericData(0));
break; break;
} }
case QmlDebug::SceneGraphContextFrame: { case QmlDebug::SceneGraphContextFrame: {
insert(event.startTime - event.numericData1, event.numericData1, event.typeIndex, insert(event.startTime() - event.numericData(0), event.numericData(0), event.typeIndex(),
Material); Material);
break; break;
} }
case QmlDebug::SceneGraphRenderLoopFrame: { case QmlDebug::SceneGraphRenderLoopFrame: {
qint64 startTime = event.startTime - event.numericData1 - event.numericData2 - qint64 startTime = event.startTime() - event.numericData(0) - event.numericData(1) -
event.numericData3; event.numericData(2);
startTime += insert(startTime, event.numericData1, event.typeIndex, startTime += insert(startTime, event.numericData(0), event.typeIndex(),
RenderThreadSync); RenderThreadSync);
startTime += insert(startTime, event.numericData2, event.typeIndex, startTime += insert(startTime, event.numericData(1), event.typeIndex(),
Render); Render);
insert(startTime, event.numericData3, event.typeIndex, Swap); insert(startTime, event.numericData(2), event.typeIndex(), Swap);
break; break;
} }
case QmlDebug::SceneGraphTexturePrepare: { case QmlDebug::SceneGraphTexturePrepare: {
qint64 startTime = event.startTime - event.numericData1 - event.numericData2 - qint64 startTime = event.startTime() - event.numericData(0) - event.numericData(1) -
event.numericData3 - event.numericData4 - event.numericData5; event.numericData(2) - event.numericData(3) - event.numericData(4);
startTime += insert(startTime, event.numericData1, event.typeIndex, TextureBind); startTime += insert(startTime, event.numericData(0), event.typeIndex(), TextureBind);
startTime += insert(startTime, event.numericData2, event.typeIndex, TextureConvert); startTime += insert(startTime, event.numericData(1), event.typeIndex(), TextureConvert);
startTime += insert(startTime, event.numericData3, event.typeIndex, TextureSwizzle); startTime += insert(startTime, event.numericData(2), event.typeIndex(), TextureSwizzle);
startTime += insert(startTime, event.numericData4, event.typeIndex, TextureUpload); startTime += insert(startTime, event.numericData(3), event.typeIndex(), TextureUpload);
insert(startTime, event.numericData5, event.typeIndex, TextureMipmap); insert(startTime, event.numericData(4), event.typeIndex(), TextureMipmap);
break; break;
} }
case QmlDebug::SceneGraphTextureDeletion: { case QmlDebug::SceneGraphTextureDeletion: {
insert(event.startTime - event.numericData1, event.numericData1, event.typeIndex, insert(event.startTime() - event.numericData(0), event.numericData(0), event.typeIndex(),
TextureDeletion); TextureDeletion);
break; break;
} }
case QmlDebug::SceneGraphPolishAndSync: { case QmlDebug::SceneGraphPolishAndSync: {
qint64 startTime = event.startTime - event.numericData1 - event.numericData2 - qint64 startTime = event.startTime() - event.numericData(0) - event.numericData(1) -
event.numericData3 - event.numericData4; event.numericData(2) - event.numericData(3);
startTime += insert(startTime, event.numericData1, event.typeIndex, Polish); startTime += insert(startTime, event.numericData(0), event.typeIndex(), Polish);
startTime += insert(startTime, event.numericData2, event.typeIndex, Wait); startTime += insert(startTime, event.numericData(1), event.typeIndex(), Wait);
startTime += insert(startTime, event.numericData3, event.typeIndex, GUIThreadSync); startTime += insert(startTime, event.numericData(2), event.typeIndex(), GUIThreadSync);
insert(startTime, event.numericData4, event.typeIndex, Animations); insert(startTime, event.numericData(3), event.typeIndex(), Animations);
break; break;
} }
case QmlDebug::SceneGraphWindowsAnimations: { case QmlDebug::SceneGraphWindowsAnimations: {
// GUI thread, separate animations stage // GUI thread, separate animations stage
insert(event.startTime - event.numericData1, event.numericData1, event.typeIndex, insert(event.startTime() - event.numericData(0), event.numericData(0), event.typeIndex(),
Animations); Animations);
break; break;
} }
case QmlDebug::SceneGraphPolishFrame: { case QmlDebug::SceneGraphPolishFrame: {
// GUI thread, separate polish stage // GUI thread, separate polish stage
insert(event.startTime - event.numericData1, event.numericData1, event.typeIndex, insert(event.startTime() - event.numericData(0), event.numericData(0), event.typeIndex(),
Polish); Polish);
break; break;
} }