QmlProfiler: Lock the overview painting to the frame rate

If we take longer than a frame for painting a pass we don't really gain
anything.

Change-Id: I6be5cc59116d3eb5d3ef6a863f4cf410333c7e91
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-09-02 17:10:23 +02:00
parent 82793e7339
commit 76287aa2a1

View File

@@ -36,7 +36,7 @@ Canvas {
objectName: "Overview" objectName: "Overview"
contextType: "2d" contextType: "2d"
property int eventsPerPass: 4096 readonly property int eventsPerPass: 512
property int increment: -1 property int increment: -1
property int offset: -1 property int offset: -1
readonly property int bump: 10; readonly property int bump: 10;
@@ -107,7 +107,10 @@ Canvas {
Timer { Timer {
id: paintTimer id: paintTimer
onTriggered: canvas.requestPaint(); repeat: true
running: offset >= 0
interval: offset == 0 ? 1000 : 14 // Larger initial delay to avoid flickering on resize
onTriggered: canvas.requestPaint()
} }
// ***** slots // ***** slots
@@ -122,19 +125,15 @@ Canvas {
if (dataReady) { if (dataReady) {
Plotter.drawTimeBar(canvas, context); Plotter.drawTimeBar(canvas, context);
offset = 0; offset = 0;
// Larger initial delay to avoid flickering on resize
paintTimer.interval = 1000;
paintTimer.start();
} }
} else if (offset < increment) { } else if (offset < increment) {
Plotter.drawData(canvas, context); Plotter.drawData(canvas, context);
++offset; ++offset;
paintTimer.interval = 1;
paintTimer.start();
} else if (offset < 2 * increment) { } else if (offset < 2 * increment) {
Plotter.drawBindingLoops(canvas, context); Plotter.drawBindingLoops(canvas, context);
++offset; ++offset;
paintTimer.start(); } else {
offset = -1;
} }
} }