From ed44ea64a8928d0df162a5cce932eef9bbb5ff55 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Nov 2023 18:31:17 +0100 Subject: bbb --- bench/03-bitmask.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bench/03-bitmask.cpp (limited to 'bench') diff --git a/bench/03-bitmask.cpp b/bench/03-bitmask.cpp new file mode 100644 index 00000000..c8c698a6 --- /dev/null +++ b/bench/03-bitmask.cpp @@ -0,0 +1,27 @@ +#include "compat/assert.hpp" +#include "src/anim-atlas.hpp" +#include "loader/loader.hpp" +#include +#include +#include +#include + +namespace floormat { + +namespace { + +[[maybe_unused]] void Bitmask(benchmark::State& state) +{ + auto img = loader.texture(loader.SCENERY_PATH, "door-close"_s); + auto bitmask = anim_atlas::make_bitmask(img); + anim_atlas::make_bitmask_(img, bitmask); + + for (auto _ : state) + anim_atlas::make_bitmask_(img, bitmask); +} + +BENCHMARK(Bitmask)->Unit(benchmark::kMicrosecond)->ReportAggregatesOnly(); + +} // namespace + +} // namespace floormat -- cgit v1.2.3