summaryrefslogtreecommitdiff
path: root/include/mbgl/style/layers
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-12-07 00:01:11 -0800
committerGitHub <noreply@github.com>2016-12-07 00:01:11 -0800
commita39f53df22246cc85be17933b6c99897786d2222 (patch)
treede29e06b9f12a89bf179fa7c0033984664ab40f5 /include/mbgl/style/layers
parent4c2aec2355b166174bd062b1d27f8f89fad6008c (diff)
downloadqtlocation-mapboxgl-a39f53df22246cc85be17933b6c99897786d2222.tar.gz
[ios, macos] Migrate MGLCustomStyleLayerAdditions to style layer API (#7250)
* [ios, macos] Replaced custom style layer API with MGLOpenGLStyleLayer Replaced the custom style layer API on MGLMapView with an equally unsupported MGLOpenGLStyleLayer API that nonetheless is consistent with the broader runtime styling API and is compatible with macOS. Fixed an unrecognized selector crash when wrapping a layer of unrecognized type coming from mbgl. * [macos] Added lime green layer demo to macosapp Reprised the demo removed from iosapp in #5091. * [ios, macos] Rationalized MGLOpenGLStyleLayer API MGLStyle now strongly references any MGLOpenGLStyleLayer object that’s added to it, in order to prevent pointers from going stale and make it easy for layer drawing code to get more information about the map view. Replaced the MGLOpenGLStyleLayer callback blocks with overridable instance methods. Added internal documentation for each method. Subclassed MGLOpenGLStyleLayer as LimeGreenStyleLayer inside macosapp. Consolidated -addToMapView: into -addToMapView:belowLayer: to ensure that MGLRedundantLayerException gets raised even if the layer is being inserted rather than added to the bottom of the stack. * [core] Clarified that rendering happens on the main thread * [ios, macos] Fixed removing and re-adding MGLOpenGLStyleLayer Don’t allow index-based layer removal to circumvent -removeFromMapView:, which MGLOpenGLStyleLayer relies on to synchronize the style’s array of MGLOpenGLStyleLayers. When obtaining an MGLOpenGLStyleLayer, get the instance already added to the style instead of creating a new one to wrap the underlying CustomLayer.
Diffstat (limited to 'include/mbgl/style/layers')
-rw-r--r--include/mbgl/style/layers/custom_layer.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp
index 87bce06f41..1b62f82a25 100644
--- a/include/mbgl/style/layers/custom_layer.hpp
+++ b/include/mbgl/style/layers/custom_layer.hpp
@@ -7,8 +7,8 @@ namespace style {
/**
* Initialize any GL state needed by the custom layer. This method is called once, from the
- * rendering thread, at a point when the GL context is active but before rendering for the
- * first time.
+ * main thread, at a point when the GL context is active but before rendering for the first
+ * time.
*
* Resources that are acquired in this method must be released in the UninitializeFunction.
*/
@@ -40,7 +40,7 @@ using CustomLayerRenderFunction = void (*)(void* context, const CustomLayerRende
/**
* Destroy any GL state needed by the custom layer, and deallocate context, if necessary. This
- * method is called once, from the rendering thread, at a point when the GL context is active.
+ * method is called once, from the main thread, at a point when the GL context is active.
*
* Note that it may be called even when the InitializeFunction has not been called.
*/