Skip to content

Commit 5095c44

Browse files
fix(🍏): support for ProMotion 120hz (#2690)
* fix: canvas not rendering with 120 fps * Update DisplayLink.mm * Update DisplayLink.mm --------- Co-authored-by: William Candillon <[email protected]>
1 parent 712405d commit 5095c44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/skia/ios/RNSkia-iOS/DisplayLink.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ - (void)start:(block_t)block {
1010
_displayLink = [CADisplayLink displayLinkWithTarget:self
1111
selector:@selector(update:)];
1212

13+
if (@available(iOS 15.0, *)) {
14+
CAFrameRateRange rate = CAFrameRateRangeMake(60, 120, 120);
15+
_displayLink.preferredFrameRateRange = rate;
16+
} else {
17+
_displayLink.preferredFramesPerSecond = 60;
18+
}
19+
1320
// add the display link to the main run loop
1421
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop]
1522
forMode:NSRunLoopCommonModes];

0 commit comments

Comments
 (0)