Commit Graph

4330 Commits

Author SHA1 Message Date
Justin R. Miller
0955dfc19f Merge branch 'release-v0.4.0' 2015-06-19 15:56:53 -07:00
Justin R. Miller
cfa0890d82 Screenshot II: The Return of Screenshot 2015-06-19 15:53:58 -07:00
Justin R. Miller
18d8d4475e avoid release candidates in determining version 2015-06-19 12:57:42 -07:00
Mike Morris
898f4d3f08 Check libuv version semver-ishly
Fixes https://github.com/mapbox/node-mapbox-gl-native/issues/137
2015-06-19 11:48:41 -07:00
Justin R. Miller
8f8fdaad88 [publish ios-v0.4.0] 2015-06-19 11:21:12 -07:00
Justin R. Miller
c7f9e79d54 fixes #1756: call out breaking changes 2015-06-19 11:20:55 -07:00
Justin R. Miller
7ad3b1cedc update podspec (0.4.0 final, no symbols) 2015-06-19 11:17:41 -07:00
Justin R. Miller
fe991ce54e another symbol fix for appledoc parsing 2015-06-19 11:13:26 -07:00
Justin R. Miller
59362a1e55 Merge pull request #1761 from mapbox/unavailable-docs
remove docs for unavailable API
2015-06-19 11:11:12 -07:00
Justin R. Miller
afb7095ecc refs #1759: remove header docs for now-unavailable API 2015-06-19 11:07:24 -07:00
Justin R. Miller
d786550677 slight changelog tweaks to avoid appledoc problems 2015-06-19 09:55:09 -07:00
Justin R. Miller
9369defa66 fixes #1756: update changelog for 0.4.0 2015-06-19 09:47:45 -07:00
Konstantin Käfer
0f5ad29b4e propertly initialize the name 2015-06-19 12:35:14 +03:00
Justin R. Miller
54f766cd68 remove problematic screenshot URL from HTML docs 2015-06-18 17:20:36 -07:00
Justin R. Miller
a2fa372678 fix appledoc version parsing 2015-06-18 15:39:24 -07:00
Minh Nguyễn
0e3270cb15 Replaced user-facing assertions with exceptions
Errors caused by client code should be communicated through NSExceptions. NSAsserts are intended for internal usage; because they include helpful information like the absolute path to the file containing the assertion, stripping the build (#1650) also strips assertion messages. Also replaced hardcoded references to methods in these messages with __PRETTY_FUNCTION__, which avoids future copy-pasta and handles cases in which the MGL class has been subclassed.
2015-06-18 10:59:12 -07:00
Thiago Marcos P. Santos
ac4179e7de Use a pipe() to synchronize the server initialization
As the signals are intercepted by debuggers.
2015-06-18 15:48:39 +03:00
Thiago Marcos P. Santos
22acc2f14c Remove cleanup call on the ResourceLoading test case
We should not be able to create GL objects with a no-op view, so
there is nothing to cleanup.
2015-06-18 14:00:46 +03:00
John Firebaugh
eb52f86ee1 Fix an order-of-operations issue with tileLoadingCompleteCallback
==7466== Invalid read of size 8
==7466==    at 0x5F1D0B: mbgl::TransformState::getAngle() const (transform_state.cpp:159)
==7466==    by 0x700CD2: mbgl::Source::tileLoadingCompleteCallback(mbgl::TileID const&, mbgl::TransformState const&, bool) (source.cpp:574)

==7466==  Address 0xf1d1508 is 56 bytes inside a block of size 120 free'd
==7466==    at 0x4C2A4BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7466==    by 0x70AD61: std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (mbgl::Source::*)(mbgl::TileID const&, mbgl::TransformState const&, bool)> ()(mbgl::Source*, mbgl::TileID, mbgl::TransformState, bool)> >::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>) (functional:1894)
==7466==    by 0x7080EB: std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (mbgl::Source::*)(mbgl::TileID const&, mbgl::TransformState const&, bool)> ()(mbgl::Source*, mbgl::TileID, mbgl::TransformState, bool)> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) (functional:1918)
==7466==    by 0x535033: _ZNSt8functionIFvvEEaSEDn (functional:2277)
==7466==    by 0x56A3F5: mbgl::WorkTask::cancel() (work_task.cpp:34)
==7466==    by 0x56146C: mbgl::WorkRequest::~WorkRequest() (work_request.cpp:13)
==7466==    by 0x50C5E0: std::default_delete<mbgl::WorkRequest>::operator()(mbgl::WorkRequest*) const (unique_ptr.h:76)
==7466==    by 0x50C411: std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >::reset(mbgl::WorkRequest*) (unique_ptr.h:344)
==7466==    by 0x50C374: std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >::operator=(std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >&&) (unique_ptr.h:251)
==7466==    by 0x743136: mbgl::TileData::reparse(mbgl::Worker&, std::function<void ()()>) (tile_data.cpp:89)
==7466==    by 0x6FEA7C: mbgl::Source::handlePartialTile(mbgl::TileID const&, mbgl::Worker&) (source.cpp:250)
==7466==    by 0x700338: mbgl::Source::update(mbgl::MapData&, mbgl::TransformState const&, mbgl::Style&, mbgl::GlyphAtlas&, mbgl::GlyphStore&, mbgl::SpriteAtlas&, mbgl::util::ptr<mbgl::Sprite>, mbgl::TexturePool&, bool) (source.cpp:438)
==7466==    by 0x68C1A5: mbgl::Style::update(mbgl::MapData&, mbgl::TransformState const&, mbgl::TexturePool&) (style.cpp:82)
==7466==    by 0x548F5C: (anonymous namespace)::MockMapContext::update() (resource_loading.cpp:51)
==7466==    by 0x548FA3: (anonymous namespace)::MockMapContext::onTileDataChanged() (resource_loading.cpp:56)
==7466==    by 0x68CDE4: mbgl::Style::emitTileDataChanged() (style.cpp:212)
==7466==    by 0x68CBDB: mbgl::Style::onTileLoaded(bool) (style.cpp:191)
==7466==    by 0x700F38: mbgl::Source::emitTileLoaded(bool) (source.cpp:595)
==7466==    by 0x700CA2: mbgl::Source::tileLoadingCompleteCallback(mbgl::TileID const&, mbgl::TransformState const&, bool) (source.cpp:573)

