Commit Graph

2117 Commits

Author SHA1 Message Date
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
Heather Stenson
fd99a6e570 [docs] Remove references to increasing offline tile limit 2019-07-18 16:27:31 -07:00
Mikhail Pozdnyakov
fa5646d112 [core] Synchronize render passes and render tiles
Before this change render passes were assigned for the
whole layer at properties evaluation stage.

This caused problems, as layer render data are bound
to the tile and these data might differ from tile to
tile, depending on which tile has been updated by the
tile worker and which has not been yet updated.

This change takes into consideration the actual render
passes required for each tile and combines them for
the layer render passes. Naturally, this change also
introduces render pass check for each render layer in
`RenderLayer::render()` implementations.
2019-07-11 15:36:28 +03:00
Mikhail Pozdnyakov
c144591322 [core] Introduce LayerProperties::constantsMask()
Constants mask for data-driven paint properties is a reliable
criteria of whether the given updated properties can still be used
with the existing bucket (and the gl program instance).
2019-07-02 16:05:09 +03:00
Julian Rex
e611e57271 [core] Minor change to silence documentation warning on iOS. 2019-07-02 11:44:20 +03:00
Juha Alanen
0ca8ea6f16 [core] Add number-format expression 2019-06-27 15:51:22 +03:00
Bruno de Oliveira Abinader
1a9e07e4ed [core] DefaultFileSource dynamic support for cache-only requests 2019-06-25 20:10:21 +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
5b4bb1398b [core] Surface cache management APIs
These APIs need to be on the DefaultFileSource in order to
be visible for the SDKs bindings.
2019-06-13 22:28:16 +03:00
Konstantin Käfer
844299f1c3 [build] remove roundtrip through <experimental/optional> when using optional 2019-06-12 12:04:07 +02:00
Mikhail Pozdnyakov
f5631d8ef5 [core] Make tile id unwrapTo() const 2019-06-10 19:36:47 +03:00
Konstantin Käfer
e52ce34fb5 [core] remove platform::show(Color)?DebugImage 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
Łukasz Paczos
5e00a2a764 [core] limit thread's scope to release the Object before detaching the thread 2019-05-24 13:52:50 +02:00
Łukasz Paczos
7d6255c860 [core] option to perform platform specific operations when creating/destroying core threads 2019-05-22 15:52:55 +02:00
Mikhail Pozdnyakov
e79080771b [core] RenderLayer::render(PaintParameters, RenderSource*) -> render(PaintParameters) 2019-05-22 16:41:10 +03:00
Alexander Shalamov
100eb61fa4 [core] Forward ImageManagerObserver::onRemoveUnusedStyleImages to MapObserver interface 2019-05-21 06:49:17 -07:00
Alexander Shalamov
0344ce36c4 [core] Define max cache size for ImageManager 2019-05-21 06:49:17 -07:00
Ander Conselvan de Oliveira
f210bbbb6c [core] Don't use optional unique_ptr in function coversion code
Since unique_ptr is already nullable there is no need to wrap it in an
optional<>.
2019-05-21 12:14:22 +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
Mikhail Pozdnyakov
f2ad89c463 [core] Remove RenderLayerSymbolInterface 2019-05-19 18:15:33 +03:00
Konstantin Käfer
3a6ff7710f [core] add gfx::UploadPass, split startRender into prepare and upload 2019-05-15 11:57:43 -07:00
Konstantin Käfer
179c5fe83b [core] add gfx::CommandEncoder::present() 2019-05-15 11:57:43 -07:00
Konstantin Käfer
da5bd4d6e3 [core] use unique IDs for DrawScopes 2019-05-15 11:57:43 -07:00
Mikhail Pozdnyakov
7e77aff8df [core] Make FileSource API clearer 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
Mikhail Pozdnyakov
b41f39d545 [core] Make ActorRef methods const
So that the lambdas calling these methods do not have to be mutable.
2019-05-10 11:59:02 +03:00
Mikhail Pozdnyakov
cb73f0dd1c [core] Remove clipping option from RenderTile and style::Layer 2019-05-08 15:18:33 +03:00
Alexander Shalamov
86b94e30e1 [core] Keep shared_ptr to thread pool in CustomGeometrySource
CustomGeometrySource should keep strong reference to shared thread
pool that is used by CustomTileLoader.
2019-05-03 10:01:19 +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
2604991b2b [core] Introduce resetCache API
Add an API to delete existing database and re-initialize.
2019-04-29 17:09:58 +03:00
Mikhail Pozdnyakov
858097102d [core] Render layers use synchronized buckets and paint properties
Actual for layers rendering the geometry tile data: line, fill, fill-extrusion, heatmap, circle, symbol (was updated in previous commits).
2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
a0c83808c0 [core] Add FadingTiles layer type property 2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
4b21560cf5 [core] Use style::LayerProperties in render layers, buckets and layouts. 2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
1a66a02097 [core] Introduce style::LayerProperties interface and its implementations 2019-04-17 17:21:41 +03:00
Alexander Shalamov
905ca29866 [core] Enable 'symbol-sort-key' layout property and generate style code 2019-04-17 15:04:08 +03:00
Alexander Shalamov
e329492f0f [core] Add 'auto' enum value to symbol-z-order layout property 2019-04-17 15:04:08 +03:00
Alexander Shalamov
300c91b46a [core] Move should not call destructors 2019-04-05 22:35:04 +03:00
Konstantin Käfer
3ceabcd3ec [core] clang-tidy fixes 2019-04-05 11:49:17 +02:00
Konstantin Käfer
7081d5e154 [core] move depth/stencil buffer debug viz to gfx::Context 2019-04-05 11:49:17 +02:00
Konstantin Käfer
1d58850d0c [core] remove Renderer::flush 2019-04-05 11:49:17 +02:00
Konstantin Käfer
5cc3d7a733 [core] move GLContextMode to RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
66c020034e [core] refactor RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
a782a6d15b [core] move BackendScope to gfx namespace 2019-04-05 11:49:17 +02:00