Commit Graph

181 Commits

Author SHA1 Message Date
Konstantin Käfer
7f9274035b [core] refactor program object creation 2019-05-28 16:11:05 +02:00
Ander Conselvan de Oliveira
80edc3b821 [node] Convert legacy functions to expressions in NodeExpression::Parse
In order to test the conversion from function to expressions using the
legacy tests in the expression test suite, parse function objects into
expressions in NodeExpression::Parse.

v2: Coding style fixes.
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
cf08f6428a [node] Remove NodeThreadPool
Simplify, use the default thread pool, less platform abstraction.
2019-05-10 14:20:38 +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
Konstantin Käfer
3ceabcd3ec [core] clang-tidy fixes 2019-04-05 11:49:17 +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
1cc1d4ea08 [core] Add setter/getter for size property in MapOptions 2019-03-28 16:41:15 +02:00
Bruno de Oliveira Abinader
03db58cdc1 [core] Replace shared_ptr with unique_ptr in {Map,Resource}Options 2019-03-22 18:54:48 +02:00
Bruno de Oliveira Abinader
d5868d3da8 [core] Remove file source from public Map ctor 2019-03-20 21:30:08 +02:00
Bruno de Oliveira Abinader
8cc100bfd5 [core] Get FileSource via UpdateParameters in Renderer::Impl 2019-03-13 17:56:44 +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
Bruno de Oliveira Abinader
096dea16e3 [node] Change Map/FileSource relationship to composition 2019-03-12 23:52:40 +02: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
586b22c0df [core] Remove map coordinate setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
ba7427b4ac [core] Transform{State}: s/angle/bearing/ 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
73ac3c784f [core] Remove map bearing setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
21a39306da [core] Remove map pitch setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
f5f10ec119 [core] Remove map zoom setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
bf8b24fa8d [build] Update to geometry v1.0.0 2018-11-13 17:28:26 +02:00
Mikhail Pozdnyakov
7a9461a8d4 Consolidate style::Layer properties API
The `style::Layer` class now exposes all the properties contained at `style::LayerImpl`.
This allowed to drop `style::Layer::accept()` method usage, avoid the repeated generated code
and thus save some binary size.

