summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@mapbox.com>2019-04-02 22:14:05 -0400
committerJulian Rex <julian.rex@mapbox.com>2019-04-02 22:14:52 -0400
commitbc4d3abfb168b21ca3a268e76a32dd3025c262d7 (patch)
tree6b85b21b30bd58b26d75c54d52808c6185fd13b2
parentda1c4de10ba2026f08217a590d3d453b4a1cf41d (diff)
downloadqtlocation-mapboxgl-bc4d3abfb168b21ca3a268e76a32dd3025c262d7.tar.gz
Toggle presentsWithTransactions when enablePresentsWithTransaction changes (if visible)
-rw-r--r--platform/ios/src/MGLMapView.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 2ec47b0bcd..592973fabd 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1267,6 +1267,22 @@ public:
[self updateDisplayLinkPreferredFramesPerSecond];
}
+- (void)setEnablePresentsWithTransaction:(BOOL)enablePresentsWithTransaction
+{
+ if (_enablePresentsWithTransaction == enablePresentsWithTransaction)
+ {
+ return;
+ }
+
+ _enablePresentsWithTransaction = enablePresentsWithTransaction;
+
+ // If the map is visible, change the layer property too
+ if (self.window) {
+ CAEAGLLayer *eaglLayer = MGL_OBJC_DYNAMIC_CAST(_glView.layer, CAEAGLLayer);
+ eaglLayer.presentsWithTransaction = enablePresentsWithTransaction;
+ }
+}
+
#ifdef MGL_RECREATE_GL_IN_AN_EMERGENCY
// See https://github.com/mapbox/mapbox-gl-native/issues/14232
- (void)emergencyRecreateGL {