diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-06-06 16:03:29 +0300 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2019-06-10 19:36:47 +0300 |
commit | f77af317c4e33902eedd2bf8c0527dacb1910522 (patch) | |
tree | 9edc059d9b59e2e6bfe60a23447c7c4706ae8a30 /benchmark/parse | |
parent | 737665bc070e9db4544b5d78ca69baf72ec958dc (diff) | |
download | qtlocation-mapboxgl-f77af317c4e33902eedd2bf8c0527dacb1910522.tar.gz |
[core] Update algorithm::updateTileMasks tests
Diffstat (limited to 'benchmark/parse')
-rw-r--r-- | benchmark/parse/tile_mask.benchmark.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/benchmark/parse/tile_mask.benchmark.cpp b/benchmark/parse/tile_mask.benchmark.cpp index 79ab685c28..a31e0b5eab 100644 --- a/benchmark/parse/tile_mask.benchmark.cpp +++ b/benchmark/parse/tile_mask.benchmark.cpp @@ -4,34 +4,32 @@ using namespace mbgl; -class MaskedRenderable { +class FakeTile { public: - MaskedRenderable(const UnwrappedTileID& id_, TileMask&& mask_) - : id(id_), mask(std::move(mask_)) { + FakeTile(TileMask mask_) + : mask(std::move(mask_)) { } - - UnwrappedTileID id; - TileMask mask; - bool used = true; - - void setMask(TileMask&& mask_) { + void setMask(TileMask mask_) { mask = std::move(mask_); } + + const bool usedByRenderedLayers = true; + TileMask mask; }; static void TileMaskGeneration(benchmark::State& state) { - std::vector<MaskedRenderable> renderables = { - MaskedRenderable{ UnwrappedTileID{ 12, 1028, 1456 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 13, 2056, 2912 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 13, 2056, 2913 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 14, 4112, 5824 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 14, 4112, 5827 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 14, 4114, 5824 }, {} }, - MaskedRenderable{ UnwrappedTileID{ 14, 4114, 5825 }, {} }, + std::map<UnwrappedTileID, FakeTile> renderables = { + { UnwrappedTileID{ 12, 1028, 1456 }, TileMask{} }, + { UnwrappedTileID{ 13, 2056, 2912 }, TileMask{} }, + { UnwrappedTileID{ 13, 2056, 2913 }, TileMask{} }, + { UnwrappedTileID{ 14, 4112, 5824 }, TileMask{} }, + { UnwrappedTileID{ 14, 4112, 5827 }, TileMask{} }, + { UnwrappedTileID{ 14, 4114, 5824 }, TileMask{} }, + { UnwrappedTileID{ 14, 4114, 5825 }, TileMask{} }, }; while (state.KeepRunning()) { - algorithm::updateTileMasks<MaskedRenderable>({ renderables.begin(), renderables.end() }); + algorithm::updateTileMasks(renderables); } } |