feat(🍏, 🤖): Realtime Skia effects on native views#3282
feat(🍏, 🤖): Realtime Skia effects on native views#3282wcandillon wants to merge 8 commits intoShopify:mainfrom
Conversation
|
Hi @wcandillon . I know this is a draft, but I’m wondering what is needed to get this to a workable PR? We have a use case where we currently use the snapshot of our whole app screen, which on Android isn’t ideal because it goes through the whole tree. |
|
That sounds good, you would be interested to run a shader or a prebuilt effect directly to the Android native view? Can you tell me a little bit more about the use-case? Doesn't need to be super detailed. This would only work for Android API Level 31+ is that ok? |
|
We have a longpress menu that blurs the screen behind the menu but keeps the item you press non-blurred. So it’s a mask and blur combination. Both our use cases require the whole app for the effect. We have some fallbacks in place for older devices (or currently the whole of Android because it’s so slow) so requiring api 31+ shouldn’t be a big problem. |
The goal of this PR is to provide snapshotting of native views for Skia.
On iOS this is done by making the feature faster and offering a shortcut if the snapshot is directly made on the main thread via Reanimated.
On Android, we will use setRenderEffect() (
API level >= 31) which somewhat a completely different feature but since it is using the same shader syntax as Skia (because it is indeed Skia) we think it's too good of an opportunity to pass. The overlap of use-cases is big there.