[core] Enable 'line-sort-key' and 'fill-sort-key' layout properties (#15839)

- Generate style code for 'line-sort-key' and 'symbol-sort-key'

- Add new layout properties to FillLayer::Impl, FillBucket, and FillLayerFactory

- Fix consistency of paint and layout properties type alias usage in FillBucket, LineBucket

- Add optional feature sorting to fill and line Layout creation

- Enable node render tests for fill-sort-key and line-sort-key

- Fix FillBucket test construction

- Prefer emplace_back to push_back for PatternFeature container

- Fix buggy static_cast for PatternFeature indices

- Maintain sort of features as they are created

- Switch pattern layout features container to list from vector for better insert performance

- Fix formatting expected by sanity check

- Use subclass PatternLayoutSorted to work around lack of template functions

- Fix to retain source order for features with equivalent sort keys during sorting

- [core] Fix clang-format

- [core] Address review comments

- [core] Pass inserting strategy class at compile time

- [core] Use sorted strategy only if sort key is defined in layout

- [core] Update style generator

- [core] Merge PatternLayout and PatternLayoutSorted classes

  - Use static methods for inserter strategies
  - Merge PatternLayout and PatternLayoutSorted classes
This commit is contained in:
Andrew Hay Kurtz
2019-09-17 17:35:08 -07:00
committed by Alexander Shalamov
parent c3854cedc2
commit da4eb01bc7
18 changed files with 204 additions and 124 deletions

View File

@@ -67,7 +67,7 @@ TEST(Buckets, CircleBucket) {
TEST(Buckets, FillBucket) {
gl::HeadlessBackend backend({ 512, 256 });
gfx::BackendScope scope { backend };
style::Properties<>::PossiblyEvaluated layout;
FillBucket::PossiblyEvaluatedLayoutProperties layout;
gl::Context context{ backend };
FillBucket bucket { layout, {}, 5.0f, 1};
@@ -89,7 +89,7 @@ TEST(Buckets, FillBucket) {
TEST(Buckets, LineBucket) {
gl::HeadlessBackend backend({ 512, 256 });
gfx::BackendScope scope { backend };
style::LineLayoutProperties::PossiblyEvaluated layout;
LineBucket::PossiblyEvaluatedLayoutProperties layout;
gl::Context context{ backend };
LineBucket bucket { layout, {}, 10.0f, 1 };