diff options
author | Julian Rex <julian.rex@gmail.com> | 2019-03-01 16:04:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 16:04:37 -0500 |
commit | 405e20e3c8e1ba489fb48ad76fcbe5738ce643b3 (patch) | |
tree | 443e9cc6be0fd7ccc76bb60b35015c1c6ff44ef4 | |
parent | 67a9dc35bf0c0113d429161be2c125e75981fb5d (diff) | |
download | qtlocation-mapboxgl-405e20e3c8e1ba489fb48ad76fcbe5738ce643b3.tar.gz |
[ios] CADisplayLink method now takes a parameter as required. (#14018)
-rw-r--r-- | platform/ios/Integration Tests/MGLMapViewIntegrationTest.m | 11 | ||||
-rw-r--r-- | platform/ios/ios.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 10 |
3 files changed, 19 insertions, 6 deletions
diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index 77e678d3ef..6b2e162c12 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -1,7 +1,7 @@ #import "MGLMapViewIntegrationTest.h" @interface MGLMapView (MGLMapViewIntegrationTest) -- (void)updateFromDisplayLink; +- (void)updateFromDisplayLink:(CADisplayLink *)displayLink; @end @implementation MGLMapViewIntegrationTest @@ -147,9 +147,10 @@ else if (self.mapView) { // Before iOS 10 it seems that the display link is not called during the // waitForExpectations below + timer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 - target:self.mapView - selector:@selector(updateFromDisplayLink) + target:self + selector:@selector(updateMapViewDisplayLinkFromTimer:) userInfo:nil repeats:YES]; } @@ -158,6 +159,10 @@ [timer invalidate]; } +- (void)updateMapViewDisplayLinkFromTimer:(NSTimer *)timer { + [self.mapView updateFromDisplayLink:nil]; +} + - (MGLStyle *)style { return self.mapView.style; } diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 63e80ebe66..55581ce554 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -484,6 +484,8 @@ CA65C4F821E9BB080068B0D4 /* MGLCluster.h in Headers */ = {isa = PBXBuildFile; fileRef = CA65C4F721E9BB080068B0D4 /* MGLCluster.h */; settings = {ATTRIBUTES = (Public, ); }; }; CA65C4F921E9BB080068B0D4 /* MGLCluster.h in Headers */ = {isa = PBXBuildFile; fileRef = CA65C4F721E9BB080068B0D4 /* MGLCluster.h */; settings = {ATTRIBUTES = (Public, ); }; }; CA6914B520E67F50002DB0EE /* MGLAnnotationViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6914B420E67F50002DB0EE /* MGLAnnotationViewIntegrationTests.m */; }; + CA7766832229C10E0008DE9E /* MGLCompactCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8848451CBAFB9800AB86E3 /* MGLCompactCalloutView.m */; }; + CA7766842229C11A0008DE9E /* SMCalloutView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA88488A1CBB037E00AB86E3 /* SMCalloutView.m */; }; CA88DC3021C85D900059ED5A /* MGLStyleURLIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CA88DC2F21C85D900059ED5A /* MGLStyleURLIntegrationTest.m */; }; CA8FBC0921A47BB100D1203C /* MGLRendererConfigurationTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CA8FBC0821A47BB100D1203C /* MGLRendererConfigurationTests.mm */; }; CAA69DA4206DCD0E007279CD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4A26961CB6E795000B7809 /* Mapbox.framework */; }; @@ -3050,10 +3052,12 @@ buildActionMask = 2147483647; files = ( CA4EB8C720863487006AB465 /* MGLStyleLayerIntegrationTests.m in Sources */, + CA7766842229C11A0008DE9E /* SMCalloutView.m in Sources */, CA34C9C3207FD272005C1A06 /* MGLCameraTransitionTests.mm in Sources */, 16376B0A1FFD9DAF0000563E /* MBGLIntegrationTests.m in Sources */, CA88DC3021C85D900059ED5A /* MGLStyleURLIntegrationTest.m in Sources */, CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */, + CA7766832229C10E0008DE9E /* MGLCompactCalloutView.m in Sources */, CAE7AD5520F46EF5003B6782 /* MGLMapSnapshotterSwiftTests.swift in Sources */, CA0C27922076C804001CE5B7 /* MGLShapeSourceTests.m in Sources */, 077061DA215DA00E000FEF62 /* MGLTestLocationManager.m in Sources */, diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index f5b51330a0..f9ccab1422 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1162,10 +1162,14 @@ public: #pragma mark - Life Cycle - -- (void)updateFromDisplayLink +- (void)updateFromDisplayLink:(CADisplayLink *)displayLink { MGLAssertIsMainThread(); + if (displayLink && displayLink != _displayLink) { + return; + } + if (_needsDisplayRefresh) { _needsDisplayRefresh = NO; @@ -1231,11 +1235,11 @@ public: self.mbglMap.setConstrainMode(mbgl::ConstrainMode::HeightOnly); } - _displayLink = [self.window.screen displayLinkWithTarget:self selector:@selector(updateFromDisplayLink)]; + _displayLink = [self.window.screen displayLinkWithTarget:self selector:@selector(updateFromDisplayLink:)]; [self updateDisplayLinkPreferredFramesPerSecond]; [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; _needsDisplayRefresh = YES; - [self updateFromDisplayLink]; + [self updateFromDisplayLink:_displayLink]; } else if ( ! isVisible && _displayLink) { |