summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-06 03:02:50 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-07 20:28:44 -0800
commit6fcb9f4da12da595a82c933775d6608c5b0f4f23 (patch)
tree8f0457f86e972bde11e182a09b20486a4ca15c3b /ios
parent52844d474696463e3703e2e72d3c11119a4ec73a (diff)
downloadqtlocation-mapboxgl-6fcb9f4da12da595a82c933775d6608c5b0f4f23.tar.gz
[ios] Invalidate CADisplayLink
CADisplayLink holds a strong reference to its target, forming a cycle that must be broken with -[CADisplayLink invalidate] when the animation is complete. I don’t yet have enough faith that will-change and did-change notifications are always coming from mbgl in pairs, so this change limits CADisplayLink to when MGLMapView is in the view hierarchy. It also pauses the CADisplayLink when the view is hidden or the application is in the background. Finally, -[MGLMapView invalidate] has been renamed because that term tends not to mean “redraw” in Cocoa but is rather tied to timers. Fixes #3130. [ios] Also invalidate CADisplayLink on removal from window [ios] Also shut down CADisplayLink when view is hidden
Diffstat (limited to 'ios')
-rw-r--r--ios/benchmark/MBXBenchViewController.mm8
1 files changed, 4 insertions, 4 deletions
diff --git a/ios/benchmark/MBXBenchViewController.mm b/ios/benchmark/MBXBenchViewController.mm
index 2af2cacd1f..8a4e053460 100644
--- a/ios/benchmark/MBXBenchViewController.mm
+++ b/ios/benchmark/MBXBenchViewController.mm
@@ -11,7 +11,7 @@
#pragma mark - Debugging
/** Triggers another render pass even when it is not necessary. */
-- (void)invalidate;
+- (void)setNeedsGLDisplay;
/** Returns whether the map view is currently loading or processing any assets required to render the map */
- (BOOL)isFullyLoaded;
@@ -119,7 +119,7 @@ static const int benchmarkDuration = 200; // frames
idx++;
[self startBenchmarkIteration];
} else {
- [mapView invalidate];
+ [mapView setNeedsGLDisplay];
}
return;
}
@@ -134,7 +134,7 @@ static const int benchmarkDuration = 200; // frames
started = Clock::now();
NSLog(@"- Benchmarking for %d frames...", benchmarkDuration);
}
- [mapView invalidate];
+ [mapView setNeedsGLDisplay];
return;
}
@@ -146,7 +146,7 @@ static const int benchmarkDuration = 200; // frames
state = State::WarmingUp;
[self.mapView emptyMemoryCache];
NSLog(@"- Warming up for %d frames...", warmupDuration);
- [mapView invalidate];
+ [mapView setNeedsGLDisplay];
}
return;
}