diff options
author | Andrew Kitchen <andrew.kitchen@mapbox.com> | 2018-01-03 17:16:30 -0800 |
---|---|---|
committer | Andrew Kitchen <akitchen@gmail.com> | 2018-01-19 20:28:57 -0500 |
commit | 2c48871c065c6efec42c5660c9560ecdfaa8d359 (patch) | |
tree | 4a04691c5de64c101146c68c47a429eaddc24e44 /platform/darwin/src/MGLOpenGLStyleLayer.mm | |
parent | 40a0b2deb78ac3b03dc4966797edb8e0dc8a415e (diff) | |
download | qtlocation-mapboxgl-2c48871c065c6efec42c5660c9560ecdfaa8d359.tar.gz |
Adds an integration test harness to the iOS project
This will allow us to write lightweight integration tests between MGLMapView and the core renderer.
Also includes a test for the recent custom layer memory fix, reverting the fix in order to demonstrate the failing test.
Diffstat (limited to 'platform/darwin/src/MGLOpenGLStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLOpenGLStyleLayer.mm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm index 8933a77382..2bc76c9912 100644 --- a/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm @@ -47,7 +47,8 @@ void MGLDrawCustomStyleLayer(void *context, const mbgl::style::CustomLayerRender when creating an OpenGL style layer. */ void MGLFinishCustomStyleLayer(void *context) { - MGLOpenGLStyleLayer *layer = (__bridge_transfer MGLOpenGLStyleLayer *)context; + //TODO: AK: revert once failing test established + MGLOpenGLStyleLayer *layer = (__bridge MGLOpenGLStyleLayer *)context; [layer willMoveFromMapView:layer.style.mapView]; } @@ -101,7 +102,8 @@ void MGLFinishCustomStyleLayer(void *context) { MGLPrepareCustomStyleLayer, MGLDrawCustomStyleLayer, MGLFinishCustomStyleLayer, - (__bridge_retained void *)self); + //TODO: AK: revert once failing test established + (__bridge void *)self); return self = [super initWithPendingLayer:std::move(layer)]; } @@ -116,7 +118,10 @@ void MGLFinishCustomStyleLayer(void *context) { [NSException raise:@"MGLLayerReuseException" format:@"%@ cannot be added to more than one MGLStyle at a time.", self]; } + //TODO: AK: remove once failing test established + _style.openGLLayers[self.identifier] = nil; _style = style; + _style.openGLLayers[self.identifier] = self; } - (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer { |