Commit Graph

1453 Commits

Author SHA1 Message Date
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
Konstantin Käfer
08163713e2 [core] change approach to stencil clipping to (almost) match JS 2019-04-29 11:37:39 +02:00
Alexander Shalamov
f5773adcce [core] Add unit test for ImageManager::reduceMemoryUsage 2019-04-25 10:00:23 +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
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
Ansis Brammanis
104091cd93 fix firing onStyleImageMissing after sprite has loaded (#14369) 2019-04-08 16:28:55 -04: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
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
Konstantin Käfer
865f8a6c03 [core] add gfx::Renderable and gfx::OffscreenTexture 2019-04-05 11:49:17 +02:00
Konstantin Käfer
ebd8508032 [core] add getResource template to gfx::*Resource classes 2019-04-05 11:49:17 +02:00
Ansis Brammanis
2455275bf4 add onStyleImageMissing to allow dynamically loaded or generated images (#14253)
Also make `Style#updateImage(...)` much faster when the image doesn't change size. This can be useful for asynchronously generating images.
2019-04-02 12:57:45 -04:00
Mikhail Pozdnyakov
b39c71eea8 [core] Introduce variable text placement for point labels - Layout part 2019-03-29 16:18:41 +02:00
Alexander Shalamov
4e335d0b05 [core] Traverse expression tree when checking for property overrides
Before this change, symbol layer was only checking whether top level
'text-field' layout property expression is FormatExpression and if it
has paint property overrides. This change takes into account that
'text-field' might have nested expressions, thus, requires traversal
over child expressions.

Fixes: #14254
2019-03-28 22:27:59 +02:00
Sudarsana Babu Nagineni
7af00a404f [core] Include pixelRatio property in MapOptions
Move pixelRatio property from Map constructor to MapOptions.
2019-03-28 16:41:15 +02:00
Sudarsana Babu Nagineni
f5064e7108 [test] Add unit tests for MapOptions 2019-03-28 16:41:15 +02:00
Sudarsana Babu Nagineni
1cc1d4ea08 [core] Add setter/getter for size property in MapOptions 2019-03-28 16:41:15 +02:00
Łukasz Paczos
419bfbe0eb [core] harden fetching camera for bounds when padding is excessive 2019-03-25 17:53:55 +01:00
Bruno de Oliveira Abinader
d5868d3da8 [core] Remove file source from public Map ctor 2019-03-20 21:30:08 +02:00
Konstantin Käfer
0ad2375e10 [core] remove a_/u_ prefix from attribute/uniform types 2019-03-20 15:40:47 +01:00
Konstantin Käfer
c8cfdb1ced Merge pull request #14126 from mapbox/gfx-refactor-4
Graphics refactor #4
2019-03-15 20:31:12 +01:00
Ander Conselvan de Oliveira
5733440747 [core] Group Map LatLngBounds, min and max zoom methods
Group bounds, minimum and maximum zoom related methods together using
the new BoundOptions.

v2: Document that getBounds() initializes all optional fields.
  - Add test for getBounds() on a map with default values.
2019-03-14 18:33:11 +02:00
Ander Conselvan de Oliveira
11de777628 [core] Remove optional from Map::setLatLngBounds()
This is a first step into grouping together bounds related Map methods
into one that takes a "BoundOptions" object. LatLngBounds::unbounded()
replaces an undefined optional<LatLngBounds>.

v2: Document LatLngBounds::unbounded()
2019-03-14 18:33:11 +02:00
Ander Conselvan de Oliveira
a73cc9d8e3 [core] Remove support for setting minimum and maximum pitch
Support for limiting pitch was introduced in commit c4fc89977b ([core]
Added {set,get}{Min,Max}Pitch) in 2017 but was never exposed by the
platform SDKs. Simplify the Map interface by removing this unused
feature.

v2: Add util::PITCH_MIN
2019-03-14 18:33:11 +02:00
Łukasz Paczos
3f7b70fdb0 [core] expose an option to change the db file path in runtime 2019-03-13 18:28:04 +01:00
Bruno de Oliveira Abinader
8cc100bfd5 [core] Get FileSource via UpdateParameters in Renderer::Impl 2019-03-13 17:56:44 +02:00
Alexander Shalamov
8be135231d [core] Add possibility of overriding paint properties inside format expression #14062
* [core] Add format override expression and formatted section to evaluation context

* [core] Add textColor to TaggedString's formatted section

* [core] Add FormatSectionOverrides and introduce overridable properties

* [core] Populate symbol layer paint properties for text sections

* [core] Add benchmark for style that uses text-color override

* [core] Add unit test for FormatOverrideExpression

* [core] Add unit test for FormatSectionOverrides
2019-03-13 17:14:53 +02:00
Ander Conselvan de Oliveira
7d19115720 [core] Don't use exceptions in MapObserver::onDidFailLoadingMap
Using different exception pointers to specify the loading failure makes
an awkward API. Most users rethrow the exception only to figure out what
type of error happened so it can be reported properly. So replace the
exception pointer with a enum an string description of the failure.
2019-03-13 11:58:27 +02:00
Konstantin Käfer
e27f330629 [core] add texture bindings to draw call instead of Context member fn 2019-03-12 11:03:54 +01:00
Konstantin Käfer
a7f151ab48 [core] move Texture to the gfx namespace 2019-03-12 11:03:54 +01:00
Konstantin Käfer
2a25270298 [core] move Texture related enums to gfx namespace 2019-03-12 11:03:54 +01:00
Sudarsana Babu Nagineni
5e2b6bf636 [core] Add MapOptions to define properties of Map
To simplify the Map constructor, introduce MapOptions
interface to define the properties that can be set on
a Map.
2019-03-08 18:20:55 +02:00
Sudarsana Babu Nagineni
744d92e763 [core] consolidate Axonometric rendering API
Instead of having individual APIs for setting axonometric
and skew options, create ProjectionMode struct that holds
all the relevant options for Axonometric rendering and
introduce setter/getter on the Map for those options.
2019-03-08 17:36:40 +02:00
Bruno de Oliveira Abinader
bc033ad8d4 [core] util::wrap(): std::fmod is not lossless 2019-03-06 18:09:14 +02:00
Mikhail Pozdnyakov
06a8ecdb17 Update mapbox-gl-js submodule to v0.53.0 2019-03-06 18:00:19 +02:00
Molly Lloyd
c33516911f remove unused dem memory 2019-03-05 14:04:52 +02:00