diff --git a/src/plugins/qmlprofiler/qml/MainView.js b/src/plugins/qmlprofiler/qml/MainView.js index c0aedd1374b..128ea396a33 100644 --- a/src/plugins/qmlprofiler/qml/MainView.js +++ b/src/plugins/qmlprofiler/qml/MainView.js @@ -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; diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index a1925d02d53..8664ed5b7f9 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -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);