cvzi / darkmodewallpaper

🌓 A live wallpaper for Android that respects dark theme mode 🌇
https://f-droid.org/packages/com.github.cvzi.darkmodewallpaper/
GNU General Public License v3.0
154 stars 11 forks source link

Very laggy animation when switching background/lauchner pages #51

Closed rugk closed 1 year ago

rugk commented 2 years ago

When swiping right/left on my launcher the background screen follows, but:

This is blocking me from using it.

system

Device: Pixel 4 (flame). OS: Android 12, CalyxOS 3.4.0. source: F-Droid. version: v 1.2.6 Build-ID: SP2A.220405.004.22304000

rugk commented 2 years ago

Also the "zoom animation" (for notification swiping) does not seem to have any effect/work here. When comparing it with a native background image I can see the difference.

cvzi commented 2 years ago

It seems there is only an older CalyxOS version 2.5.0 for the Android Emulator, I will try that to investigate.

I expect the app to be a little bit slower than the normal backgrounds, because the app uses bitmaps and canvas instead of directly OpenGL.

Regarding the zoom animation, I have set that to an arbitrary amount of zoom, because there was no hint in the Android documentation on how much it should zoom in. Maybe I have set it to a too low value.

cvzi commented 2 years ago

I found a problem on Android 12 on the Emulator. A ColorFilter set with Paint.setColorFilter() causes the Bitmap drawing to be about 3-4x slower on Android 12 than on Android 11.

The color filter was previously always enabled. Now it is only enabled when it is really needed, that is when the brightness or contrast of the wallpaper were changed in the app. If brightness or contrast were not changed, the ColorFilter is set to null, which improves the drawing speed a lot.

Now I'll need to find a solution for the case when brightness or contrast were changed.

rugk commented 2 years ago

Awesome, yeah generally I think a fundamental issue of your app may be that you cannot use hardware acceleration, can you?

cvzi commented 2 years ago

As far as I know it cannot use hardware acceleration this way, it's only possible with OpenGL. OpenGL seemed like a lot of work to setup and it was/is working fine on my own phone. Probably because I have a budget phone with a very small screen of 720 x 1570 pixel