The invalid `TransformState::getAngle()` read comes from the following: the
storage for `TransformState` is the [bound parameter in this
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L292-292). The callback itself is
copied into various lambda bindings and eventually winds up as the [after
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/map/tile_data.cpp#L89-89) for the worker task.

On the way out, `tileLoadingCompleteCallback` gets called via this callback
binding. It first does `emitTileLoaded`, which happens to cause [a _new_ work
request to be
queued](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae123
c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L250-250). This cancels the
in-progress work request, [by nulling-out the `after`
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/util/work_task.cpp#L34-34). But in fact, the after
callback is still executing. The next thing it does is [call
transformState.getAngle()](https://github.com/mapbox/mapbox-gl-native/blob/5e077
5d276f9ea3652bae123c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L574), but the
transformState is now gone.
2015-06-18 13:39:18 +03:00
John Firebaugh
3ef8d8728e Don't abandon a null texture 2015-06-18 13:39:18 +03:00
John Firebaugh
0cce08b67b Change StyleBucket::source to indirect reference
This eliminates a reference loop: VectorTileData holds StyleLayers which
hold StyleBuckets which held Sources which hold VectorTileDatas. This
breaks the StyleBucket -> Source link in favor of manually resolving the
reference where necessary.
2015-06-18 13:39:18 +03:00
Thiago Marcos P. Santos
044454417b Do not hold a reference to the Style at the [Live|Vector]TileData
Layers are added and removed dynamically on the Map thread when we use shape
annotations and we are iterating style.layers on the Worker thread without
any lock.

Now when we create a [Live|Vector]TileData at the Map thread we give it
a layers list (instead of the Style) and [Live|Vector]TileData will ultimately
make a copy of this list (on the Map thread, so no concurrency with
adding shape annotations).

The copy should be relatively cheap because we are using a shared pointer
for storing the layers on the list.
2015-06-18 13:39:18 +03:00
Thiago Marcos P. Santos
1f12bcee90 Support shape annotations on GLFWView
Add different random triangles count by using the keys 7, 8, 9 or 0.
Q will clear all the annotations.
W will remove one annotation.
2015-06-18 13:39:18 +03:00
Bruno de Oliveira Abinader
ff0e54f35a Cleaned up #defines for BUFFER_OFFSET 2015-06-18 09:48:34 +03:00
Justin R. Miller
7bef7b3107 update podspec to use debug symbols build during testing 2015-06-17 22:20:52 -07:00
Justin R. Miller
aa50f1136e [publish ios-v0.4.0-rc.1] 2015-06-17 21:55:57 -07:00
Justin R. Miller
3e5caba7a2 refs #1483: update Travis script for potential semver suffixes 2015-06-17 21:55:34 -07:00
Justin R. Miller
a619b519bc bump podspec 2015-06-17 21:48:36 -07:00
Minh Nguyễn
8fe23a004b Avoid null-change KVO notifications
If no access token is set in the Info.plist, avoid triggering a KVO notification about the access token changing. By the same token (heh), avoid pulling a C string out of the change dictionary if the access token is being nilled out.
2015-06-17 21:39:09 -07:00
Justin R. Miller
142c427bd6 manually handle GeoJSONVT for OS X 2015-06-17 21:38:57 -07:00
Justin R. Miller
6fba1464e3 Merge pull request #1748 from mapbox/1ec5-null-change
Avoid null-change KVO notifications
2015-06-17 21:37:21 -07:00
John Firebaugh
e8aa6cd6ff Fix an order-of-operations issue with tileLoadingCompleteCallback
==7466== Invalid read of size 8
==7466==    at 0x5F1D0B: mbgl::TransformState::getAngle() const (transform_state.cpp:159)
==7466==    by 0x700CD2: mbgl::Source::tileLoadingCompleteCallback(mbgl::TileID const&, mbgl::TransformState const&, bool) (source.cpp:574)

==7466==  Address 0xf1d1508 is 56 bytes inside a block of size 120 free'd
==7466==    at 0x4C2A4BC: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7466==    by 0x70AD61: std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (mbgl::Source::*)(mbgl::TileID const&, mbgl::TransformState const&, bool)> ()(mbgl::Source*, mbgl::TileID, mbgl::TransformState, bool)> >::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>) (functional:1894)
==7466==    by 0x7080EB: std::_Function_base::_Base_manager<std::_Bind<std::_Mem_fn<void (mbgl::Source::*)(mbgl::TileID const&, mbgl::TransformState const&, bool)> ()(mbgl::Source*, mbgl::TileID, mbgl::TransformState, bool)> >::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) (functional:1918)
==7466==    by 0x535033: _ZNSt8functionIFvvEEaSEDn (functional:2277)
==7466==    by 0x56A3F5: mbgl::WorkTask::cancel() (work_task.cpp:34)
==7466==    by 0x56146C: mbgl::WorkRequest::~WorkRequest() (work_request.cpp:13)
==7466==    by 0x50C5E0: std::default_delete<mbgl::WorkRequest>::operator()(mbgl::WorkRequest*) const (unique_ptr.h:76)
==7466==    by 0x50C411: std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >::reset(mbgl::WorkRequest*) (unique_ptr.h:344)
==7466==    by 0x50C374: std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >::operator=(std::unique_ptr<mbgl::WorkRequest, std::default_delete<mbgl::WorkRequest> >&&) (unique_ptr.h:251)
==7466==    by 0x743136: mbgl::TileData::reparse(mbgl::Worker&, std::function<void ()()>) (tile_data.cpp:89)
==7466==    by 0x6FEA7C: mbgl::Source::handlePartialTile(mbgl::TileID const&, mbgl::Worker&) (source.cpp:250)
==7466==    by 0x700338: mbgl::Source::update(mbgl::MapData&, mbgl::TransformState const&, mbgl::Style&, mbgl::GlyphAtlas&, mbgl::GlyphStore&, mbgl::SpriteAtlas&, mbgl::util::ptr<mbgl::Sprite>, mbgl::TexturePool&, bool) (source.cpp:438)
==7466==    by 0x68C1A5: mbgl::Style::update(mbgl::MapData&, mbgl::TransformState const&, mbgl::TexturePool&) (style.cpp:82)
==7466==    by 0x548F5C: (anonymous namespace)::MockMapContext::update() (resource_loading.cpp:51)
==7466==    by 0x548FA3: (anonymous namespace)::MockMapContext::onTileDataChanged() (resource_loading.cpp:56)
==7466==    by 0x68CDE4: mbgl::Style::emitTileDataChanged() (style.cpp:212)
==7466==    by 0x68CBDB: mbgl::Style::onTileLoaded(bool) (style.cpp:191)
==7466==    by 0x700F38: mbgl::Source::emitTileLoaded(bool) (source.cpp:595)
==7466==    by 0x700CA2: mbgl::Source::tileLoadingCompleteCallback(mbgl::TileID const&, mbgl::TransformState const&, bool) (source.cpp:573)