This patch is a part of the layers modularization effort.
2018-10-25 22:42:43 +03:00
Bruno de Oliveira Abinader
98c36fc06e [core] CameraOptions receives and outputs angle and pitch as degrees, not radians 2018-10-19 12:05:16 +02:00
Chris Loer
ce76bde13d [core] Initial implementation of 'format' expression 2018-10-15 13:15:46 -07:00
Chris Loer
d735d89835 [core] Port "collision group" plumbing to gl-native.
[node] Hook up map-wide "crossSourceCollisions" option, defaulting to true.
[test] Pass "crossSourceCollisions" test option through test harness; enable cross-source-collisions tests on native.
2018-09-12 14:10:46 -07:00
Konstantin Käfer
30272924a9 [node] capture invalid input data as ParseError objects
This allows us to distinguish them from other types of errors
2018-08-27 14:07:40 -07:00
Konstantin Käfer
112bbc7ab2 [core] make style/conversion.hpp implementation private 2018-08-19 13:09:16 +02:00
John Firebaugh
b2f60a4bf2 [core] Eliminate setProperty & co. 2018-08-13 12:39:44 -07:00
Konstantin Käfer
f3b5902f05 [node] prevent scheduled renderFinished() calls from running when render is canceled
Reverts d5aff71 (#11948) and implements an alternative solution.

Even with the previous fix applied, we were calling `renderFinished()` directly when the render was canceled. This led to the following scenario (all on the main thread):
- `Map::renderStill()` callback is called, `uv_async_send` schedules a call to `renderFinished()`.
- `NodeMap::cancel()` destroys the map object, and calls `renderFinished()` directly, which cleans up the request
- `NodeMap::startRender()` is called to schedule a _new_ render, which means that a new callback will be set
- The `uv_async_t` fires and calls `renderFinished` again:
   - We don't return early as intended by the fix in #11948 since a new callback/`req` object is now available.
   - Since neither error nor image has been set, we'll see a `Didn't get an image` error message.
   - We call the callback with the error. In scenario where we're reusing Map objects, we will start a new render, which will now trigger the `Map is currently rendering an image` error in `Map::renderStill`, and the map object enters a circle in which it will now fail repeatedly with this error.

This commit fixes the issue by completely removing the existing `uv_async_t` handle that could have a scheduled call, and replacing it with a fresh instance of an `uv_async_t` handle.
2018-07-13 10:28:26 +02:00
Chris Loer
9ff5d34ef2 [core] Introduce "collator" expressions
Cross platform parsing and evaluation code.
2018-07-03 10:03:05 -07:00
Dane Springmeyer
a70727245c Change error message with invalid render usage (#12265)
* Change error message with invalid render usage

This change disambiguates this error condition with a different error with the same error message at 789baf4c1f/src/mbgl/map/map.cpp (L157-L160)

* fix test expectation
2018-06-29 22:17:29 -07:00
Konstantin Käfer
162ee6f4e8 [node] fixup bad merge 2018-05-22 12:19:40 +02:00
Konstantin Käfer
973aa963f9 [node] move to Nan 2.10.0 2018-05-22 11:17:01 +02:00
Konstantin Käfer
d5aff7182d [node] prevent race condition for renderFinished 2018-05-22 11:02:51 +02:00
Anand Thakker
352d63d2ce Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters

Fixes #11594

* Add a couple of comments

* Fix ambiguous constructor call

* ParsingContext(optional<Type>) => ParsingContext(Type)
2018-04-12 16:02:48 -04:00
Łukasz Paczos
22b4ef1f4b Update layer immediately when changing its max/min zoom level (#11399)
* [android][core] update layer immediately when changing it's max/min zoom

* [core] node bindings for layer zoom range
2018-04-12 10:42:14 +02:00
Anand Thakker
c50a74d1c2 Remove unused lambda capture (#11602)
Fixes #11588
2018-04-05 10:57:45 -04:00
Chris Loer
75feda12f1 [core] Implement Expression::serialize()
Issue #10714
- Each expression stores its operator as a string, and default serialization is [operator, serialize(child1), ...]
- Custom implementations of `serialize` for Expression types that don't follow the pattern
- expression::Value -> mbgl::Value converter
- node_expression bindings to expose `serialize`
2018-02-28 16:09:09 -08:00
Chris Loer
8e1fc8ff38 [core, node] Hold on to map handle during NodeMap::request.
Avoids a potential crash if garbage collection happens in the middle of a call to NodeMap::request from a map that's eligible for GC.
Fixes issue #11281
2018-02-23 18:05:13 -08:00
Vladimir Agafonkin
82de856c94 [core, ios, macos, android, node] Heatmap layer (#11046)
Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>
Co-Authored-By: Anand Thakker <anandthakker@users.noreply.github.com>
Co-Authored-By: Minh Nguyễn <1ec5@users.noreply.github.com>
2018-02-15 17:38:23 +02:00
Konstantin Käfer
d511f74ce4 [node] add setLight support 2018-01-24 16:35:47 -08:00
Molly Lloyd
f3294200c6 [core] add raster-dem source type and hillshade layer type (#10642) 2018-01-23 10:49:23 -08:00
Ansis Brammanis
22c07596a0 [core] Split MapMode::Still into Static and Tile
`Tile` makes sure the symbols in the resulting tile are tileable while
symbols in `Still` match rendering in `Continuous` mode.
2017-11-17 10:05:15 -08:00
Anand Thakker
f648cfeef6 Implement Expressions (#9439)
Ports https://github.com/mapbox/mapbox-gl-js/pull/4777 (and its several follow-ups)
2017-11-08 12:34:02 -05:00
John Firebaugh
4b2e1cddb4 Replace compile-time polymorphism with runtime polymorphism in the conversion system 2017-10-23 09:56:43 -07:00
Bruno de Oliveira Abinader
8acb78ee79 [node] Reset HeadlessFrontend in NodeMap::release() 2017-10-20 01:27:26 +02:00
Lauren Budorick
e43e2aa3d7 [core, node] Support axonometric rendering 2017-10-14 03:15:34 +02:00
Bruno de Oliveira Abinader
447d24bb19 [node] Added 'removeSource' 2017-09-15 18:28:40 -03:00
Bruno de Oliveira Abinader
e9914bf034 [node] Implement GeoJSON converter 2017-09-13 23:35:27 +03:00
Bruno de Oliveira Abinader
6ee8d7bb60 [node] Set style default camera upon each test suite run 2017-08-31 10:17:21 +03:00