New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardware automatic recognition #381
Comments
Yup, it's been on my mind to do something like this! |
Do you plan to add this feature in the next release? |
@talentqing Not sure, maybe. |
@talentqing You can enable it manually today though. |
I've decided to not do this because some animations perform much worse with hardware acceleration even when it supports it. It should continue to be used on a case by case basis. |
@gpeal Can you please provide an example (animation file) that enabling hardware acceleration makes it perform worse? |
@AndroidDeveloperLB Please read the article linked to in the docs. |
This article is very old, and I've read it already. In fact some of my comments are there. Question is, if it's safe to use now starting from certain Android version, why not enable by default? Do you think the " GAIA bugs" still occur on today's smartphones? Even on Android 5, 6, 7, 8 ... ? |
I mean, how could I know for sure that I can enable HA, and when ? |
@AndroidDeveloperLB You should ask Samsung, Huawei, Xiaomi, and whoever else makes Android phones. Phones, just like the software you or I ship, have bugs sometimes. For the most part, phones are getting more reliable and we've turned HA on for most of our animations but software acceleration is safer and since lottie is on billions of phones, I'm leaving the default on the safer option. |
@gpeal What's the logic you've chosen on your apps that use Lottie, of determining when to enable HA and when to disable it ? |
@talentqing I'm going to re-investigate this. |
Fixed by #1048 |
@gpeal So no need anymore for this API of enabling HA ? |
@AndroidDeveloperLB Correct, this will now be automatic and no manual work will be needed. The existing APIs were also removed. It will be in the next version that I'm preparing. Stay tuned. Not sure if it will be 2.9 or 3.0. |
@gpeal Good. Last time you were pessimistic about when I should enable it. :) |
While testing, I discovered that animations with lots of/large masks and mattes perform significantly worse with hardware acceleration than software acceleration on pre-Pie devices because of RenderNode#textureUpload. It is really hard to detect this dynamically so I'm leaving the default on automatic (with an additional heuristic for >4 mattes and masks) but having an option to set it to hardware/software manually. #381
Can you according to the features of animation to decide use hardware? Because most animations is so simple and no hardware porblem, if any animation use software will be stuck when the ui is complex and the mobile phone performance is bad.
for exmaple:
test.zip
this animation in hardware is performance obviously better than in software.
So I thing can according to the api of features and phone info to auto decide use hardware or software.
The text was updated successfully, but these errors were encountered: