diff options
-rw-r--r-- | bench/03-bitmask.cpp | 27 | ||||
m--------- | external/corrade | 0 |
2 files changed, 27 insertions, 0 deletions
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 <Corrade/Containers/Optional.h> +#include <Magnum/Math/Functions.h> +#include <Magnum/Trade/ImageData.h> +#include <benchmark/benchmark.h> + +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 diff --git a/external/corrade b/external/corrade -Subproject c28350b3f83a65123794f722772b56cd7c0fe63 +Subproject d08e3539b0b9c1a797913bdd2cc2533fe5c9e14 |