Commit Graph

1965 Commits

Author SHA1 Message Date
Konstantin Käfer
6e06e55b95 WIP: use expected<T, E> for passing on errors 2018-08-14 17:03:46 -07:00
Konstantin Käfer
fa7b70945f [core] harden OfflineDatabase 2018-08-14 17:03:46 -07:00
Konstantin Käfer
a3b6fc1498 [build] vendor std::expected polyfill 2018-08-14 17:03:46 -07:00
John Firebaugh
d886d3e4c0 [core] Factor out setVisibility conversion 2018-08-13 12:39:44 -07:00
John Firebaugh
b2f60a4bf2 [core] Eliminate setProperty & co. 2018-08-13 12:39:44 -07:00
Sudarsana Babu Nagineni
fc0745a699 [core] Fix build when building Qt Location plugin for Android
- log2 is not available on Android before API 18.
- Android doesn't have 'round' on the std:: namespace when using g++.

Co-authored-by: Thiago Marcos P. Santos <thiago@mapbox.com>
2018-08-10 11:19:24 +03:00
Bruno de Oliveira Abinader
3952ff5c34 [core] Replace unique_any with peer from mapbox-bindgen 2018-08-08 14:14:34 +03:00
Mikhail Pozdnyakov
15a2623147 [core] Add lineMetrics to GeoJSONOptions
This patch also bumps geojson-vt-cpp version to 6.6.0,
which enables the `lineMetrics` option.
2018-08-08 12:53:32 +03:00
Mikhail Pozdnyakov
0ec4a84c31 Rename EvaluationContext::heatmapDensity to colorRampParameter
More generic name as the same class member is to be used by the
linear gradient properties.
2018-08-07 18:31:59 +03:00
Anand Thakker
d25e1a1e7f Relax typing for comparison operators (#12537)
* Relax typing for comparison operators

Ports https://github.com/mapbox/mapbox-gl-js/pull/6961

* Review comments

* Lint fixes
2018-08-02 13:48:47 -04:00
John Firebaugh
9bdd765a02 [core] Merge DataDrivenPropertyValue into PropertyValue (#12513) 2018-07-31 14:21:47 -07:00
John Firebaugh
9a1bb1ad14 [core] Tweak conversions to reduce binary size
* return {} → return nullopt
* error = { "..." } → error.message = "..."
2018-07-30 17:17:38 -07:00
John Firebaugh
bf7785618a [core] Simplify CompoundExpression implementation 2018-07-30 14:08:27 -07:00
Sudarsana Babu Nagineni
15a1c7b71f Fix compilation errors with libc++ on QNX 7
This patch fixes the compilation errors on QNX 7:
1) QNX 7 compiler (i.e qcc based GCC 5.4.0 with libc++ from LLVM) has a
limited c++11 feature support and causing the compilation
errors with the inheriting constructors. This fixes the issues by
providing the required constructors explicitly.

2) Resolves an ambiguous overload error with optional<T>
2018-07-30 12:38:24 +03:00
Bruno de Oliveira Abinader
cb714d57c5 [core] Replace expressions RTTI with enums + static cast 2018-07-24 10:06:18 +03:00
Chris Loer
f9b36f9f5b [core] Add symbol-placement: line-center
- Remove unused/vestigial 'maxCameraDistance'
- Create a single collision circle for line labels that are less than half the width of a collision circle
2018-07-23 13:33:27 -07:00
Asheem Mamoowala
1d8664a2ae Keep original input for filters using legacy syntax. 2018-07-23 09:12:26 -07:00
John Firebaugh
af89318b1d [core] Convert token strings to expressions 2018-07-20 12:35:00 -07:00
John Firebaugh
c8edbb0500 [core] Replace {Source,Camera,Composite}Function with PropertyExpression 2018-07-20 11:56:30 -07:00
John Firebaugh
a6727921fc [core] Convert legacy functions directly to expressions 2018-07-13 13:37:27 -07:00
John Firebaugh
f7e2fe5e38 [core] Simplify Value conversions
Use a single template function for each of {to,from}ExpressionValue, always dispatching to ValueConverter.

Remove unused ValueConverter::ExpressionType typedefs.
2018-07-12 09:42:55 -07:00
Bruno de Oliveira Abinader
68bed94cd1 [core] Harden Projection::project() 2018-07-09 22:02:49 +03:00
Mikhail Pozdnyakov
514485502d Rename HeatmapColorPropertyValue to ColorRampPropertyValue
Based on patch from @lbud (Lauren Budorick).