The invalid `TransformState::getAngle()` read comes from the following: the
storage for `TransformState` is the [bound parameter in this
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L292-292). The callback itself is
copied into various lambda bindings and eventually winds up as the [after
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/map/tile_data.cpp#L89-89) for the worker task.

On the way out, `tileLoadingCompleteCallback` gets called via this callback
binding. It first does `emitTileLoaded`, which happens to cause [a _new_ work
request to be
queued](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae123
c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L250-250). This cancels the
in-progress work request, [by nulling-out the `after`
callback](https://github.com/mapbox/mapbox-gl-native/blob/5e0775d276f9ea3652bae1
23c4e85cc05ae13bd5/src/mbgl/util/work_task.cpp#L34-34). But in fact, the after
callback is still executing. The next thing it does is [call
transformState.getAngle()](https://github.com/mapbox/mapbox-gl-native/blob/5e077
5d276f9ea3652bae123c4e85cc05ae13bd5/src/mbgl/map/source.cpp#L574), but the
transformState is now gone.
2015-06-17 17:07:17 -07:00
John Firebaugh
66c415a267 Don't abandon a null texture 2015-06-17 17:07:17 -07:00
John Firebaugh
fd58861fcd Change StyleBucket::source to indirect reference
This eliminates a reference loop: VectorTileData holds StyleLayers which
hold StyleBuckets which held Sources which hold VectorTileDatas. This
breaks the StyleBucket -> Source link in favor of manually resolving the
reference where necessary.
2015-06-17 17:07:16 -07:00
Thiago Marcos P. Santos
0581df8787 Do not hold a reference to the Style at the [Live|Vector]TileData
Layers are added and removed dynamically on the Map thread when we use shape
annotations and we are iterating style.layers on the Worker thread without
any lock.

Now when we create a [Live|Vector]TileData at the Map thread we give it
a layers list (instead of the Style) and [Live|Vector]TileData will ultimately
make a copy of this list (on the Map thread, so no concurrency with
adding shape annotations).

The copy should be relatively cheap because we are using a shared pointer
for storing the layers on the list.
2015-06-17 17:07:16 -07:00
Thiago Marcos P. Santos
4f3fc3c2c9 Support shape annotations on GLFWView
Add different random triangles count by using the keys 7, 8, 9 or 0.
Q will clear all the annotations.
W will remove one annotation.
2015-06-17 17:07:16 -07:00
Minh Nguyễn
bf6a100801 Avoid null-change KVO notifications
If no access token is set in the Info.plist, avoid triggering a KVO notification about the access token changing. By the same token (heh), avoid pulling a C string out of the change dictionary if the access token is being nilled out.
2015-06-17 16:49:12 -07:00
Justin R. Miller
dcbb5b2e4e manually handle GeoJSONVT for OS X 2015-06-17 15:52:00 -07:00
Minh Nguyễn
91641ffb01 Lightweight generics
Added lightweight generics annotations to collection-typed method and protocol signatures to streamline usage of these members in Swift. Lightweight generic type specifiers are wrapped in conditionally-compiled macros for compatibility with Xcode 6.x.

Manually preprocess the NS_*_OF() macros in a temporary copy of each header before appledoc sees the headers. Also removed the --ignore flag because we no longer have a private headers folder under include/mbgl/ios/.
2015-06-17 15:33:00 -07:00
Justin R. Miller
4806f7f0a5 fixes #1650: default to no symbols for release builds, but build both 2015-06-17 12:55:10 -07:00
Minh Nguyễn
e3e73220c1 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-17 12:55:05 -07:00
Minh Nguyễn
07d4075abb Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-17 12:54:57 -07:00
Minh Nguyễn
f50a27bc8a Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-17 12:54:48 -07:00
Justin R. Miller
73737445ec fixes #1650: default to no symbols for release builds, but build both 2015-06-17 12:48:11 -07:00
Minh Nguyễn
0686807a21 Audited shape annotation classes for nullability
Audited various classes to match MapKit. Also, `-[MGLAnnotation title]` is nullable because titles are optional for shape annotations.
2015-06-16 16:32:57 -07:00
Minh Nguyễn
416928f824 Defer to MGLMultiPoint for overlayBounds implementation
Fixes #1730.
2015-06-16 11:06:46 -07:00
Minh Nguyễn
df6ab1dc00 Corrected bundledStyleURLs doc comment
Per f46328655e (commitcomment-11695358).
2015-06-16 09:45:10 -07:00
Thiago Marcos P. Santos
4623baa1a5 Add tests for renderStill() misuse 2015-06-16 14:09:51 +03:00
Thiago Marcos P. Santos
57c34747a2 Report errors for renderStill() misuse using the callback
Use the callback provided for reporting the errors instead of throwing
an exception. The problem with the exception is it will happen on the
Map thread which makes it impossible to the user of our API to catch,
ultimately resulting in a crash.

In the scenario of not providing a callback, we just print an error.
2015-06-16 14:06:29 +03:00
Justin R. Miller
556938e8bb [publish ios-v0.3.5] 2015-06-15 22:20:52 -07:00