Commit Graph

1235 Commits

Author SHA1 Message Date
Ansis Brammanis
feab36a9fb [core] port minor collision changes from -js (#10764) 2018-01-08 12:57:03 -05:00
Bruno de Oliveira Abinader
f86c1b7d0f [test] Only use our SQLite3 wrapper in tests 2018-01-08 19:13:47 +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
Tobrun
dadd90e4e9 [all] - update licenses to 2018 2018-01-03 18:41:25 +01:00
Konstantin Käfer
ac32b41493 [core] don't tie Annotation geometries to Map maxzoom
Instead, geometry generation via GeoJSONVT is now bound to the hardcoded limit of the annotation tile source.
2018-01-02 19:41:07 +01:00
Chris Loer
56aa7dad4f [macos,ios,android] Unit test fixups
- Add explanatory comment
 - Remove dead/unused Android test
 - Increase image diff threshold to .05 to accommodate slightly different versions of "PingFang" between different test platforms
2017-12-11 10:43:00 -08:00
Chris Loer
b4c781aef7 [core, macos, ios] Unit tests for LocalGlyphRasterizer
Core test uses stubbed "glyph.pbf" without Chinese glyphs
Darwin test relies on locally available "PingFang" font.
Android test relies on locally available "Droid" font. 'expected.png' is NOT correct b/c I haven't figured out how to run unit tests on Android yet.
2017-12-11 10:43:00 -08:00
Chris Loer
1661af1cb4 [core] Enable local glyph generation using TinySDF.
- Platform-specific LocalGlyphRasterizer is responsible for deciding which glyphs to rasterize locally and for implementing the rasterization.
 - Default platform implementation doesn't locally generate any glyphs -> no behavior change
 - Unit test uses StubLocalGlyphRasterizer, which returns a single fixed bitmap for all CJK glyphs
 - Rename glyph_loader.test to glyph_manager.test
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
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
Ansis Brammanis
d69c1c4806 [core] Add unit test for CrossTileSymbolIndex 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
Chris Loer
54b990eb33 [core] Update unit tests for viewport collision.
Add 'GridIndex' unit test.
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
Bruno de Oliveira Abinader
0ef7b7154f [test] Added GLContextMode.Shared utest 2017-11-01 17:45:37 +02:00
Asheem Mamoowala
375f9f94b6 [core] Add LatLngBounds::contains(const LatLngBounds&) 2017-10-30 16:44:34 -07:00
Thiago Marcos P. Santos
84e0f8a3a0 [tests] Create a HeadlessBackend for tests using gl::Context
Qt needs a valid surface before doing any OpenGL call.
2017-10-25 18:08:28 +03:00
John Firebaugh
4b2e1cddb4 Replace compile-time polymorphism with runtime polymorphism in the conversion system 2017-10-23 09:56:43 -07:00
Konstantin Käfer
10f7af19ce [core] correctly alter sprite URLs when attaching sprite.png/sprite.json filenames 2017-10-17 15:39:07 -07:00
Konstantin Käfer
cbff0a972a [core] don't generate clip IDs for buckets/layers that don't need to be clipped 2017-10-17 15:08:22 -07:00
John Firebaugh
12f78fc874 [core] Use convertJSON instead of RapidJSON directly 2017-10-16 17:14:19 -07:00
Anand Thakker
b8654b3b04 [core] Move SourceType to the 'style' namespace 2017-10-16 16:32:53 -07: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
2366487275 [core] Add cameraForLatLngs() method with modified bearing 2017-10-09 11:42:37 -07:00
Bruno de Oliveira Abinader
c9e9cd2aff [test] Added GlyphManager.ImmediateFileSource 2017-10-09 13:33:30 +03:00
Konstantin Käfer
8fae8a1645 [core] Add minzoom to GeoJSONOptions 2017-09-28 15:47:21 -07:00
Konstantin Käfer
f281e6ae8a [core] fix loading of stale must-revalidate resources
In https://github.com/mapbox/mapbox-gl-native/pull/9670, we implemented support for the Cache-Control: must-revalidate header. While we now respect this header and don't show resources that are stale and have this header set, the optional cache request never completes. This means we're also never going to try to actually get a fresh tile and just never show this tile anymore.

This commit fixes this by responding with a Not Found error when the resource is unusable (= stale and has must-revalidate set). Since we actually still have the data (but can't use it due to caching rules), we're responding with the data as well. To avoid a second cache hit, tile_loader_impl.hpp now passes on the data from the Optional to the Required request so that it can be reused when we get a 304 Not Modified response from the server.
2017-09-25 10:47:20 +02: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
Konstantin Käfer
ca4f0bbcc5 [test] add test for rendering a 204 No Content tile 2017-09-22 19:24:42 +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
Konstantin Käfer
f659aa4eda [core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
2017-09-21 12:20:54 +02:00
Konstantin Käfer
1a684c1f48 [core] keep tiles renderable even if a subsequent error occurs
Since 9a9408e811, we marked tiles as non-renderable if an error occured. This lead to situations where a tile was loaded + parsed successfully, then a revalidation attempt occured (e.g. because the resource was stale) which failed. In this case, we used to mark the tile as non-renderable although we could've used the perfectly parsed (stale) resource.
2017-09-21 12:20:54 +02:00
Bruno de Oliveira Abinader
45d07163eb [core] Reset zoom history state in still mode 2017-09-15 16:41:29 -03:00
Asheem Mamoowala
50fd917510 Fast tileCount with help from @mapbox/sphericalmercator module 2017-09-08 17:38:42 -07:00
Asheem Mamoowala
a2712f6fa4 Update to gejson 0.4.2 and add StyleParser test to verify that GeoJSON without properties field can be loaded 2017-08-28 15:43:18 -07:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Bruno de Oliveira Abinader
fe8cbc78d3 [core] Added GeometryTileWorker-owned image correlation ID 2017-08-25 23:41:52 +03:00
John Firebaugh
e706ed4b2e [core] Avoid RenderStyle dependency in query code 2017-08-24 13:06:23 -07:00
Thiago Marcos P. Santos
bd15e273dc [tests] Enforce the schema downgrade behavior
Which is, delete and recreate the database.
2017-08-22 12:46:38 +03:00
Bruno de Oliveira Abinader
224e9e6261 [test] Re-added API.ZoomHistory 2017-08-22 10:17:25 +03:00
Chris Loer
fd2b525c4d [core] Correct x-offset introduced by vertical glyph rotation
Fixes issue#9768.
Port of GL JS PR #5100.
2017-08-18 10:53:26 -07:00
Bruno de Oliveira Abinader
5d62028ed2 [test] Added API.RecycleMapUpdateImages test 2017-08-14 18:23:03 +03:00
Bruno de Oliveira Abinader
bd4441503f [test] Added Map.SetStyleDefaultCamera test 2017-08-11 22:04:52 +03:00
Bruno de Oliveira Abinader
6179e0f9c0 [core] Added Style::getDefaultCamera() 2017-08-11 22:04:52 +03:00
Konstantin Käfer
f0a7c45064 [core] finish must-revalidate support 2017-08-08 12:40:38 +02:00
Ivo van Dongen
68f470fdda [core] make actor self reference optional - again
- uses a different method of constructor selection that also works on Apple clang < 8.2.
2017-08-08 11:36:30 +03:00
Thiago Marcos P. Santos
2dd8ec8854 [core] Removed unused constructor
Not in use at the moment, was causing a compiler error on
Apple LLVM version 8.0.0 (clang-800.0.42.1).

```
src/mbgl/sprite/sprite_loader.cpp:25:11: error: call to constructor of
'Actor<mbgl::SpriteLoaderWorker>' is ambiguous
```
2017-08-07 18:48:42 +03:00