Give `HeatmapColorPropertyValue` a more generic name,
since the same value type will be used for both `heatmap-color`
and `line-gradient` properties.
2018-07-05 15:11:14 +03:00
Anand Thakker
cfd436c287 [core] Avoid blocking in Thread<Object> constructor (#12151)
* Introduce AspiringActor, EstablishedActor

This pair of objects represents the two-phase (parent-thread /
child-thread) construction that's needed to support constructing
Thread<Object> without blocking until the child thread is up and
running.

An `AspiringActor<O>` is responsible for:
 - ownership of the actor's `Mailbox`
 - allocating the memory for (but *not* constructing) the target object `O`

Using these two pieces--the mailbox and a stable address for `O`--an
`AspiringActor<O>` can accept messages for the target object, or provide
`ActorRef<O>`s that do so, before the object has actually been
constructed by the corresponding `EstablishedActor<O>`.  (Such messages
are queued in the mailbox until after the object is constructed.)

This allows for an `AspiringActor<O>` to be created and safely used by a
thread other than the one on which the target object will (eventually)
live.

An `EstablishedActor<O>` is responsible for managing the lifetime of the
target object `O` and the open/closed state of the parent's `mailbox`.

The `O` object's lifetime is contained by that of its owning
`EstablishedActor<O>`: the `EstablishedActor` constructor executes the
`O` constructor via "placement new", constructing it at the address
provided by the parent `AspiringActor`, and the `~EstablishedActor`
destructor similarly executes the `~O` destructor (after closing the
mailbox). `EstablishedActor` should therefore live entirely on the
thread intended to own `O`.

* Remove Actor#{invoke,ask}
2018-07-03 17:17:39 -04:00
Chris Loer
9ff5d34ef2 [core] Introduce "collator" expressions
Cross platform parsing and evaluation code.
2018-07-03 10:03:05 -07:00
Bobby Sudekum
4286d5869c Add pitch argument to cameraThatFits functions (#12213) 2018-07-02 16:30:18 -07:00
John Firebaugh
647959a853 [core] Add assertions to expression constructors 2018-06-29 15:38:11 -07:00
John Firebaugh
25ac89e018 [core] Remove stops-based *Function constructors 2018-06-29 15:38:11 -07:00
John Firebaugh
6dfe56510c [darwin] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07:00
John Firebaugh
542a4b4501 [core] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07:00
John Firebaugh
e323daf71f [core] InterpolateBase → Interpolate; Interpolate → InterpolateImpl 2018-06-28 10:00:40 -07:00
John Firebaugh
1dd35eface [core] Privatize Interpolate<T> 2018-06-28 10:00:40 -07:00
John Firebaugh
b2f6acca61 [core] Move non-polymorphic Interpolate methods to base 2018-06-28 10:00:40 -07:00
John Firebaugh
bc771ee02e [core] Split Interpolator into a separate file 2018-06-28 10:00:40 -07:00
John Firebaugh
d176e9bb46 [core] Fix issues in unique_any
* Eliminate unnecessary temporary in VTableStack::move, which also fixes calling the destructor on the incorrect instance
* Make move consistent: it destructs the src, not the dest, which is always empty
* delete doesn't need a null guard
* Conversions to void* don't need a cast
2018-06-25 13:14:52 -07:00
Molly Lloyd
e1af62e87d [core] add raster-resampling property (#12176)
* update style-code for raster-resampling

* implement user-defined raster-resampling

* invert filter condition

* raster-resampling -> raster-resampling-mode for darwin language conventions
2018-06-21 14:37:17 -07:00
Lloyd Sheng
eb70b89849 [core] Measuring tiles requesting/parsing time using logging (#12152)
* Tile timing

* Refactor logging code

* Keep the scope of `messageStream` constrained

* Make log message more clear

* Fix crash issue if onlineResponse.data is null
2018-06-21 11:24:14 +08:00
Konstantin Käfer
2b2de05612 [core] allow logging error codes and formatting strings at the same time 2018-06-12 17:41:16 +02:00
Konstantin Käfer
d66251234d [core] don't use floating point versions of pow/log
GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable.
Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary.
See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
2018-06-04 10:43:21 +02:00
Anand Thakker
464fefab18 Accept constant expressions in non-dds properties (#11960)
Closes #11940
2018-05-23 09:54:49 -04:00
Ansis Brammanis
ba07c873aa [core] re-assign ids when lng jumps to avoid flicker 2018-05-22 14:58:11 -04:00
Ansis Brammanis
5e36f669ac [core] avoid symbol flickering when longitude is wrapped 2018-05-22 14:58:11 -04:00
Fabian Guerra
30376f3ce1 Merge branch 'release-boba' into master
# Conflicts:
#	mapbox-gl-js
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/gradle.properties
#	platform/android/gradle/dependencies.gradle
#	platform/darwin/src/MGLVectorTileSource.mm
#	platform/darwin/src/MGLVectorTileSource_Private.h
#	platform/ios/CHANGELOG.md
#	src/mbgl/style/expression/compound_expression.cpp
2018-05-17 11:47:31 -04:00
Lucas Wojciechowski
a4e2c1af1f [core] Convert "legacy" filters directly into expressions (#11610)
Ports the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp
2018-05-10 12:37:14 -07:00
Asheem Mamoowala
4344812ef5 [core] Streaming TileCover for polygonal regions (#11267)
A per-tile streaming algorithm for tile cover on points, lines, and polygons. Works for individual zoom levels, and not zoom ranges.
2018-04-26 07:43:38 -07: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
Anand Thakker
8d26f74091 Fix style parsing bug for constant expressions (#11606)
* Fix style parsing bug for constant expressions

Closes #10849

* Ignore tests for unported GL JS change

Refs https://github.com/mapbox/mapbox-gl-js/pull/6429

* Fuller fix

* Update mapbox-gl-js
2018-04-09 17:59:18 -04:00
Asheem Mamoowala
dc495e1c9d [core] Add Projection matrix to CustomLayerRenderParameters to transform web mercator world coordinates to GL coordinates. 2018-04-05 18:04:25 -07:00
Asheem Mamoowala
099fcc3b3c Use a host interface for CustomLayer instead of function pointers (#11553)
Use a host interface for CustomLayer instead of function pointers

Co-authored-by: Julian Rex <julian.rex@mapbox.com>
2018-04-02 16:15:25 -07:00
Minh Nguyễn
d066e94103 [core] Fixed to-rgba with zero opacity 2018-03-30 15:36:32 -07:00