Commit Graph

1491 Commits

Author SHA1 Message Date
Alexander Shalamov
9ba700fd47 [core] Fix combination of icon-text-fit with text-variable-anchors and text-writing-mode 2019-08-20 12:31:02 +03:00
Konstantin Käfer
71a334152a [core] also remove version info in ImageManager when removing an image (#15397) 2019-08-19 13:54:30 -07:00
Dane Springmeyer
1165f62df6 [core][test] fix leaks from sqlite usage 2019-08-16 15:51:42 +03:00
zmiao
0f34eb7b25 Indroduce clusterProperty option for aggregation (#15287)
* indroduce clusterProperty option for aggregation

* remove unnecessary codes

* update geojson_option conversion

* fix reviewing findings
2019-08-16 15:03:48 +03:00
Alexander Shalamov
5f477e310b [core] Check type of a convertible value when constructing legacy filter 2019-08-16 00:19:30 +03:00
Alexander Shalamov
f0f1d7130f [core] Update shaping unit test 2019-08-13 13:32:56 +03:00
Alexander Shalamov
e9ca844d66 [core] Update unit tests 2019-08-13 13:32:56 +03:00
Jason Wray
5722136680 [core] Disable flaky OfflineDatabase.MaximumAmbientCacheSize test 2019-08-07 10:42:35 -07:00
Mikhail Pozdnyakov
187962e425 [core] Fix render tile set source update
Before this change, the `RenderTileSetSource` implementation
ignored update calls for the sources whose description was not yet
loaded and it lead to missing of relayout requests.
2019-08-01 18:20:21 +03:00
Aleksandar Stojiljkovic
73d9f26d03 [core] Limit pitch based on edge insets. Fix max Z calculation in getProjMatrix.
Patch partly fixes #15163 in a way that it doesn't allow loading tens of thousands of tiles and attempt to show area above horizon:

Limit pitch based on edge insets. It is not too bad - current limit of 60 degrees stays active until center of perspective is moved towards the bottom, to 84% of screen height. The plan is to split removal of 60 degrees limit to follow up patch.

Fix max Z calculation in getProjMatrix. TransformState::getProjMatrix calculation of farZ was complex with possibility to lead to negative z values. Replacing it with simpler, precise calculation:
furthestDistance = cameraToCenterDistance / (1 - tanFovAboveCenter * std::tan(getPitch()));

TransformState::getProjMatrix calculation of farZ was an aproximation. Replacing it with simpler, but precise calculation.

Related to: #15163
2019-08-01 09:28:36 +03:00
Alexander Shalamov
05af3e0e28 [core] Add unit test for grid index 2019-07-30 14:46:18 +03:00
Mikhail Pozdnyakov
be5aa1806b [core] Added unit test for issue 15216 2019-07-26 11:23:13 +03:00
Mikhail Pozdnyakov
273ad436fb [core] Avoid copying feature properties 2019-07-25 17:36:35 +03:00
Mikhail Pozdnyakov
2c2e8589c3 [core] GeometryCollection must not be implicitly copied 2019-07-24 21:04:56 +03:00
Alexander Shalamov
852fef66ef [core] Force getGeometries() return const ref 2019-07-24 21:04:56 +03:00
Alexander Shalamov
b4056ad88f [core] Update CrossTileSymbolLayerIndex unit test 2019-07-23 15:43:27 +03:00
Mikhail Pozdnyakov
11bfe23981 [core] Symbol bucket uses shared layout
sizeof(SymbolBucket): 2296 -> 1024
2019-07-22 12:23:39 +03:00
Mikhail Pozdnyakov
63dd17e2bb [core] Introduce TileRenderData
Remove rendering functionality from Tile implementations.
2019-07-04 16:56:43 +03:00
Thiago Marcos P. Santos
657e847015 [tests] Update test expecations 2019-06-28 15:19:58 +03:00
Thiago Marcos P. Santos
848ad0d25e [core] include Hiragana and Katakana glyph ranges to LocalGlyphRasterizer
Fixes #14993
2019-06-28 15:19:58 +03:00
Juha Alanen
0ca8ea6f16 [core] Add number-format expression 2019-06-27 15:51:22 +03:00
Thiago Marcos P. Santos
24df7fe5f5 [core] Add storage unit tests for MapboxTileLimitExceeded 2019-06-19 17:19:10 +03:00
Thiago Marcos P. Santos
1977934bdb [tests] Add unit tests for cache size 2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
68e3cbacbc [core] Add method for setting a maximum size for the ambient cache
- Removed this parameter from the constructor, now that we
  have a method to set it.
- Add the method and enforce the limits if the ambient cache exceeds the
  size.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
78eeffe171 [core] Clear/Invalidate should also work on non-tile resources
These methods were only affecting tiles, but they should really
work on every resource like style, glyphs, etc.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
59e7b9a878 [core] Rename resetCache to resetDatabase
Avoid confusion about what is being reset. In this case, the whole
database and not only the ambient cache.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
9beb740fb7 [tests] Follow-up of previews PR, these tests need write permission 2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
9815fc0d16 [tests] Improve unit test for deleting offline region and concurrent use
Test if the physical size of the database will also reduce.

Clear the cache while adding resource on another connection.
2019-06-13 22:28:16 +03:00
Thiago Marcos P. Santos
4b1f9a3b3f [tests] Add unit test for clearing the ambient cache 2019-06-13 22:28:16 +03:00
Mikhail Pozdnyakov
f77af317c4 [core] Update algorithm::updateTileMasks tests 2019-06-10 19:36:47 +03:00
Mikhail Pozdnyakov
a9abc43510 [core] Introduce PatternAtlas 2019-06-04 15:28:00 +03:00
Konstantin Käfer
18c0590ddd [test] add new OffscreenTexture test 2019-05-28 16:11:05 +02:00
Konstantin Käfer
7f9274035b [core] refactor program object creation 2019-05-28 16:11:05 +02:00
Thiago Marcos P. Santos
33ee7e23de [core] Remove priority from the constructor
Make the constructor less verbose and set good defaults.
2019-05-28 16:30:49 +03:00
Thiago Marcos P. Santos
cc26ef17d5 [core] Introduce usage tag for resources
Make the distinction if a resource is being requested for offline
usage or if it will be used immediately.

Fixes #14746
2019-05-28 16:30:49 +03:00
Aleksandar Stojiljkovic
9809c9f8f5 [core] Offset viewport center when edge insets are specified
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
2019-05-28 14:38:01 +03:00
Łukasz Paczos
46ef2d86d2 [core] invoke optional resource path change completion listener 2019-05-24 15:03:55 +02:00
Alexander Shalamov
749044f1b0 [core] Add unit test for zero width space line breaking 2019-05-24 05:59:07 -07:00
Alexander Shalamov
dcf1a4efb3 [core] Update ImageManager's unit test for onRemoveUnusedStyleImages API 2019-05-21 06:49:17 -07:00
Thiago Marcos P. Santos
c2f974f2a5 [core] Remove binary shader support
The implementation is buggy and not worth maintaining anymore
because performance benefits are not substantial or sometimes
worse. Also, removing it saves about 150 ~ 180 KB in binary size.

Below timings are averages of minimum 5 runs.

```
Device          Init launch     Average relaunch
s10             1129.8 ms       700 ms
s10 - binary    1346.75 ms      694 ms
Pixel           1692 ms         723 ms
Pixel - binary  1883 ms         1039 ms
Kazam           17948 ms        1339 ms
Kazam - binary  19157 ms        1564 ms
Wiko            2060 ms         1278 ms
Wiko - binary   3876 ms         1136 ms
```

Fixes #14294
2019-05-21 15:05:37 +03:00
Ander Conselvan de Oliveira
33cfd080c2 [core] Fix most identity function with default legacy expression tests
Add handling of default value to the conversion of legacy identity
functions. The color and enum tests still don't pass though.
2019-05-21 12:14:22 +03:00
Aleksandar Stojiljkovic
3cd8c6c1fd [core] Refactor HeadlessFrontend/Backend: GL separation and factory (#14692)
Refactor out HeadlessFrontend and HeadlessBackend gl independent code to gfx.
Define gl::HeadlessBackend as subclass, instantiated by gfx::HeadlessBackend static factory method.
GL dependent tests are still using gl::HeadlessBackend directly (not through gfx).
2019-05-21 07:37:49 +03:00
Thiago Marcos P. Santos
19f5686eb2 [tests] Add unit tests for offline data invalidation 2019-05-21 01:04:01 +03:00
Konstantin Käfer
3a6ff7710f [core] add gfx::UploadPass, split startRender into prepare and upload 2019-05-15 11:57:43 -07:00
Mikhail Pozdnyakov
5b6a262e15 [core] GeometryTile and TileLoader keep strong reference to FileSource
Thus we fix a potential bug: if `Renderer` outlives the `Map` it will hold a stale reference to the `FileSource` instance.
2019-05-14 11:29:24 +03:00
Mikhail Pozdnyakov
953ee5e81b [core] Create glyph manager at renderer construction time
Avoid unnecessary glyph manager presence check in `Renderer::Impl::()`.
2019-05-14 11:29:24 +03:00
Thiago Marcos P. Santos
06f1dc48a2 [core] Make the BackgroundScheduler a singleton
- Do not carry it over everywhere as parameter, it is a shared
  instance anyway and the lifecycle is pretty much the app lifecycle
  from the moment we instantiate a map.
- Rename to BackgroundScheduler because it is a Scheduler that will
  do tasks in the background, we don't make assumptions if it is a
  thread pool or a single thread.
- Most importantly, remove the dependency from `core` on `platform`.
2019-05-10 14:20:38 +03:00
Alexander Shalamov
a53c4593d6 [core] Schedule invocation of onStyleImageMissing completion callback on the same thread
Before this change, ImageManger's 'done' callback for onStyleImageMissing observer
notification that was created on renderer thread, could be called from different thread,
therefore, is not thread safe. For example, on Android platform, callback was invoked
from UI thread. This change makes callback to be scheduled on originating thread.
2019-05-09 20:45:06 +03:00
Konstantin Käfer
2489afdd0d [build] change style code generator to sort properties alphabetically
JSON keys in our style specification don't have a defined order. This change sorts them alphabetically so that we can rely on the order remaining them same across code generation runs.
2019-05-02 17:44:18 +02:00
Sudarsana Babu Nagineni
a31734ddad [test] Add unit test for clearCache API 2019-04-29 17:09:58 +03:00