Commit Graph

1332 Commits

Author SHA1 Message Date
Konstantin Käfer
084c28f0bb [core] recreate offline database when it is deleted out from under our feet 2018-08-14 17:03:46 -07:00
Konstantin Käfer
6e06e55b95 WIP: use expected<T, E> for passing on errors 2018-08-14 17:03:46 -07:00
Konstantin Käfer
89515de769 [test] add test for pending offline download when the disk is full 2018-08-14 17:03:46 -07:00
Konstantin Käfer
fa7b70945f [core] harden OfflineDatabase 2018-08-14 17:03:46 -07:00
Chris Loer
20f880ebec [core] Fix querying for annotations near tile boundaries at high zoom.
Fixes issue #12472.
This commit doesn't address the underlying issues that come from symbolAnnotationTree using a slightly lower precision coordinate system than the annotations themselves.
Instead, it just puts a small padding around each tile when it queries for tile data, so that symbols right at the tile boundary will be included in both tiles.
The rendering/querying code will take care of only displaying one instance.
The padding is in global coordinates, so at higher zoom the padding will be larger in tile units -- this is consistent with precision loss also being greater at higher zoom.
2018-08-14 12:35:50 -07:00
Konstantin Käfer
16e6ca86fa [core] add test for comparing filter name to id 2018-08-14 11:16:10 -07:00
John Firebaugh
b500577bfa [android, linux] Upgrade to SQLite 3.24.0, compiled to minimize binary size 2018-08-10 08:49:18 -07:00
Bruno de Oliveira Abinader
20d21cb7bc Revert "[core] Replace Boost.Spirit with std::regex in CacheControl::parse()"
This reverts commit 990b3b11b9.
2018-08-08 19:03:55 +03:00
Bruno de Oliveira Abinader
3952ff5c34 [core] Replace unique_any with peer from mapbox-bindgen 2018-08-08 14:14:34 +03:00
Bruno de Oliveira Abinader
990b3b11b9 [core] Replace Boost.Spirit with std::regex in CacheControl::parse() 2018-08-08 14:14:34 +03:00
Bruno de Oliveira Abinader
83bd4c2135 [core] Replace remaining dynamic_cast with static_cast 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
Asheem Mamoowala
a5fea5febf Fix TileJSON conversion to allow single point bounds 2018-08-02 12:16:37 -07:00
John Firebaugh
9bdd765a02 [core] Merge DataDrivenPropertyValue into PropertyValue (#12513) 2018-07-31 14:21:47 -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
John Firebaugh
2bbc792060 [core] Check all bucket dynamic_casts
A mismatch can occur when a layer changes from one type to another.
2018-07-24 11:08:40 -07:00
Bruno de Oliveira Abinader
1683da3225 [core] coveredByChildren is false if at least one child is uncovered 2018-07-24 09:18:19 +03: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
Asheem Mamoowala
07b0021ce3 Add fuzz tests for TileCover and fix out of bounds access crash. 2018-07-16 17:11:03 -07:00
Asheem Mamoowala
b2ff57c09c Fix TileCover asserts. The create_bounds_towards_* methods were treating
all point arrays as rings. Simplify the logic to only compare against
the next pt in the bound.
2018-07-16 17:11:03 -07:00
John Firebaugh
a6727921fc [core] Convert legacy functions directly to expressions 2018-07-13 13:37:27 -07:00
Bruno de Oliveira Abinader
68bed94cd1 [core] Harden Projection::project() 2018-07-09 22:02:49 +03:00
Chris Loer
d734f670e8 [core] Fix sort order for queryRenderedFeatures when features are filtered.
Fixes issue #12104.
2018-07-03 15:28:00 -07: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
Chris Loer
b9d3ecc990 [core] Introduce LanguageTag for parsing BCP 47 tags 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
542a4b4501 [core] Replace use of *Stops with expressions DSL 2018-06-29 15:38:11 -07:00
Konstantin Käfer
ca5b36ba80 [core] fix crash when trying to parse legacy filters
Legacy filters aren't part of the style specification, but you can generate them by parsing a legacy filter in a stylesheet, and obtaining the parsed Filter and serializing it.
2018-06-29 12:14:51 -07:00
John Firebaugh
ab5e496219 [tests] Replaced the ZoomHistory test with a render test 2018-06-28 16:31:48 -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
Zsolt Bölöny
bc6094eb55 [core] Fix GCC8's new -Wcatch-value warnings
Polymorphic types shouldn't be caught by value, as the warning message says. Catch them by constant reference instead.
2018-06-25 10:07:04 -07:00
Konstantin Käfer
0ecdbebb09 [core] consolidate database opening workflow
Before this change, we've tried to open the database in read/write, but not create mode. In situations where the database didn't exist yet, this logged an error to the console, and we proceeded to opening it again in read/write/create mode, which actually created the file. The reason we did this is so that we could detect really old caching databases from January 2016 in case a developer upgraded from an older SDK (iOS v3.1 and earlier, Android v3.2 and earlier) that didn't have https://github.com/mapbox/mapbox-gl-native/pull/3715 yet.

However, these error messages, while innocent, look scary in the console and some users suspect that it's a bug. This change opens the file directly in read/write/create mode, omitting the first failed attempt. To handle old cache databases, we're now deleting the `http_cache` table, which was the only table in those old databases, and create the new schema, rather than deleting the entire file and recreating the Database object. In most scenarios, this will lead to one fewer opening attempt, while the database migration will continue to work for the few users who upgrade all the way from a January 2016 SDK.

Additionally, this fixes a mismatch between the Qt and non-Qt implementation: Qt doesn't support opening a file in read/write mode without the create flag. This means that we've seen a different control flow on Qt compared to the non-Qt implementation when opening a database.
2018-06-12 17:41:16 +02:00
Konstantin Käfer
4477dd4119 [core] support moving Database object during a Transaction 2018-06-12 17:41:16 +02:00
Konstantin Käfer
a50493ea51 [test] verify log messages of OfflineDatabase tests 2018-06-12 17:41:16 +02:00
Konstantin Käfer
bed86b98f1 [test] add partial message matching support to FixtureLog 2018-06-12 17:41:16 +02:00
Konstantin Käfer
1fbf3f2d48 [test] standardize on database file name and move I/O functions to util 2018-06-12 17:41:16 +02:00
Konstantin Käfer
31953c4c83 [test] pull out using namespace mbgl to reduce verbosity 2018-06-12 17:41:16 +02:00
Konstantin Käfer
9af5172f98 [core] fix undefined behavior in LineAtlas::addDash 2018-06-12 10:55:46 +02:00
Anand Thakker
2da57bd157 [core] Fix crash due to mixing legacy filters and expressions (#12065)
* Fix crash due to mixing legacy filters and expressions

In some cases, (invalid) nested filters that used a mix of legacy filter
syntax and expression syntax caused a crash due to a failure to
propagate parsing errors from deeper within the filter expression.

These errors went undetected in part because these conversion functions
returned unique_ptr<Expression> values (or vectors thereof), using
{nullptr} to represent a parsing error, but the core expression classes
expect unique_ptr<Expression> that are never null.

This changes over to using expression::ParseResult (aka
optional<unique_ptr<Expression>>), to represent conversion failure
the same way we do in the rest of the expression system.

* Fix clang 3.8 / gcc 4.9 issue
2018-06-06 11:26:08 -04:00
Ivo van Dongen
d928908ec8 [core] offline database - batch region resource inserts 2018-06-04 12:09:32 +03:00
Konstantin Käfer
2694c0df03 [build] disable parts of the build that require node when WITH_NODEJS=OFF is set 2018-05-24 21:50:29 +02:00
Konstantin Käfer
4067a61c80 [core] wrap glGetString in MBGL_CHECK_ERROR too 2018-05-24 11:19:59 +02:00
Anand Thakker
464fefab18 Accept constant expressions in non-dds properties (#11960)
Closes #11940
2018-05-23 09:54:49 -04:00
Asheem Mamoowala
78fdf5c771 Clamp TileJSON.bounds latitudes to [-90, 90] (#11964)
Fixes #11963.
2018-05-21 14:59:54 -07:00
John Firebaugh
a84ac4c8d7 [core] Align URL token replacement behavior with GL JS
I.e. preserve unknown tokens in URLs rather than replacing them with an empty string.
2018-05-18 17:19:45 -07: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