From 0574020490ffae5686b0c75d7753bfbcf2286114 Mon Sep 17 00:00:00 2001 From: Lucas de Castro Borges Date: Mon, 22 Apr 2024 19:19:51 -0300 Subject: New upstream version 2.0.17pre --- modules/benchmark/benches.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'modules/benchmark/benches.c') diff --git a/modules/benchmark/benches.c b/modules/benchmark/benches.c index 0b57ac1c..34ed5983 100644 --- a/modules/benchmark/benches.c +++ b/modules/benchmark/benches.c @@ -28,7 +28,7 @@ gchar *CN() { \ #define BENCH_SCAN_SIMPLE(SN, BF, BID) \ void SN(gboolean reload) { \ - SCAN_START(); \ + static gboolean scanned = FALSE; if (reload || bench_results[BID].result<=0.0) scanned = FALSE;if (scanned) return; \ do_benchmark(BF, BID); \ SCAN_END(); \ } @@ -56,17 +56,17 @@ BENCH_SIMPLE(BENCHMARK_MEMORY_DUAL, "SysBench Memory (Two threads)", benchmark_m BENCH_SIMPLE(BENCHMARK_MEMORY_QUAD, "SysBench Memory (Quad threads)", benchmark_memory_quad, 1); BENCH_SIMPLE(BENCHMARK_MEMORY_ALL, "SysBench Memory (Multi-thread)", benchmark_memory_all, 1); -#if !GTK_CHECK_VERSION(3,0,0) -BENCH_CALLBACK(callback_gui, "GPU Drawing", BENCHMARK_GUI, 1); -void scan_gui(gboolean reload) +BENCH_CALLBACK(callback_benchmark_gui, "GPU Drawing", BENCHMARK_GUI, 1); +void scan_benchmark_gui(gboolean reload) { - SCAN_START(); + static gboolean scanned = FALSE; + if (reload || bench_results[BENCHMARK_GUI].result<=0.0) scanned = FALSE; + if (scanned) return; bench_value er = EMPTY_BENCH_VALUE; if (params.run_benchmark) { int argc = 0; - ui_init(&argc, NULL); } @@ -77,7 +77,6 @@ void scan_gui(gboolean reload) } SCAN_END(); } -#endif //Note: Same order as entries, used for json to server static char *entries_english_name[] = { @@ -238,18 +237,14 @@ static ModuleEntry entries[] = { scan_benchmark_memory_all, MODULE_FLAG_NONE, }, -#if !GTK_CHECK_VERSION(3, 0, 0) [BENCHMARK_GUI] = { N_("GPU Drawing"), - "module.png", - callback_gui, - scan_gui, - MODULE_FLAG_NO_REMOTE | MODULE_FLAG_HIDE, + "monitor.png", + callback_benchmark_gui, + scan_benchmark_gui, + MODULE_FLAG_NO_REMOTE, }, -#else - [BENCHMARK_GUI] = {"#"}, -#endif {NULL}}; const gchar *hi_note_func(gint entry) -- cgit v1.2.3