QmlProfiler: removed old fps code

Change-Id: If9ae003d1e6204450f931b72c950525b0b476f74
Reviewed-on: http://codereview.qt.nokia.com/1602
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-07-13 14:10:54 +02:00
committed by Aurindam Jana
parent 3cce72dcf5
commit b533cea366
2 changed files with 2 additions and 47 deletions

View File

@@ -32,12 +32,9 @@
.pragma library
var values = [ ]; //events
var ranges = [ ];
var frameFps = [ ];
var xmargin = 0;
var ymargin = 0;
var drawFpsGraph = false;
var nestingDepth = [];
var names = [ "Painting", "Compiling", "Creating", "Binding", "Handling Signal"]
@@ -48,26 +45,12 @@ var xRayColors = [ "#6699CCB3", "#6699CCCC", "#6699B3CC", "#669999CC", "#66CC99B
function reset()
{
values = [];
ranges = [];
frameFps = [];
xmargin = 0;
ymargin = 0;
nestingDepth = [];
}
function calcFps()
{
if (drawFpsGraph) {
if (values.length)
frameFps = new Array(values.length - 1);
for (var i = 0; i < values.length - 1; ++i) {
var frameTime = (values[i + 1] - values[i]) / 1000000;
frameFps[i] = 1000 / frameTime;
}
}
}
//draw background of the graph
function drawGraph(canvas, ctxt, region)
{
@@ -82,7 +65,7 @@ function drawGraph(canvas, ctxt, region)
//draw the actual data to be graphed
function drawData(canvas, ctxt, region)
{
if (values.length == 0 && ranges.length == 0)
if (ranges.length == 0)
return;
var width = canvas.canvasSize.width - xmargin;
@@ -114,24 +97,6 @@ function drawData(canvas, ctxt, region)
highest[ranges[ii].type] = xx+size;
}
}
if (drawFpsGraph) {
//draw fps overlay
var heightScale = height / 60;
ctxt.beginPath();
ctxt.moveTo(0,0);
for (var i = 1; i < values.length; ++i) {
var xx = (values[i] - ranges[0].start) * spacing + xmargin;
ctxt.lineTo(xx, height - frameFps[i-1]*heightScale)
}
ctxt.lineTo(width, 0);
ctxt.closePath();
var grad = ctxt.createLinearGradient(0, 0, 0, canvas.canvasSize.height);
grad.addColorStop(0, "rgba(255,128,128,.5)");
grad.addColorStop(1, "rgba(255,0,0,.5)");
ctxt.fillStyle = grad;
ctxt.fill();
}
}
function plot(canvas, ctxt, region)
@@ -142,7 +107,7 @@ function plot(canvas, ctxt, region)
function xScale(canvas)
{
if (values.length === 0 && ranges.length === 0)
if (ranges.length === 0)
return;
var width = canvas.canvasSize.width - xmargin;

View File

@@ -130,15 +130,6 @@ Rectangle {
//handle debug data coming from C++
Connections {
target: connection
onEvent: {
if (root.dataAvailable) {
root.clearData();
}
if (!root.dataAvailable && event === 0) { //### only handle paint event
Plotter.values.push(time);
}
}
onRange: {
if (root.dataAvailable) {
@@ -161,7 +152,6 @@ Rectangle {
onComplete: {
root.dataAvailable = true;
Plotter.calcFps();
if (Plotter.ranges.length > 0) {
view.visible = true;
view.setRanges(Plotter.ranges);