Commit fe718255 authored by Daniel Smith's avatar Daniel Smith

Fix version selector. Update animation durations to 30 sec. Remove machine-specific file paths.

parent dd7998f7
......@@ -117,20 +117,18 @@ void Benchmark::finished(){
frametimesCS += QString::number(static_cast<double>(frametimes[i]), 'f', 2) + ((i < maxframes - 1) ? ",": "");
}
qDebug() << "Frame times (ms):" << frametimesCS;
int n = sizeof(frametimes)/sizeof(frametimes[0]);
int runtime = std::accumulate(frametimes, frametimes+n, 0);
qDebug() << "Finished" << maxframes << "frames in" << runtime << "ms" << "at" << (maxframes*1000) / runtime << "fps";
int startuptime = static_cast<int>(frametimes[0]);
qDebug() << "Start-up time:" << startuptime << "ms";
float meanFrametime = (static_cast<float>(runtime) - startuptime) / static_cast<float>(maxframes);
qDebug() << "Average Frame time:" << QString::number(static_cast<double>(meanFrametime), 'f', 2).toFloat() << "ms";
frametimes[0] = frametimes[1]; // hack to omit start-up time from our standard deviation calcuation.
float runtime = std::accumulate(frametimes, frametimes+maxframes, 0.0);
qDebug() << "Finished" << maxframes << "frames in" << runtime << "ms" << "at" << (maxframes*1000) / runtime << "fps";
float meanFrametime = static_cast<float>(runtime) / static_cast<float>(maxframes);
qDebug() << "Average Frame time:" << QString::number(static_cast<double>(meanFrametime), 'f', 2).toFloat() << "ms";
qDebug() << "";
frametimes[0] = frametimes[1]; // hack to omit start-up time from our standard deviation calcuation.
float runtimeStdDev = calculateSD(frametimes);
qDebug() << "Standard Deviation:" << runtimeStdDev; // << "over" << maxframes << "frames";
qDebug() << "Coefficient of Variation:" << (runtimeStdDev / meanFrametime) * 100;
......
......@@ -26,7 +26,7 @@ class Benchmark: public QObject{
bool beforeFirstFrame = true;
int frame = 0;
int lastframetotal;
static const int maxframes = 150;
static const int maxframes = 1500;
float frametimes [maxframes];
//add 1 to allow space for the measurement taken before the QML application starts.
int virtualMem [(maxframes / 10) + 1];
......
......@@ -12,7 +12,7 @@ Window {
visible: true
property int pixelSize: mainView.height / 8
property string textureExtension: Qt.application.version === "5.6" ? ".png" : ".ktx"
property string textureExtension: Qt.application.version === "5.6" || "5.9" ? ".png" : ".ktx"
function fontSource()
{
......@@ -29,7 +29,7 @@ Window {
console.debug(s + suffix)
return "file:/home/dan/projects/Heavy_QML_example/fonts/" + s + suffix + ".ttf"
return "file:fonts/" + s + suffix + ".ttf"
}
......@@ -62,7 +62,7 @@ Window {
source: background
radius: 64
Behavior on radius {
NumberAnimation { duration: 1000 }
NumberAnimation { duration: 30000 }
}
}
HueSaturation {
......@@ -74,7 +74,7 @@ Window {
NumberAnimation on hue {
from: -1.0
to: 1
duration: 10000
duration: 30000
}
}
......@@ -92,13 +92,13 @@ Window {
ColorAnimation on color {
from: "black"
to: "#42f450"
duration: 5000
duration: 30000
}
OpacityAnimator on opacity {
from: 0.1
to: 0.5
running: true
duration: 5000
duration: 30000
}
}
......
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