PANA-5027: Support svgs with navigation3#3027
Merged
Merged
Conversation
2c9ea68 to
d9ee674
Compare
|
🎯 Code Coverage 🔗 Commit SHA: 0b7cdaa | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3027 +/- ##
===========================================
- Coverage 71.19% 71.15% -0.04%
===========================================
Files 859 862 +3
Lines 31443 31543 +100
Branches 5302 5319 +17
===========================================
+ Hits 22383 22443 +60
- Misses 7560 7590 +30
- Partials 1500 1510 +10
🚀 New features to boost your workflow:
|
0xnm
reviewed
Nov 27, 2025
ambushwork
reviewed
Nov 27, 2025
2307cc6 to
103eaa7
Compare
0948195 to
00e7a04
Compare
00e7a04 to
3823714
Compare
0xnm
previously approved these changes
Dec 2, 2025
0xnm
reviewed
Dec 3, 2025
ec3cd85 to
0b7cdaa
Compare
0xnm
approved these changes
Dec 3, 2025
ambushwork
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Navigation3 bumps the compose-ui dependency to 1.9. Whereas previously we could get argb8888 from vectorDrawables with version 1.5, with 1.9 we get alpha8. In this pr, we convert the alpha8 mask into a grayscale bitmap, using the alpha transparency to set the level of gray. This means we lose color information but we have a performant method to keep supporting svgs.
To improve performance, we don't want to generate bitmaps from alpha8 on every recomposition. We therefore sample 16 horizontal and vertical or 256 alpha value points from every alpha8 in order to create a fast and accurate signature and use that to determine whether we have seen that svg before and whether a bitmap should be generated. This method is resistant to instance or id change of the svg, doesn't rely on unreliable internal metadata, and should have a minimal risk of collisions. The signature to resourceId is maintained in an lrucache similar to what exists for native bitmaps.