Hope the MovieClip's BlurFilter can be displayed correctly on Android Device if the App is packaged in GPU mode
Description
- Will this change the current API? How?
No, this is an existing API, but when GPU APKs run on Android devices, there is no blur effect (by the way, "CPU" or "Direct" APKs do work). The code looks like this:
myMovieClip.filters = [new BlurFilter(10, 10, 4)];
In macOS, it looks like this:
It looks like this on an Android phone (GPU mode):
- Who will benefit from this feature? Blur effects are heavily used in current app design, so those who use the Air SDK to create highly simulated interactive demos will benefit from it. In order to simulate blur UI design, and only GPU mode can make the phone run this apk smoothly, I suggest Air SDK should to support blur effect in Android phones with GPU mode.
You could try out the Starling Framework, which supports filters like Blur (in direct render mode),
not sure if it now even supports running in GPU mode with AIR SDK 50.2.4.3 due to
Allowing Stage3D contexts to be created in Android gpu rendering mode Github-2869 https://github.com/airsdk/Adobe-Runtime-Support/issues/286
(^^at least for Android..)
However, performance-wise, there is no need to run in GPU mode, as the performance is already very good. I can only recommend you to give it a try. The Starling Framework has some real nice features and is very easy and intuitive to get into. In the case you are then looking for components and UI, check out Feathers (https://feathersui.com/learn/as3-starling/), which is based on Starling
@Pinton It's been ages since I had read blog posts from some of the Adobe engineers describing all of the technical details, but I had thought the method of how AIR converts and optimizes vector graphics into meshes for GPU rendering is the reason why we get such a great performance boost from it, but also why it can't support filters like it can with CPU/direct. As for why it's showing correctly on a Mac, GPU render mode works differently on desktop, where it's more or less like direct mode (though with a few performance differences, especially at 4K display.)
We use GPU mode exclusively for mobile since we rely heavily on vector graphics. To work around the filter limitation, when we need filters, we draw our vector content into BitmapData and apply filters that way (applyFilter still works on BitmapData). Or you can first add filters to the MovieClip off-screen, and when you draw that MovieClip to a BitmapData object it will also show the filters, even though the MovieClip itself wouldn't have shown them. Or if you're only using raster content instead of a mix of vector and bitmaps, Starling would be the way to go for that.