forked from qt-creator/qt-creator
QmlProfiler: Paint overview binding loops in separate passes
Change-Id: If1bca8eb9b3db2d0249b8679e58ffd2fdebfc6d5 Task-number: QTCREATORBUG-12950 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -44,13 +44,7 @@ function drawData(canvas, ctxt)
|
|||||||
if ((!qmlProfilerModelProxy) || qmlProfilerModelProxy.count() === 0)
|
if ((!qmlProfilerModelProxy) || qmlProfilerModelProxy.count() === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var width = canvas.width;
|
var spacing = canvas.width / qmlProfilerModelProxy.traceDuration();
|
||||||
var bump = 10;
|
|
||||||
var height = canvas.height - bump;
|
|
||||||
|
|
||||||
var blockHeight = height / qmlProfilerModelProxy.modelCount();
|
|
||||||
|
|
||||||
var spacing = width / qmlProfilerModelProxy.traceDuration();
|
|
||||||
|
|
||||||
for (var modelIndex = 0; modelIndex < qmlProfilerModelProxy.modelCount(); ++modelIndex) {
|
for (var modelIndex = 0; modelIndex < qmlProfilerModelProxy.modelCount(); ++modelIndex) {
|
||||||
for (var ii = canvas.offset; ii < qmlProfilerModelProxy.count(modelIndex);
|
for (var ii = canvas.offset; ii < qmlProfilerModelProxy.count(modelIndex);
|
||||||
@@ -66,26 +60,30 @@ function drawData(canvas, ctxt)
|
|||||||
|
|
||||||
xx = Math.round(xx);
|
xx = Math.round(xx);
|
||||||
|
|
||||||
var itemHeight = qmlProfilerModelProxy.relativeHeight(modelIndex, ii) * blockHeight;
|
var itemHeight = qmlProfilerModelProxy.relativeHeight(modelIndex, ii) *
|
||||||
var yy = (modelIndex + 1) * blockHeight - itemHeight ;
|
canvas.blockHeight;
|
||||||
|
var yy = (modelIndex + 1) * canvas.blockHeight - itemHeight ;
|
||||||
|
|
||||||
ctxt.fillStyle = qmlProfilerModelProxy.color(modelIndex, ii);
|
ctxt.fillStyle = qmlProfilerModelProxy.color(modelIndex, ii);
|
||||||
ctxt.fillRect(xx, bump + yy, eventWidth, itemHeight);
|
ctxt.fillRect(xx, canvas.bump + yy, eventWidth, itemHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// binding loops
|
function drawBindingLoops(canvas, ctxt) {
|
||||||
ctxt.strokeStyle = "orange";
|
ctxt.strokeStyle = "orange";
|
||||||
ctxt.lineWidth = 2;
|
ctxt.lineWidth = 2;
|
||||||
var radius = 1;
|
var radius = 1;
|
||||||
for (modelIndex = 0; modelIndex < qmlProfilerModelProxy.modelCount(); ++modelIndex) {
|
var spacing = canvas.width / qmlProfilerModelProxy.traceDuration();
|
||||||
for (ii = canvas.offset; ii < qmlProfilerModelProxy.count(modelIndex);
|
for (var modelIndex = 0; modelIndex < qmlProfilerModelProxy.modelCount(); ++modelIndex) {
|
||||||
|
for (var ii = canvas.offset - canvas.increment; ii < qmlProfilerModelProxy.count(modelIndex);
|
||||||
ii += canvas.increment) {
|
ii += canvas.increment) {
|
||||||
if (qmlProfilerModelProxy.bindingLoopDest(modelIndex,ii) >= 0) {
|
if (qmlProfilerModelProxy.bindingLoopDest(modelIndex,ii) >= 0) {
|
||||||
var xcenter = Math.round(qmlProfilerModelProxy.startTime(modelIndex,ii) +
|
var xcenter = Math.round(qmlProfilerModelProxy.startTime(modelIndex,ii) +
|
||||||
qmlProfilerModelProxy.duration(modelIndex,ii) -
|
qmlProfilerModelProxy.duration(modelIndex,ii) -
|
||||||
qmlProfilerModelProxy.traceStartTime()) * spacing;
|
qmlProfilerModelProxy.traceStartTime()) * spacing;
|
||||||
var ycenter = Math.round(bump + blockHeight * modelIndex + blockHeight / 2);
|
var ycenter = Math.round(canvas.bump + canvas.blockHeight * modelIndex +
|
||||||
|
canvas.blockHeight / 2);
|
||||||
ctxt.beginPath();
|
ctxt.beginPath();
|
||||||
ctxt.arc(xcenter, ycenter, radius, 0, 2*Math.PI, true);
|
ctxt.arc(xcenter, ycenter, radius, 0, 2*Math.PI, true);
|
||||||
ctxt.stroke();
|
ctxt.stroke();
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ Canvas {
|
|||||||
property int eventsPerPass: 4096
|
property int eventsPerPass: 4096
|
||||||
property int increment: -1
|
property int increment: -1
|
||||||
property int offset: -1
|
property int offset: -1
|
||||||
|
readonly property int bump: 10;
|
||||||
|
readonly property int blockHeight: (height - bump) / qmlProfilerModelProxy.models.length;
|
||||||
|
|
||||||
// ***** properties
|
// ***** properties
|
||||||
height: 50
|
height: 50
|
||||||
@@ -130,6 +132,10 @@ Canvas {
|
|||||||
++offset;
|
++offset;
|
||||||
paintTimer.interval = 1;
|
paintTimer.interval = 1;
|
||||||
paintTimer.start();
|
paintTimer.start();
|
||||||
|
} else if (offset < 2 * increment) {
|
||||||
|
Plotter.drawBindingLoops(canvas, context);
|
||||||
|
++offset;
|
||||||
|
paintTimer.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user