[core] Remove tile sorting from the clip and mask algorithms
The tile sorting can be now removed from the algorithms, which calculate tile mask and clip ids, because their client code provides tiles being already sorted (in `TilePyramid`). This patch brings significant improvements to the Tile-related performance tests results, for example the `TileMaskGeneration` benchmark test runs 33 times faster with these changes applied.
This commit is contained in:
@@ -45,7 +45,10 @@ void validate(const std::vector<MaskedRenderable> expected) {
|
||||
std::vector<MaskedRenderable> actual = expected;
|
||||
std::for_each(actual.begin(), actual.end(),
|
||||
[](auto& renderable) { renderable.mask.clear(); });
|
||||
algorithm::updateTileMasks<MaskedRenderable>({ actual.begin(), actual.end() });
|
||||
std::vector<std::reference_wrapper<MaskedRenderable>> sorted(actual.begin(), actual.end());
|
||||
std::sort(sorted.begin(), sorted.end(),
|
||||
[](const MaskedRenderable& a, const MaskedRenderable& b){ return a.id < b.id; });
|
||||
algorithm::updateTileMasks<MaskedRenderable>(std::move(sorted));
|
||||
EXPECT_EQ(expected, actual);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user