-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
implement sdf icons #537
implement sdf icons #537
Conversation
I think it looks better with SDF, but on my Galaxy A3 the SDF creation takes 1.8s (in addition to the 1.6s for bitmap icon creation). Maybe the icons could be created in parallel, similar to scanning for quests? |
Oof. So it's 3+ seconds until you first see the map(?) One thing that comes... ah, I see you edited your posts. Yes, that could be an option. I had that at the very start when I created the MapIcons file, but the gain was miniscule to not-existing. Not sure if it would be different with calculating the SDFs. |
From pressing the SC (debug) icon until I see the map it's about 6 seconds (without SDF icons). |
Also not sure, quite possibly there is enough other stuff happening in parallel anyway. |
For me, it makes a world of a difference whether the debugger is connected or not. Try without connecting the debugger to find the proper times. |
It's only debug APK, not connected to the PC. |
Hui. For me, cold start takes 2.5s until I see the map with icons. (1s I see the loading-screen, 1s I see the app but not the map and 0.5s I see the map but not the icons.) |
Anyway, given you are the "performance guy" due to preferring old(er) devices, I feel like you should decide on whether the additional startup time is worth it. You could also test if parallelization would decrease the time. My guess is that it would, because the SDF calculation is completely a CPU thing, no IO involved. Another solution I could imagine would reduce loading time pretty much is to create some kind of |
Release APK takes about 3 seconds, so that should be ok. |
You mean cold start, or loading of graphics? |
Cold start, same thing where the debug APK takes 6 seconds.
I'll test the parallelization (edit: but tomorrow, or whenever the cleaner is has run) |
Note that the cleaner does not clean the tiles because it needs MapLibre.getInstance() on the main thread and the main thread is not available in a worker. Sadly, this means that cleaning old offline tiles will only work if it runs while the app is running. (I.e. I think the cleaner cleans one hour after the app was started? So, have the app open for one hour or something...) So, maybe the by-age tilecache is not worthwhile to implement ourselves (because it does only work in rare circumstances) and instead it should be done in maplibre-proper as |
Now creating the bitmaps takes 1.5s (down from 3.4 in a single thread). (edit: 1s on release APK)) |
Cool! This means that more initialization work is done on the UI thread, so the other CPU cores are not used to capacity (unlike you suspected earlier). |
So this can be merged now. Regarding the other or related topics that were discussed here:
|
Oh, actually, there is a TODO left here. You are testing with a Galaxy A3, right? According to gsmarena, it has a display density of 245ppi, which should translate to After having read the background info posted in maplibre/maplibre-native#2281 , I am not so sure about that my conclusion is correct. Maybe the issue is rather that the SDF icons should be created by using a certain "default" blur radius instead (that coincides with the blur radius used for font SDF creation). Anyway, TLDR: Would you make a screenshot with your device of a preset icon+text and see if the halo width is the same? |
I would not expect any difference, given that the change in
I think it is, at least the first time reading it. I can change it to use
Going by
Um... nearby elements don't show any halo, things overlay does but doesn't have text, and places overlay doesn't show any icons at all (I had thought it's because they are blocked by quest pins, but even when hiding quests the places don't appear) |
Huh.... that's new... |
I implemented SDF icons. Basically, you have to blur a black-and-white graphic to achieve an SDF.
But should we use this, after all?
Pro:
For the buildings, a halo would be nice, but neither necessary (imo) not possible (with maplibre halos at least)
Contra: