react-native-skia icon indicating copy to clipboard operation
react-native-skia copied to clipboard

fix: ios canvas ProMotion 120hz

Open samuelscheit opened this issue 1 year ago • 1 comments

Currently react-native-skia is only rendering with a maximum of 60 fps on iOS, even if the device supports 120 fps.

I've tried to screen record the behaviour, but interestingly enough it seems to render at 120 fps if I'm screen recording. So I resorted to a camera slow mo recording:

Before After

@chrfalch describes the fix in a discussion comment https://github.com/Shopify/react-native-skia/discussions/1275#discussioncomment-4715887:

CAFrameRateRange rate;
rate.maximum = 120;
rate.preferred = 120;
_displayLink.preferredFrameRateRange = rate;

which I applied to the DisplayLink.mm file with a fallback:

_displayLink.preferredFramesPerSecond = 120;

if the iOS version is lower than 15.0.

samuelscheit avatar Oct 13 '24 18:10 samuelscheit

I have signed the CLA!

samuelscheit avatar Oct 13 '24 19:10 samuelscheit

finally we can merge it :) Thank you for this :)

wcandillon avatar Oct 28 '24 16:10 wcandillon

:tada: This PR is included in version 1.5.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Nov 01 '24 14:11 github-actions[bot]