Commit Graph

3951 Commits

Author SHA1 Message Date
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
Mikhail Pozdnyakov
81823e35a6 [core] RenderTile shall never be created for a not renderable tile
A RenderTile is already never created for a not renderable tile, guarantied by the checks in `updateRenderables()`.

However, the client code had plenty of `isRenderable()` checks in the render path, which complicated the code and affected rendering performance.

This patch removes the unneeded checks from the client code and puts an assertion to `TilePyramid::addRenderTile()`.
2019-05-14 11:19:56 +03:00
Aleksandar Stojiljkovic
926e8e8a5b Refactor: coordinatePointMatrix skip recomputation (#14507)
coordinatePointMatrix is always used with getZoom():
Projection::worldSize(scale) / std::pow(2, z) is computed as
scale * util::tileSize / std::pow(2, z)
scale is equal to std::pow(2, z).
____________________________________=>
Projection::worldSize(scale) / std::pow(2, z) => util::tileSize.
2019-05-13 22:13:37 +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
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
Mikhail Pozdnyakov
c953fdad24 [core] Failed sprite requests do not block tiles rendering 2019-05-09 16:48:08 +03:00
Mikhail Pozdnyakov
cb73f0dd1c [core] Remove clipping option from RenderTile and style::Layer 2019-05-08 15:18:33 +03:00
Konstantin Käfer
a53c88159f [core] upgrade mapbox-gl-js pin to the most recent version 2019-05-08 14:10:11 +02:00
Konstantin Käfer
20a807fdf3 [core] render extrusions directly in the main framebuffer 2019-05-08 12:25:22 +02:00
Mikhail Pozdnyakov
ef48d53e78 [core] Placement order matches viewport-y sort
Symbols are placed accordingly to their viewport Y order,
if the style `symbol-z-order` is set to `viewport-y`.

This improves rendering of symbol layers, where icons are allowed
to overlap but not text.
2019-05-08 12:21:47 +03:00
Alexander Shalamov
ad30ba2cd1 [core] Guard access to CustomTileLoader's data members with mutex 2019-05-03 10:01:19 +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
Konstantin Käfer
a48152a981 [build] change special casing for LineFloorWidth in shader generation 2019-05-02 17:44:18 +02:00
Mikhail Pozdnyakov
4c8295e672 [core] Less strict rules for adding render layers to sources 2019-04-29 17:03:23 +03:00
Konstantin Käfer
08163713e2 [core] change approach to stencil clipping to (almost) match JS 2019-04-29 11:37:39 +02:00
Alexander Shalamov
5e04091795 [core] Store type of renderable segment when sorting symbols by key 2019-04-26 15:02:38 +03:00
Mikhail Pozdnyakov
3832a081cb [core] RendererImpl::dumDebugLogs() -> dumpDebugLogs() 2019-04-25 17:44:00 +03:00
Mikhail Pozdnyakov
f392053df6 [core] Create ImageManager at renderer construction 2019-04-25 17:44:00 +03:00
Alexander Shalamov
83c33cdeb2 [core] Pass ImageManager to ImageRequestor's constructor
This makes ImageRequestor API explicitly dependant on ImageManager, so that
ImageRequestor can unregister itself from ImageManager on destruction.
2019-04-25 10:00:23 +03:00
Alexander Shalamov
9a70e755dc [core] Track missing style images that were provided by client
- Track images provided by client thruough onStyleImageMissing API
- Handle reduceMemoryUsage in ImageManager, via Renderer API
- Release client provided images when no tiles are using them
2019-04-25 10:00:23 +03:00
Minh Nguyễn
38a4caa3f4 [core] Updated script detection for Unicode 12.1
Updated script detection files to reflect changes in Unicode 12.1.
2019-04-17 10:11:35 -07: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
b96d824b2d [core] Simplify RenderLayer interface. 2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
150b427300 [core] Update style::LayerProperties instances in tiles 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
7a7192516f [core] Introduce LayerRenderData. Source::update() accepts layer properties. 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
113e96e03c [core] Sort cross-tile symbol segments using symbol-sort-key 2019-04-17 15:04:08 +03:00
Alexander Shalamov
2a169b07e8 [core] Set sortKey for symbol segments during layout phase 2019-04-17 15:04:08 +03:00
Alexander Shalamov
073e102b9b [core] Add optional sortKey to segment 2019-04-17 15:04:08 +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
Mikhail Pozdnyakov
4bc79cf4ff Use emplace_hint for inserting render items 2019-04-12 16:17:57 +03:00
Mikhail Pozdnyakov
feaff9260e [core] Order render items properly across several sources 2019-04-12 16:17:57 +03:00
Konstantin Käfer
e95bf4dd9b [ios] run glFlush when reducing memory and don't reduce memory while in background (#14383) 2019-04-11 09:57:35 -04:00
Mikhail Pozdnyakov
8faf47ab5e [core] Pass only visible render layers to source in renderer
This simplifies the code and make it slightly more performant.

Also, this change enables initialization the `RenderTile.used`
field from inside the source (currently done in render layers).
2019-04-09 13:04:21 +03:00
Ansis Brammanis
104091cd93 fix firing onStyleImageMissing after sprite has loaded (#14369) 2019-04-08 16:28:55 -04:00
Konstantin Käfer
8f331f5ae3 [core] refactor ThreadLocal backend 2019-04-08 14:41:16 +02:00
Konstantin Käfer
3ceabcd3ec [core] clang-tidy fixes 2019-04-05 11:49:17 +02:00
Konstantin Käfer
d7aaf83421 [core] introduce gfx::RenderPass 2019-04-05 11:49:17 +02:00
Konstantin Käfer
b1a2513b61 [core] test OffscreenTexture renderability before using them 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
4053776c27 [core] use unique names for debug segments 2019-04-05 11:49:17 +02:00
Konstantin Käfer
4f735db9d8 [core] move RenderParameters creation to a later stage 2019-04-05 11:49:17 +02:00