Commit 6d5cf83a authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Add scaling support to paint events model



Change-Id: I04856628b7498df976d3b7db5539a1125060e9eb
Task-number: QTCREATORBUG-12337
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent daf6aa16
......@@ -167,6 +167,20 @@ int PaintEventsModelProxy::getEventRow(int index) const
return (threadId == QmlDebug::GuiThread || d->maxGuiThreadAnimations == 0) ? 1 : 2;
}
int PaintEventsModelProxy::rowMaxValue(int rowNumber) const
{
Q_D(const PaintEventsModelProxy);
switch (rowNumber) {
case 1:
return d->maxGuiThreadAnimations > 0 ? d->maxGuiThreadAnimations :
d->maxRenderThreadAnimations;
case 2:
return d->maxRenderThreadAnimations;
default:
return AbstractTimelineModel::rowMaxValue(rowNumber);
}
}
int PaintEventsModelProxy::getEventId(int index) const
{
Q_D(const PaintEventsModelProxy);
......@@ -189,7 +203,7 @@ float PaintEventsModelProxy::getHeight(int index) const
Q_D(const PaintEventsModelProxy);
const PaintEventsModelProxyPrivate::Range &range = d->range(index);
return (float)range.animationcount / (float)(range.threadId == QmlDebug::GuiThread ?
d->maxGuiThreadAnimations : d->maxRenderThreadAnimations) * 0.85f + 0.15f;
d->maxGuiThreadAnimations : d->maxRenderThreadAnimations);
}
const QVariantList PaintEventsModelProxy::getLabels() const
......
......@@ -64,6 +64,8 @@ public:
void loadData();
void clear();
int rowMaxValue(int rowNumber) const;
Q_INVOKABLE int rowCount() const;
Q_INVOKABLE int getEventId(int index) const;
int getEventRow(int index) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment