summaryrefslogtreecommitdiff
path: root/src/test/testlauncher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/testlauncher.cpp')
-rw-r--r--src/test/testlauncher.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp
index 7072e292d..84283ee6e 100644
--- a/src/test/testlauncher.cpp
+++ b/src/test/testlauncher.cpp
@@ -90,6 +90,8 @@ int TestLauncher::exec()
return testDye();
else if (mTest == "102")
return testDraw();
+ else if (mTest == "103")
+ return testFps2();
return -1;
}
@@ -184,6 +186,39 @@ int TestLauncher::testFps()
return 0;
}
+int TestLauncher::testFps2()
+{
+ timeval start;
+ timeval end;
+
+ Wallpaper::loadWallpapers();
+ Wallpaper::getWallpaper(800, 600);
+ Image *img[1];
+ const int sz = 4;
+
+ img[0] = Theme::getImageFromTheme("graphics/images/login_wallpaper.png");
+ mainGraphics->drawImage(img[0], 0, 0);
+ int idx = 0;
+
+ const int cnt = 500;
+
+ gettimeofday(&start, nullptr);
+ for (int k = 0; k < cnt; k ++)
+ {
+ for (int f = 0; f < 300; f ++)
+ mainGraphics->testDraw();
+ mainGraphics->updateScreen();
+ }
+
+ gettimeofday(&end, nullptr);
+ const int tFps = calcFps(&start, &end, cnt);
+ file << mTest << std::endl;
+ file << tFps << std::endl;
+
+ sleep(1);
+ return 0;
+}
+
int TestLauncher::testBatches()
{
int batches = 512;