Commit Graph

641 Commits

Author SHA1 Message Date
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
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
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
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
Asheem Mamoowala
2d84e2a1ae Fix platform dependent number type unsigned long -> uint64_t 2017-09-20 09:05:45 -07:00
Asheem Mamoowala
50fd917510 Fast tileCount with help from @mapbox/sphericalmercator module 2017-09-08 17:38:42 -07:00
Ivo van Dongen
fae9faab06 [default] map snapshotter 2017-08-30 17:18:37 +03:00
Ivo van Dongen
eba6d58312 [default] headless_frontend - support program cache dir 2017-08-30 17:18:37 +03:00
Konstantin Käfer
c6ab20e5c6 [core] initialize OfflineDatabase asynchronously in DefaultFileSource
Sometimes, initialization can take hundreds of milliseconds, in particular when the database doesn't exist yet, or when the app/device is doing a lot of I/O already. Instead of synchronously initializing the OfflineDatabase objects, we're now asynchronously initializing the object through a self-sent message that by virtue of being the first message for this actor guarantees that the object is there when it's needed by other member functions.
2017-08-28 13:16:27 +02:00
Thiago Marcos P. Santos
558d4b1a88 [core] Remove database on schema downgrade
Previously we were throwing an exception.
2017-08-22 12:46:38 +03:00
Ivo van Dongen
f4f4d13b70 [all] ensure runloop is the current scheduler 2017-08-09 12:08:21 +03:00
Ivo van Dongen
2a8cc4b3e1 [default] use the current scheduler in the online file source 2017-08-09 12:08:21 +03:00
Ivo van Dongen
edaa002c3c [core] current scheduler
- Adds a way to set the current scheduler on the thread to be used whenever a mailbox is created that needs to reply on this thread
2017-08-09 12:08:21 +03:00
Ivo van Dongen
d88567ee09 [core] fix shadowing argument on apple clang 2017-08-09 11:27:24 +03:00
Konstantin Käfer
f0a7c45064 [core] finish must-revalidate support 2017-08-08 12:40:38 +02:00
John Firebaugh
d4cb498d7a [all] Merge View into RendererBackend 2017-07-26 09:50:38 -07:00
John Firebaugh
32bd1d54fa [node, tests] Consolidate headless rendering logic in HeadlessFrontend 2017-07-26 09:50:38 -07:00
Ivo van Dongen
f69997a19c [default] manage backendscope in renderer frontend 2017-07-25 17:44:28 +03:00
Ivo van Dongen
a5a0558bde [test] allow only a single shared display to avoid egl errors 2017-07-18 10:45:12 +02:00
Ivo van Dongen
46c43510d7 [core] rename backend to renderer backend 2017-07-18 10:45:12 +02:00
Ivo van Dongen
3832f8d0d8 [core] renderer interface 2017-07-18 10:45:12 +02:00
Thiago Marcos P. Santos
48ddfef89f [core] Make sure ThreadLocal will not own the pointer it is managing
ThreadLocal should not own the pointer it is managing because
the use case in Mapbox GL is to keep a pointer to a stack allocated
object, like:

```
MyObject foo;
threadLocal.set(&foo);
```

