diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2025-04-16 12:08:17 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2025-04-16 12:08:17 +0200 |
commit | 24e30558d8b30d399a69dd99a510fd43ca075cfe (patch) | |
tree | b1b036950344a512b03d3ec3a03ffe380dacbc01 | |
parent | 3927be06fd49a6cae3d013f65549d38889f58b62 (diff) | |
download | reduced_system_layer-24e30558d8b30d399a69dd99a510fd43ca075cfe.zip |
Remove graphics benchmarks
-rwxr-xr-x | graphics.c | 65 | ||||
-rwxr-xr-x | reduced_system_layer.c | 6 |
2 files changed, 6 insertions, 65 deletions
@@ -2259,74 +2259,11 @@ static Pixel_Buffer _test_pixels = { .pixels = (vec4_f32[1280 * 720]) {0}, }; -static vec4_f32 _test_color = { 1., 1., 1., 1., }; - -BENCHMARK("fill rectangle") { - BENCHMARK_BEGIN; - { - fill_rectangle_to_buffer(_test_pixels, _test_color, (Box) { .x = 100, .y = 100, .width = 300, .height = 200, }); - } - BENCHMARK_END; -} - -BENCHMARK("fill triangle") { - BENCHMARK_BEGIN; - { - fill_triangle_to_buffer(_test_pixels, _test_color, (vec2[3]) { - { 100, 100 }, - { 300, 100 }, - { 200, 250 }, - }); - } - BENCHMARK_END; -} - -BENCHMARK("fill quad") { - BENCHMARK_BEGIN; - { - fill_quad_to_buffer(_test_pixels, _test_color, (vec2[4]) { - { 100, 100 }, - { 300, 100 }, - { 300, 200 }, - { 100, 200 }, - }); - } - BENCHMARK_END; -} - -BENCHMARK("fill ellipse") { - BENCHMARK_BEGIN; - { - fill_ellipse_to_buffer(_test_pixels, _test_color, (Box) { .x = 80, .y = 80, .width = 340, .height = 240, }); - } - BENCHMARK_END; -} - -BENCHMARK("fill line") { - BENCHMARK_BEGIN; - { - fill_line_to_buffer(_test_pixels, _test_color, (vec2[2]) { - { 100, 100 }, - { 300, 200 }, - }, 40); - } - BENCHMARK_END; -} - -BENCHMARK("draw text area") { - BENCHMARK_BEGIN; - { - c32 text[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'S', 'a', 'i', 'l', 'o', 'r', '!', }; - draw_text_area_to_buffer(_test_pixels, 0, _test_color, (Box) { .x = 100, .y = 100, .width = 300, .height = 200, }, (vec2) { 100, 200 }, sizeof text / sizeof *text, text); - } - BENCHMARK_END; -} - #ifndef EVERY_TEST_SUITE void update_and_render_frame(void) {} i32 main(i32 argc, c8 **argv) { - return run_tests_and_benchmarks(argc, argv); + return run_tests(argc, argv); } #endif diff --git a/reduced_system_layer.c b/reduced_system_layer.c index 649190f..cd0a4a3 100755 --- a/reduced_system_layer.c +++ b/reduced_system_layer.c @@ -3147,7 +3147,7 @@ void put_image_to_main_window_(void) { XFlush(_display); } -void init_main_window(void) { +static void init_profiler_slots(void) { PROFILER_init(PROFILE_MEMORY, "Memory allocator"); PROFILER_init(PROFILE_DOWNSCALE, "Downscale anti-aliasing"); PROFILER_init(PROFILE_RESIZE, "Resize in-place"); @@ -3162,6 +3162,10 @@ void init_main_window(void) { PROFILER_init(PROFILE_FILL_LINE, "Fill line"); PROFILER_init(PROFILE_DRAW_TEXT_AREA, "Draw text area"); PROFILER_init(PROFILE_DRAW_TEXT_CURSOR, "Draw text cursor"); +} + +void init_main_window(void) { + init_profiler_slots(); for (i64 i = 0; i < NUM_FRAMES_AVERAGED; ++i) _frame_duration[i] = (MIN_FRAME_DURATION + MAX_FRAME_DURATION) / 2; |