diff options
author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 19:19:51 -0300 |
---|---|---|
committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 19:19:51 -0300 |
commit | 0574020490ffae5686b0c75d7753bfbcf2286114 (patch) | |
tree | 4737ad2276b41819178efdb5360ae7c2b4b559fe /modules/benchmark/benches.c | |
parent | 6c855997ca4a18e3e578faaae073db71c80849ad (diff) |
New upstream version 2.0.17preupstream/2.0.17pre
Diffstat (limited to 'modules/benchmark/benches.c')
-rw-r--r-- | modules/benchmark/benches.c | 25 |
1 files changed, 10 insertions, 15 deletions
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) |