blob: 9efa25a9b6629b383e3084a4cb9277b17130e746 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
} // namespace
} // namespace floormat
|