]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/benchmarks/image.cpp
Somehow, setting a tint color makes gauge work :/.
[wxWidgets.git] / tests / benchmarks / image.cpp
index 5e2b4cade99a11f2805dc7e97d8051015d6bbb8b..350cd9f9bc5d66a69715fcb0716f880517b5ef92 100644 (file)
@@ -55,3 +55,36 @@ BENCHMARK_FUNC(LoadTIFF)
     wxImage image;
     return image.LoadFile("horse.tif");
 }
+
+static const wxImage& GetTestImage()
+{
+    static wxImage s_image;
+    static bool s_triedToLoad = false;
+    if ( !s_triedToLoad )
+    {
+        s_triedToLoad = true;
+        s_image.LoadFile("horse.bmp");
+    }
+
+    return s_image;
+}
+
+BENCHMARK_FUNC(EnlargeNormal)
+{
+    return GetTestImage().Scale(300, 300, wxIMAGE_QUALITY_NORMAL).IsOk();
+}
+
+BENCHMARK_FUNC(EnlargeHighQuality)
+{
+    return GetTestImage().Scale(300, 300, wxIMAGE_QUALITY_HIGH).IsOk();
+}
+
+BENCHMARK_FUNC(ShrinkNormal)
+{
+    return GetTestImage().Scale(50, 50, wxIMAGE_QUALITY_NORMAL).IsOk();
+}
+
+BENCHMARK_FUNC(ShrinkHighQuality)
+{
+    return GetTestImage().Scale(50, 50, wxIMAGE_QUALITY_HIGH).IsOk();
+}