Commit Graph

2183 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
648392585e [test runner] Show all tiles independently in Tile mode 2019-12-18 13:48:52 +02:00
Andrew Hay Kurtz
da4eb01bc7 [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
2019-12-17 14:25:19 +02:00
Mikhail Pozdnyakov
9901167936 [core] Add style::Layer(Impl) constructor 2019-12-13 15:34:06 +02:00
Bruno de Oliveira Abinader
1e2cd1e086 [core] Remove Map::cycleDebugOptions 2019-12-04 11:50:05 +02:00
Mikhail Pozdnyakov
684000fc26 [core] Merge style::Layer::set{Layout,Paint}Property 2019-12-03 14:20:17 +02:00
Alexander Shalamov
a01ecc92a0 [core] Add image sections to format expression 2019-12-02 17:11:49 +02:00
Mikhail Pozdnyakov
7bacf5696c [core] Introduce Pass<> class and use it for Scheduler
Thus we enforce client to retain the returned `Scheduler` objects.
2019-12-02 14:12:18 +02:00
Mikhail Pozdnyakov
6d4e5f57ec [core] Add OfflineDatabase.Pack unit test 2019-12-02 13:46:51 +02:00
Mikhail Pozdnyakov
4c49f0c9db [core] Introduce OfflineDatabase::runPackDatabaseAutomatically() API
- added a unit test
- Updated inline comments in default_file_source.hpp
2019-12-02 13:46:51 +02:00
Mikhail Pozdnyakov
3947d5fa98 [core] Retain thread pool in GeoJSONSource
Otherwise, the construction of the `Immutable<Source::Impl>` in background thread might never yeld.
2019-11-29 15:37:49 +02:00
Mikhail Pozdnyakov
6419cd0ab2 [core] Calculate GeoJSON tile geometries in a background thread
Call `mapbox::geojsonvt::GeoJSONVT::getTile()` in a background
thread, so that the rendering thread is not blocked.
2019-11-29 11:12:55 +02:00
Mikhail Pozdnyakov
cd4136ed4b [core][android][darwin] Fix GeoJSONOptions handling
- share the `GeoJSONOptions` instances using `Immutable<GeoJSONOptions>` - avoid extra copying
- fix wrapping of the `GeoJSONOptions` instances in supercluster map/reduce lambdas.
  Previously, local variables were wrapped by reference.
2019-11-29 09:53:28 +02:00
Mikhail Pozdnyakov
b5794730b5 [core] Introduce Scheduler::GetSequenced() API
The newly introduced `Scheduler::GetSequenced()` returns
sequenced schedulers from the cache limited to 10 instances,
preventing from spawning too many threads.
2019-11-28 14:34:52 +02:00
Juha Alanen
69d980cdc1 [core] Add new method to DefaultFileSource
Add setMaximumConcurrentRequests() method for setting it on the
OnlineFileSource.
2019-11-21 14:39:47 +02:00
Ander Conselvan de Oliveira
4c1d03c257 [core] Fix MapSnapshotter build failure on Windows
MSVC implementation of std::promise is buggy and only works with types
that can be default-constructed. To avoid a compilation failure in the
instantiation of ask() inside MapSnapshotter::getRegion(), which creates
a std::promise<LanLngBounds>, make LatLngBounds' default constructor
public.
2019-11-13 13:31:01 +02:00
Mikhail Pozdnyakov
f567a79dd8 [core] Extend DefaultFileSource API
Add `packDatabase()` method and `bool pack` argument to the `deleteOfflineRegion()` method.
2019-11-12 17:24:50 +02:00
Alexander Shalamov
c6f3cc8b60 [core] Implement image expression (#15877)
* [core] Bump gl-js version
* [core] Implement image expression
* [core] Use new image expression
* [core] Coerce image expression to / from string
* [core] Serialize evaluated image
* [core] Pass available images to layout
* [core] Pass images to evaluation context
* [core] Set available flag value based on image availability
* [core] Allow image coercion to boolean to indicate image availability
* [core] Coalesce image expression
* [core] Add image expression to next build system
* [core] Align serialization format and evaluated type with gl-js
* [core] Add images to expression evaluation method
* [core] Add support for Image expression to expression test runner
* [core] Unskip image expression tests
* [core] Update unit tests
* [core] Use image expression in annotation manager
* [core] Add string to ImageExpression conversion
* [core] Add image expression to expression dsl
* [core] Convert tokens for implicitly created Image literal
* [core] Fix clang format
* [core] Split generated style code lines that are over 120 characters
* [core] Add unit test for image expression equality
* [core] Add image property expression evaluation unit test
* [core] Unskip image expression render test
* [core] Skip 'in' expression tests
* [core] Ignore fill-pattern/update-feature-state render test
* [core] Rename Image::serialize to Image::toValue
2019-11-11 18:20:01 +02:00
Mikhail Pozdnyakov
55e18a6f81 [core] Use expected.hpp from mapbox-base 2019-11-08 11:27:30 +02:00
zmiao
2e8a350d68 [core] Add batch conversion of latLngs to/from screenCoords (#15891)
* [core] Add batch conversion of latLng vs screenCoord

* [core] Take the simple approach
2019-11-07 18:16:31 +02:00
Mikhail Pozdnyakov
31421f8448 [core] Add Scheduler::scheduleAndReplyValue() API 2019-11-05 11:45:38 +02:00
Mikhail Pozdnyakov
4afb4438eb [android] Convert GeoJSON features to tiles in background
Composing tiles from the GeoJSON features is an expensive
operation that might block UI thread on updating the `GeoJsonSource`
with the new data.

This change moves tile composing to the background thread and thus
unblocks the UI thread.
2019-10-31 10:24:55 +02:00
Mikhail Pozdnyakov
8c498cd36c [core] Introduce and apply GeoJSONData::create() API 2019-10-31 10:24:55 +02:00
Mikko Pulkki
fb062bb23e [render-test] Add resource usage tracking to gfx context 2019-10-30 14:32:27 +02:00
Juha Alanen
360b8b4247 [core,android,darwin,qt] Add fields related to feature-state
Move the fields from geometry.hpp/feature.hpp as they are not
part of the GeoJSON specification.
2019-10-28 16:46:55 +02:00
Mikko Pulkki
0ca96fd8a4 [render-test] Implement fps benchmarking tests (#15803) 2019-10-22 12:13:55 +03:00
Mikhail Pozdnyakov
2f973e9646 [core] Introduce Scheduler::bindOnce() and use it in ImageManager 2019-10-10 15:39:34 +03:00
Mikhail Pozdnyakov
f62e5b00c9 [core] Introduce Scheduler::makeWeakPtr() 2019-10-09 23:46:11 +03:00
Mikhail Pozdnyakov
bef635765a [core] Decouple Scheduler interface from actor model
So that it is possible to schedule normal `std::function` and use `mapbox::base::WeakPtr`.
2019-10-04 17:42:21 +03:00
Mikhail Pozdnyakov
d446b3382b [core] Enable move semantics for StyleProperty 2019-09-27 19:17:25 +03:00
Ander Conselvan de Oliveira
bb9b1ab624 [core] Return enum layer property values as string
The output of Layer::getProperty is a mapbox::base::Value which is
equivalent to JSON. When setting the value of an enum property via JSON
its value would be a string, so it would be natural to return a string
too.

Also, the numbers generated depend on the enum definition. They are not
part of the style spec.
2019-09-27 17:09:45 +03:00
Mikhail Pozdnyakov
d90b2bb6dc [core] Introduce Light::getProperty() 2019-09-27 13:08:53 +03:00
Mikhail Pozdnyakov
f3146e43cd [core] ValueFactory for expression::formatted, other improvements 2019-09-27 13:08:53 +03:00
Mikhail Pozdnyakov
34ab7be225 [core] Layer::getPaintProperty() -> Layer::getProperty() 2019-09-26 15:54:03 +03:00
Mikhail Pozdnyakov
1733e29f0a [core] Separate header for StyleProperty 2019-09-26 15:54:03 +03:00
Mikhail Pozdnyakov
e78c31c4b5 [core] LayerProperty -> StyleProperty 2019-09-26 11:57:39 +03:00
Mikhail Pozdnyakov
c2dc873cf9 [core] Introduce Layer::getPaintProperty() generic getter 2019-09-26 11:57:39 +03:00
Mikhail Pozdnyakov
2b834001cc [core] type aliases and conversion traits for mapbox::base::Value 2019-09-26 11:57:39 +03:00
Alexander Shalamov
e5cdc4ecf3 [core][android][darwin] Move number format to i18n 2019-09-26 10:55:47 +03:00
Alexander Shalamov
9c8295c6a6 [core][android][darwin] Move platform specific Collator impls from expression
Platform specific Collator implementations should not be part of an expression APIs.
2019-09-26 10:55:47 +03:00
Thiago Marcos P. Santos
c7bbd5bbef [core] Fix performance-move-const-arg 2019-09-25 18:59:07 +03:00
Thiago Marcos P. Santos
cf95bc2bb2 [build] Disable clang-format on generated code
Nice to have, but would make maintain the templates a lot harder.
2019-09-25 18:59:07 +03:00
Thiago Marcos P. Santos
381dda31b4 [build] Fix builds with -pedantic 2019-09-20 12:58:02 +03:00
Mikhail Pozdnyakov
152d4c35fc [core] Add LayerTypeInfo::TileKind 2019-09-18 16:21:59 +03:00
Mikhail Pozdnyakov
224d49cc90 [core] Check layer compatibility with source 2019-09-18 16:21:59 +03:00
Juha Alanen
6b13c42314 [build] Fix clang format and tidy checks 2019-09-18 14:29:15 +03:00
Juha Alanen
48f462bc7b [core] Add removeFeatureState API 2019-09-18 14:29:15 +03:00
Juha Alanen
8e19be9d9c [core] Add support for set/getFeatureState APIs 2019-09-18 14:29:15 +03:00
Juha Alanen
413278ca20 [core] Add feature state support to bucket classes 2019-09-18 14:29:15 +03:00
Juha Alanen
75d18e32fc [core] Add feature state support to expression 2019-09-18 14:29:15 +03:00
Juha Alanen
e51fafd4eb [core] Add new types for feature states 2019-09-18 14:29:15 +03:00