Open SamuelScheit opened 1 month ago
Hello Samuel,
Thank you for this PR. I'm a bit torn about this. This is not a feature that will be available in the future. We also suspect that the current information in the debug prop might be somewhat erroneous. As this debug into be useful to you?
Yes, it's very useful. I'm currently implementing a custom skia list renderer and I need a way to measure the performance and fps. Especially to see frame drops when scrolling and rerendering. If FPS is erroneous an alternative would be to display the amount of dropped frames
we have reasons to believe that information might not be correct on Android, if you are building your own renderer, wouldn't be better to measure/display debug info on your side? But I think we will merge this change nonetheless 👍 Thank you for this.
I've tried to measure the rendering performance of the
<Canvas />
component and enabled the debug option by settingdebug
totrue
:and in early versions this worked and displayed the render time and average fps, however not anymore in the latest version
1.4.2
. (I unfortunately don't know when this bug got introduced)Before
https://github.com/Shopify/react-native-skia/blob/ddfa6eb2eafb125d713d013e5dd249959564c922/packages/skia/cpp/rnskia/RNSkDomView.cpp#L133-L138
To find the issue I've called measureText in RNSkDomView.cpp and found out that it returned 0. This means the text won't be rendered, probably because no valid font was registered/found. I've fixed this issue by getting the system font manager and initializing the font in the constructor:
and just reuse the
_font
when rendering the debug overlay:After