summaryrefslogtreecommitdiff
path: root/src/mbgl
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove MapData dependency from AnnotationManagerJohn Firebaugh2015-06-243-22/+18
|
* Transform needs only a single TransformStateJohn Firebaugh2015-06-242-94/+81
|
* Cleaned up remaining bool function return valuesBruno de Oliveira Abinader2015-06-232-35/+35
|
* Improve readibility for style parser resultsBruno de Oliveira Abinader2015-06-232-96/+104
| | | | | Introduces StyleParser::Result being a std::tuple<Status, T>, where StyleParser::Status is a boolean enumerator which improves readibility.
* Fix result value from parseProperty when T = std::array<float, 2>Bruno de Oliveira Abinader2015-06-221-2/+2
|
* Check libuv version semver-ishlyMike Morris2015-06-191-1/+1
| | | | Fixes https://github.com/mapbox/node-mapbox-gl-native/issues/137
* propertly initialize the nameKonstantin Käfer2015-06-191-1/+1
|
* Fix an order-of-operations issue with tileLoadingCompleteCallbackJohn Firebaugh2015-06-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==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.
* Don't abandon a null textureJohn Firebaugh2015-06-181-2/+4
|
* Change StyleBucket::source to indirect referenceJohn Firebaugh2015-06-186-22/+31
| | | | | | | 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.
* Do not hold a reference to the Style at the [Live|Vector]TileDataThiago Marcos P. Santos2015-06-187-24/+27
| | | | | | | | | | | | | | 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.
* Cleaned up #defines for BUFFER_OFFSETBruno de Oliveira Abinader2015-06-189-30/+2
|
* Report errors for renderStill() misuse using the callbackThiago Marcos P. Santos2015-06-161-2/+14
| | | | | | | | | 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.
* squash of #1655: shape annotations support for core & iOSJustin R. Miller2015-06-1514-502/+696
|
* Revert "use array of structs rather than parallel arrays for annotations"Minh Nguyễn2015-06-153-11/+11
| | | | This reverts commit 2435c1ad2603432186ee61eb4c423244a088bc51 (#1710), which needs to be revisited in light of #1655, which is a much higher priority at the moment.
* fix roundabout not closed #1450hanchao2015-06-141-1/+1
|
* use array of structs rather than parallel arrays for annotationsKonstantin Käfer2015-06-113-11/+11
|
* fix text-letter-spacing render test by using floatAnsis Brammanis2015-06-091-2/+2
|
* allow constructing LatLng/LatLngBounds objects from TileIDsKonstantin Käfer2015-06-081-0/+19
|
* Add documentation for TileData::StateThiago Marcos P. Santos2015-06-051-1/+34
|
* Remove unused overscaling variablesJohn Firebaugh2015-06-045-10/+3
|
* Cleanup the MapContext before the util::Thread destructorThiago Marcos P. Santos2015-06-043-0/+8
| | | | | | | | | | The util::Thread will call the stop() method of the MapContext's RunLoop which will wait for the pending tasks tied to it to complete. If we have a request that is timeout'ing, this could mean a really long wait. Instead, we now send a cleanup message that will reset all the attributes first (canceling the pending requests) so the the MapContext gets destructed quickly.
* Fix race condition on error notificationThiago Marcos P. Santos2015-06-043-0/+12
| | | | | | | | | We start loading the resources at the moment we set the style, but we set the callback for error notification at renderStill(), which happen afterwards. If some error occurs in this short window, it was never being notified. Now we save the last error and we check after we set the callback.
* Merge remote-tracking branch 'origin/master' into HEADAnsis Brammanis2015-06-0311-372/+240
|\ | | | | | | | | Conflicts: src/mbgl/renderer/painter_fill.cpp
| * Remove references to ResourceLoaderThiago Marcos P. Santos2015-06-022-2/+2
| | | | | | | | ResourceLoader got merged with Style.
| * Remove unused; fix naming styleJohn Firebaugh2015-06-012-9/+5
| |
| * Merge ResourceLoader into Style and move atlas ownershipJohn Firebaugh2015-06-0111-370/+242
| |
* | fix collision box clippingAnsis Brammanis2015-06-033-16/+17
| | | | | | | | and name parameters when it's not clear from their type
* | fix hangs caused by redoPlacementAnsis Brammanis2015-06-024-13/+8
| | | | | | | | | | | | | | | | | | After parsing a tile, it redoes placement for that tile if the angle has changed since it started parsing. These redo calls were accidentally done from the worker thread. Assigning the new work to `workRequest` caused it to cancel itself. Fix the problem by calling redoPlacement from the map thread.
* | fix android compile errorsAnsis Brammanis2015-06-022-4/+5
| | | | | | | | | | - explicitly mark override - re-add fix from 74604af that was lost in a merge
* | use source zoom level for tile loading errorsAnsis Brammanis2015-06-021-1/+1
| |
* | re-add sprite atlas pollution fixAnsis Brammanis2015-06-021-1/+2
| | | | | | | | | | It got missed in a merge. https://github.com/mapbox/mapbox-gl-native/commit/03d5e2da80111e225c2478286b60dd4e9b7ec527
* | fix assertion. only include glyphs with metricsAnsis Brammanis2015-06-021-1/+1
| | | | | | | | | | fixes bug caught by this assertion: https://github.com/mapbox/mapbox-gl-native/blob/de3fd89b2cb259c965629aa9aea17729511229f7/src/mbgl/text/font_stack.cpp#L124
* | sort overlapping symbols in the y directionAnsis Brammanis2015-06-023-27/+72
| | | | | | | | | | | | | | fixes #333 fixes #988 -js: 6514de77be2ff3df4267785f42f5e53c63233cac
* | use floats when resampling lines to match -jsAnsis Brammanis2015-05-291-3/+3
| | | | | | | | This fixes many small render test and collision differences.
* | Merge remote-tracking branch 'origin/master' into new-labellingAnsis Brammanis2015-05-2842-550/+752
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/mbgl/map/source.cpp src/mbgl/map/source.hpp src/mbgl/map/tile_data.cpp src/mbgl/map/tile_parser.cpp src/mbgl/map/vector_tile_data.cpp src/mbgl/renderer/painter.cpp src/mbgl/renderer/symbol_bucket.cpp src/mbgl/text/glyph.hpp src/mbgl/text/glyph_store.cpp src/mbgl/text/placement.cpp test/suite
| * Notify tile parsing errorsThiago Marcos P. Santos2015-05-285-19/+50
| | | | | | | | | | | | | | | | | | | | | | The tile parsing is done in a worker thread and if it fails, we set the tile state to "obsolete" and set an error message. When the completion callback is fired, we check for the error message and if it is set, we emit the error signal. The trick here is the signal cannot be emitted directly from the worker thread because that would violate data ownership rules.
| * Notify glyph parsing errorsThiago Marcos P. Santos2015-05-283-4/+15
| | | | | | | | Emit a signal when the glyphs are not parsed correctly.
| * Notify sprite parsing errorsThiago Marcos P. Santos2015-05-282-10/+19
| | | | | | | | | | Emit a signal when the JSON or the sprite image was not parsed correctly.
| * Replace mbgl::util::make_unique<> with std::make_unique<>Konstantin Käfer2015-05-2628-79/+57
| |
| * DefaultFileSource has responsibility for handling mapbox:// URLsJohn Firebaugh2015-05-268-43/+30
| |
| * Do not call abandon texture if there is no textureThiago Marcos P. Santos2015-05-221-2/+4
| | | | | | | | | | Check if the texture was created before abandoning on SpriteAtlas destructor. Linux driver was fine with that, but was crashing on Mac.
| * split up glyph_store.cpp into multiple filesKonstantin Käfer2015-05-229-298/+337
| |
| * Notify failures when loading glyphsThiago Marcos P. Santos2015-05-224-17/+53
| |
| * Notify failures when loading tilesThiago Marcos P. Santos2015-05-226-12/+42
| |
| * Notify failures when loading the sprite JSON and imageThiago Marcos P. Santos2015-05-224-9/+34
| |
| * Notify failures when loading the source JSONThiago Marcos P. Santos2015-05-224-2/+24
| |
| * Add callback for error notifications on renderStill()Thiago Marcos P. Santos2015-05-224-2/+30
| | | | | | | | | | | | | | | | | | The callback will be called when any of the resources requested from the network failed to load. There is not recovery implemented yet, so the closest thing to reseting the Map object and reloading all the resources would be setting a new style.
| * Add Thread tests; get argument transfer working for all casesJohn Firebaugh2015-05-212-52/+57
| |
| * Merge pull request #1453 from mapbox/1ec5-whee-2Minh Nguyễn2015-05-191-0/+1
| |\ | | | | | | Prevent full-circle spin during animated rotation