Dimezis / BlurView

Dynamic iOS-like blur of underlying Views for Android
Apache License 2.0
3.48k stars 331 forks source link

Have you considered to add Vulkan or google's toolkit implementation? #198

Closed Danubis-Luo closed 5 months ago

Danubis-Luo commented 1 year ago

For devices under Android 31, google recommends using their toolkit or Vulkan to replace depreciated RenderScript for better performance. Have you considered to add those implementations to your library?

Dimezis commented 1 year ago

There's a RenderEffectBlur to replace RenderscriptBlur on newer APIs. Hope that works for you.

It's way simpler than the Vulkan or OpenGL approach, so I'm not really considering them

Danubis-Luo commented 1 year ago

But RenderEffect does not work on devices under Android 31.

Dimezis commented 1 year ago

Ah, by "under" you meant before Android 31. No, I'm not planning anything. I don't think it's worth the effort

Dimezis commented 1 year ago

The Toolkit could be integrated more or less painlessly, but there are still a couple of problems with it. 1) It allocates a bitmap on each blur call, which is not good, but could be avoided easily if forked 2) It's not clear if it's actually better than Renderscript, since it's also executed on the CPU. With Renderscript, there's at least a chance that a given device might still have RS GPU support. The Toolkit always runs on CPU though, so there's no good way to guess what algorithm would be faster on any particular device.