To keep consistency, it is required that we clear the managed
object before ThreadLocal gets destroyed by setting it to `nullptr`.
2017-07-14 15:18:54 +03:00
Konstantin Käfer
86682f2507 [core] fix undefined access for HTTP responses that don't contain a body 2017-07-13 17:54:18 +02:00
Konstantin Käfer
a5cdbb084e [all] make default_styles header-only 2017-07-13 00:22:54 -04:00
Bruno de Oliveira Abinader
d918f8d7c2 [core] GCC 4.9 does not provide <codecvt> 2017-07-12 20:42:29 +03:00
Bruno de Oliveira Abinader
3afbfa2de7 [core] GCC 4.9 shadow member warnings 2017-07-12 20:42:29 +03:00
Thiago Marcos P. Santos
40d66a84b3 [core] Do not use S_ISDIR
Seems like Windows can do `stat()` but not S_ISDIR.
2017-07-12 15:13:33 +03:00
Thiago Marcos P. Santos
7c117281bc [core] Isolate pthread-based tls implementation 2017-07-07 18:10:06 +03:00
Tobrun
14c221fce7 Merge branch 'release-ios-v3.6.0-android-v5.1.0'
# Conflicts:
#	.travis.yml
#	circle.yml
#	cmake/core-files.cmake
#	include/mbgl/style/function/composite_function.hpp
#	platform/android/CHANGELOG.md
#	platform/android/MapboxGLAndroidSDK/build.gradle
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java
#	platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LightTest.java
#	platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/light.junit.ejs
#	platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java
#	platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java
#	platform/android/dependencies.gradle
#	platform/android/src/native_map_view.cpp
#	platform/darwin/scripts/generate-style-code.js
#	platform/darwin/src/MGLGeometry_Private.h
#	platform/darwin/src/MGLLight.h
#	platform/darwin/src/MGLLight.mm
#	platform/darwin/src/MGLSource.h
#	platform/darwin/src/MGLStyle.h
#	platform/darwin/src/MGLStyle.mm
#	platform/darwin/test/MGLLightTest.mm
#	platform/default/default_file_source.cpp
#	platform/ios/CHANGELOG.md
#	platform/ios/Mapbox-iOS-SDK-symbols.podspec
#	platform/ios/Mapbox-iOS-SDK.podspec
#	platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf
#	platform/macos/CHANGELOG.md
#	scripts/generate-shaders.js
#	src/mbgl/layout/symbol_layout.cpp
#	src/mbgl/programs/program.hpp
#	src/mbgl/programs/symbol_program.hpp
#	src/mbgl/programs/uniforms.hpp
#	src/mbgl/renderer/frame_history.cpp
#	src/mbgl/renderer/paint_property_binder.hpp
#	src/mbgl/shaders/line.cpp
#	src/mbgl/shaders/line_pattern.cpp
#	src/mbgl/shaders/line_sdf.cpp
#	src/mbgl/sprite/sprite_atlas.hpp
#	src/mbgl/style/layers/line_layer_properties.hpp
#	src/mbgl/style/sources/geojson_source.cpp
#	src/mbgl/style/style.cpp
#	src/mbgl/text/glyph_atlas.hpp
#	src/mbgl/tile/geometry_tile.cpp
#	src/mbgl/tile/geometry_tile.hpp
#	test/style/style.test.cpp
2017-07-05 08:37:27 +02:00
Jason Wray
361dda25a6 [ios, macos] Fix size and color of default marker image 2017-06-26 14:56:21 -04:00
Thiago Marcos P. Santos
ea34cb5725 [core] Use the ResourceTransform instead of callbacks
Based on the actor model, can be considered safer to use since
we don't need to worry about object lifetime anymore.
2017-06-26 16:32:21 +03:00
Thiago Marcos P. Santos
7e8bdadb91 [core] Rename ThreadedObject to Thread
Now that the old Thread class is gone, we can give ThreadedObject
a better name.
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
1427628c56 [core] Remove util::Thread
Fixes #6425
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
476975dbf3 [core] Convert LocalFileSource to ThreadedObject 2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
495f06ac4d [core] Convert AssetFileSource to ThreadedObject 2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
999de53f11 [core] Convert DefaultFileSource to ThreadedObject
Fixes #6426
2017-06-21 14:30:09 +03:00
Bruno de Oliveira Abinader
a05f060153 [core] Added Backend::{assume,set}ScissorTest 2017-06-13 13:37:41 +03:00
Asheem Mamoowala
8b37a0704c [core] Use fixed-size std::array for ImageSource coordinates 2017-06-01 15:38:01 -07:00
Asheem Mamoowala
aa6647e910 [core] Offline support for Image Sources 2017-06-01 15:38:01 -07:00
Asheem Mamoowala
7a010df956 [core] Add ImageSource support to style parsers 2017-06-01 15:38:01 -07:00
Ivo van Dongen
5cf0fc0f8b [core] default file source - ensure thread safety for cached values 2017-05-27 10:05:36 +03:00
Ivo van Dongen
89129379f1 [core] default file source - ensure thread safety for local file and asset requests 2017-05-27 10:05:36 +03:00
John Firebaugh
c2a5894f2d [core] Immutable Impls 2017-05-12 11:26:27 -07:00
Tobrun
a68788a2cf [android] Release android-v5.1.0-beta.2 (#8976)
* [android] url getter on sources

* [android] fix ui test filter in makefile

* [android] - build SNAPSHOT from release branch (#8958)

* [android] - update changelog for 5.1.0-beta.2

* [android] - bump version number

* [android] - Camera change listener v2.0

* [core] allow filesource url transform reset

* [android] Update attribution wordmark (#8774)

* Update wordmark on android

* Moved attribution i icon to the right of mapbox word (in mapview preview image)

* update padding and margin

* [android] update hardcoded branch name

* revert version to 5.1.0-SNAPSHOT
2017-05-12 14:07:06 -04:00
Minh Nguyễn
886bf2528f [core, android, ios, macos] Added Traffic Day/Night to default styles
The Styles API section of the Mapbox API Documentation site now lists Traffic Day v2 and Traffic Night v2, so this change adds those styles to all the places where styles are listed.

Also switched iosapp and macosapp to unversioned style factory methods since MGLStyleDefaultVersion is no longer applicable for all styles.

Cherry-picked from 4d6f54553d.
2017-05-12 10:02:27 -07:00
Minh Nguyễn
c5ee41a93a [ios, macos] Undeprecated unversioned style URL factory methods
Undeprecated the unversioned style URL factory methods in MGLStyle for consistency with the Android and Qt SDKs. Added warnings about using them with the runtime styling API.

Refactored mbgl::util::default_styles to track different versions for different styles.

Cherry-picked from 9e384b78fb.
2017-05-12 10:02:27 -07:00
Minh Nguyễn
0ef1293dad [core, android, ios, macos, qt] v10 default styles
Upgraded from v9 default styles to v10 wherever the developer expects to get the latest and greatest, as well as in a couple tests where it may be beneficial to ensure that we can handle a two-digit version number in the style URL.

Cherry-picked from ed54849e99.
2017-05-12 10:02:27 -07:00
Bruno de Oliveira Abinader
1e1da36123 [tidy] modernize-use-equals-default 2017-05-12 18:07:36 +03:00