Adding an option to disable frame differencing.
2 import QtQuick.Controls 1.2
3 import QtQuick.Window 2.1
5 import QtQuick.Layouts 1.1
12 //SystemPalette { id: palette }
17 //This window is our VFD frame
22 title: "Splash Window"
24 flags: Qt.SplashScreen
26 //property int timeoutInterval: 41
28 property int timeoutInterval: 33
30 //! [splash-properties]
31 //! [screen-properties]
32 //x: (Screen.width - rectangleScreen.width) / 2
33 //y: (Screen.height - rectangleScreen.height) / 2
34 x: appWindow.x+appWindow.width-256-13
35 y: appWindow.y+appWindow.height-64-30
37 //! [screen-properties]
38 width: rectangleScreen.width
39 height: rectangleScreen.height
40 property int frameCounter:0;
41 property var startTime:new Date();
45 anchors.centerIn: parent
71 text: "Time/Frame (ms):"
113 interval: splash.timeoutInterval; running: true; repeat: true
114 property bool doFill: true
118 var current = new Date();
119 var milliseconds = (current.getTime() - splash.startTime.getTime());
121 splash.frameCounter++;
122 labelFrameCount.text=splash.frameCounter;
123 labelTime.text=milliseconds/1000;
124 labelTimePerFrame.text=(milliseconds/splash.frameCounter).toFixed(3);
125 labelFps.text=(1000/(milliseconds/splash.frameCounter)).toFixed(0);
127 if (checkBoxDoClear.checked)
132 if (checkBoxRenderToDisplay.checked)
134 if (checkBoxFillAndClearOnly.checked)
136 //Trying to make it a worse case scenario for our frame diff algo
146 if (splash.frameCounter%2)
151 else if (checkBoxOnePixelOnly.checked)
153 display.setPixel(0,0,splash.frameCounter%2);
157 display.renderWindow(splash);
160 if (!checkBoxNoSwapBuffers.checked)
162 display.swapBuffers();
173 Component.onCompleted: {
185 text: qsTr("Render Window")
187 display.renderWindow(splash);
188 display.swapBuffers();
193 text: qsTr("Reset stats")
195 splash.startTime = new Date();
196 splash.frameCounter = 0;
201 text: qsTr("Run timer")
204 (checked?timer.start():timer.stop())
210 text: qsTr("Do clear")
215 id: checkBoxRenderToDisplay
216 text: qsTr("Render to display")
221 id: checkBoxFillAndClearOnly
222 text: qsTr("Only fill and clear")
227 id: checkBoxNoSwapBuffers
228 text: qsTr("No swap buffers")
233 id: checkBoxOnePixelOnly
234 text: qsTr("One pixel only")
239 text: qsTr("Off-Screen")
241 onCheckedChanged: {display.offScreenMode = checked;}
245 text: qsTr("Frame differencing")
247 onCheckedChanged: {display.frameDifferencing = checked;}