Commit Graph

1907 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
fb65d25831 [core] Make RendererObserver a public interface
Needed by backends implementing asyncronous rendering
2018-02-09 20:28:54 +02:00
Asheem Mamoowala
6c5e457590 Add options for Custom Geometry Source types to enable clipping and wrapping geometry (#11041) 2018-02-07 12:07:31 -08:00
Konstantin Käfer
26a00f6a31 [core] prioritize Thread::pause() calls 2018-02-06 18:49:06 +01:00
Konstantin Käfer
93c4a23636 [core] change RunLoop processing to check queue on every iteration 2018-02-06 18:49:06 +01:00
Konstantin Käfer
78f8fd88b4 [core] factor out RunLoop::wake() 2018-02-06 18:49:06 +01:00
Konstantin Käfer
3ef7dab1a8 [core] use the RunLoop's schedule call directly
RunLoop already has a queue, and has the ability to schedule weak mailboxes, so we can remove the duplicate code.
2018-02-06 18:49:06 +01:00
Minh Nguyễn
fb5b8d34f2 Reimplement style values atop NSExpression (#10726)
* [ios, macos] Import headers, not implementation files

* [core] Added accessors for various expression parameters

Added missing parameter accessors to various expression operator classes, as well as a method on InterpolatorBase and Step that enumerates the stops and their values.

* [ios, macos] Silenced warning in test of error condition

* [ios, macos] Made MGLSphericalPosition boxable

* [ios, macos] Implemented array enumeration during conversion

* [ios, macos] Temporarily ignore heatmap layer type

* [ios, macos] Migrated MGLSymbolStyleLayer.text to NSExpression

MGLSymbolStyleLayer.text is now of type NSExpression instead of MGLStyleValue, as a first step toward migrating the entire layer API from style values to expressions.

Implemented conversions from NSExpression to JSON arrays and vice versa. The most common NSExpression functions are now converted into style expressions, but not all of the most common style expression operators are supported yet.

* [ios, macos] Implemented string coercion

* [ios, macos] Color literals

* [ios, macos] Null constant expressions

* [ios, macos] Convert dictionary literals

* [ios, macos] Interpolation expressions

* [ios, macos] to-boolean, to-number, get from object

* [ios, macos] Variable expressions

Implemented custom expression functions for assigning and referring to variables within the context of an expression. Variables are assigned via a “context dictionary” and applied to an subexpression that is given as another argument to the same expression. Also implemented built-in variable expressions for zoom level and heatmap density.

* [ios, macos] Convert colors, offsets, padding in expressions to JSON objects

* [ios, macos] Expression-based style property getters

Implemented a conversion from mbgl::style::PropertyValues to Objective-C JSON objects, which are then converted to NSExpressions.

* [ios, macos] Consolidated property value–expression conversion in MGLStyleValueTransformer

* [ios, macos] Predicate and expression guide

Extracted documentation about predicates from a documentation comment in MGLVectorStyleLayer.h to a new jazzy guide. Added details about NSExpression support as well. Began updating the “For Style Authors” guide to reflect the transition from style values to expressions.

* [ios, macos] Updated style authoring guide

Updated the Information for Style Authors guide to discuss expressions instead of style functions. Included a table mapping style specification expression operators to NSExpression syntaxes.

* [ios, macos] Migrated codegen templates to expressions

* [ios, macos] Applied expression changes via codegen

Ran make darwin-style-code.

* [macos] Migrated macosapp to expressions

* [ios, macos] Updated style function guide

This guide needs to be thoroughly rewritten, but for now the example code has been migrated to expressions.

* [ios, macos] Eviscerated style function tests

* [ios, macos] Updated changelogs

* [ios] Migrated iosapp to expressions

* [ios, macos] Exposed JSON conversion methods publicly

* [ios, macos] Removed MGLStyleValue, MGLStyleFunction
2018-01-24 00:04:02 -08:00
Molly Lloyd
f3294200c6 [core] add raster-dem source type and hillshade layer type (#10642) 2018-01-23 10:49:23 -08:00
John Firebaugh
76ed5079a5 [core, ios, macos, android] Add data-driven-styling support for text-font 2018-01-10 15:31:12 -08:00
John Firebaugh
cedda5ef4f [core] Handle NaN input to interpolate and step 2018-01-10 13:45:00 -08:00
John Firebaugh
0eb4b5cc0e [core] Omit inferred type annotations for 'coalesce' arguments 2018-01-09 17:27:02 -08:00
John Firebaugh
a13027c1b6 [core] Improve typing for !=, == expressions 2018-01-09 16:10:51 -08:00
Thiago Marcos P. Santos
d00e56ada0 [windows][core] Add std::tuple replacement for Windows
Windows STL + Clang can't build our IndexedTuple class.
2018-01-08 22:58:20 +02:00
Thiago Marcos P. Santos
af9bb97e47 [windows][core] Add missing != operator to Tileset 2018-01-08 22:58:20 +02:00
Thiago Marcos P. Santos
5b789aa4d6 [windows][core] Include what you use 2018-01-08 22:58:20 +02:00
Asheem Mamoowala
10a44050f4 Support TileJSON bounds property (#10701)
* [core] Parse TileJSON bounds property
* [core] Add TileRange and LatLngBounds::contains(CanonicalTileID)
Move LatLngBounds::contains impl to cpp file
* [core] Skip tile creation outside of tileset bounds
* [core] Fix TileRange for wrapped bounds and use for CustomTileLoader instead of LatLngBounds comparisons for tiles.
2018-01-05 06:35:31 -08:00
Jason Wray
7ece4f6280 [core] Fix copy in range-based for loops
Caught by `CLANG_WARN_RANGE_LOOP_ANALYSIS = YES`.
2017-12-15 19:21:44 -05:00
Chris Loer
cb380064bb [ios,macos] Darwin implementation of a CoreText-based LocalGlyphRasterizer.
- Changing font weight does not currently appear to be working.
 - Glyph metric extraction code not working; currently unused.
2017-12-11 10:43:00 -08:00
Asheem Mamoowala
5fb9fb1a3c [core] Support wrapped bounds in LatLngBounds::contains and LatLngBounds::intersect. 2017-12-07 09:53:36 -08:00
Konstantin Käfer
8757164ac8 [build] standardize on -fvisibility=hidden for all targets
Enables -fvisibility=hidden for iOS and Linux, and adds a workaround for GCC 6.3-7.1
Adds a GCC 6 build
Enables diagnostics for C files
Fixes a shadow warning in parsedate.c
2017-11-29 17:31:33 +01:00
Konstantin Käfer
2eec5a1980 [core] move HeadlessBackend extension initialization code into Impl 2017-11-29 15:48:51 +01:00
Asheem Mamoowala
3067b77c65 [core, ios, macos] Implement unique_any and remove linb::any 2017-11-22 13:56:38 -08:00
Asheem Mamoowala
ba63d06cfc [core] Use Actors for CustomTileLoader invocation from bindings. 2017-11-22 13:56:38 -08:00
Asheem Mamoowala
acae193861 [core] Custom Geometry Sources 2017-11-22 13:56:38 -08:00
Chris Loer
c39232a89f [core] Cleanup in response to review comments. 2017-11-17 10:05:15 -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
Bruno de Oliveira Abinader
3bef7593a6 [build] Clang-3.8: Explicit mbgl::style::expression::Result default ctor 2017-11-14 19:01:04 +02:00
Bruno de Oliveira Abinader
2c51901400 [build] Clang-3.8: Default init of a const type requires user-provided ctor 2017-11-14 19:01:04 +02:00
Thiago Marcos P. Santos
92608f5885 [core] Fix build on Android + GCC and Android + armeabi
Sadly we don't have bots for these two setups.
2017-11-12 13:17:57 -02:00
Tobrun
225fba8a0a Merge branch 'release-agua' into tvn-merge-release 2017-11-10 06:16:35 +01: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
Bruno de Oliveira Abinader
1262659b8d [core] Move GLContextMode to its own Renderer header 2017-11-01 17:45:37 +02:00
Thiago Marcos P. Santos
c65465c02e [gcc4.9] Keep compatibility with GCC + Android
Needed by Qt builds on Android.
2017-10-31 12:41:40 +02:00
Asheem Mamoowala
375f9f94b6 [core] Add LatLngBounds::contains(const LatLngBounds&) 2017-10-30 16:44:34 -07:00
John Firebaugh
4b2e1cddb4 Replace compile-time polymorphism with runtime polymorphism in the conversion system 2017-10-23 09:56:43 -07:00
Fabian Guerra Soto
b7b8baef9d [ios, macos] Add selection support to MGLMultiPoint annotations. (#9984)
* [ios, macos] Add selection support to MGLMultiPoint annotations.

* [ios, macos] Update changelogs.
2017-10-18 15:18:54 -04:00
Anand Thakker
b8654b3b04 [core] Move SourceType to the 'style' namespace 2017-10-16 16:32:53 -07:00
Lauren Budorick
e43e2aa3d7 [core, node] Support axonometric rendering 2017-10-14 03:15:34 +02:00
Konstantin Käfer
78ea88d757 [core] make forcing cache/network only more explicit
Previously, we used the existence of a `prior*` field in the Resource object as an indication for whether we should consult the cache or not. However, this is prone to error, since a failed cache lookup won't set any prior fields. Therefore, we manually set `priorExpires` to 0. This in turn triggered another bug where generated wrong expiration timestamps when the server response we got was expired (or expired between sending and receiving).

This commit changes the flags so that we can now explicitly request CacheOnly/NetworkOnly (or All) loading methods, rather than the implicit Optional/Required naming scheme.
2017-10-12 17:58:03 +02:00
Konstantin Käfer
f4cb3b8a4f [core] make forcing cache/network only more explicit
Previously, we used the existence of a `prior*` field in the Resource object as an indication for whether we should consult the cache or not. However, this is prone to error, since a failed cache lookup won't set any prior fields. Therefore, we manually set `priorExpires` to 0. This in turn triggered another bug where generated wrong expiration timestamps when the server response we got was expired (or expired between sending and receiving).

This commit changes the flags so that we can now explicitly request CacheOnly/NetworkOnly (or All) loading methods, rather than the implicit Optional/Required naming scheme.
2017-10-12 10:41:49 +02:00
Asheem Mamoowala
df20b0cbec [core] Add cameraForLatLngs() method with modified bearing 2017-10-09 13:58:11 -07:00
Asheem Mamoowala
2366487275 [core] Add cameraForLatLngs() method with modified bearing 2017-10-09 11:42:37 -07:00
Konstantin Käfer
8fae8a1645 [core] Add minzoom to GeoJSONOptions 2017-09-28 15:47:21 -07:00
Konstantin Käfer
64c75b442c [build] split out DefaultFileSource and dependents to a separate target
We don't want to link it into the node bindings, so keep it in a separate target
2017-09-28 13:48:36 -04:00
Jesse Crocker
a06f4849bc [core] Move *TileID hashing to separate impl 2017-09-26 10:55:40 -07:00
Ivo van Dongen
97a010cc9b [core] custom layer - add contextLost callback
- optional callback method that can be used to do cleanup when the context has been lost before re-initialisation
2017-09-22 23:33:56 +03:00
Ivo van Dongen
8b9794b1a7 [core] Actor/ActorRef - ask calls to void methods
- allows to wait for execution of void methods as well as non-void methods
2017-09-22 23:33:56 +03:00
Ivo van Dongen
bda6ed26c6 [core] send signal to RenderCustomLayer when gl context has been lost
- Prevents cleaning up of GL resources that no longer exist, resulting in a crash
2017-09-22 23:33:56 +03:00
Konstantin Käfer
bd553de7bc [test] add ability to take the OnlineFileSource offline
This functionality is used for testing to ensure correct offline behavior when connectivity is missing.
2017-09-22 10:57:15 +02:00
Lauren Budorick
a9ddf5b7fd Preserve depth buffer between 3D layers + optimize render order (#9931)
Port of https://github.com/mapbox/mapbox-gl-js/pull/5101: adds a new render pass `Pass3D` before any other rendering wherein we render layers with 3D passes (fill-extrusion layers) to offscreen framebuffers, sharing a depth renderbuffer between those layers in order to render 3D space correctly. Those framebuffers are saved on the RenderLayers and copied back to the map during the translucent pass. Rendering to offscreen framebuffers before we do any clear + draw means we can avoid expensive framebuffer restores.
2017-09-21 14:26:48 -07:00