summaryrefslogtreecommitdiff
path: root/libs/androidfw/AttributeResolution.cpp
diff options
context:
space:
mode:
author Michael Hoisie <hoisie@google.com> 2024-08-06 00:12:32 +0000
committer Michael Hoisie <hoisie@google.com> 2024-09-27 19:29:22 +0000
commitc7bd207395fc64249cfb1273f693ec5f64e6089d (patch)
tree3e11f6fa2cf8d2321bb841b4d4ae1a0745bc0785 /libs/androidfw/AttributeResolution.cpp
parent6b09d0b0c2cd21edebd3be722baffa47f2faff02 (diff)
Add an alternative to PathIterator.nNext for host
PathIterator uses VMRuntime.newNonMovableArray and VMRuntime.addressOf to create a region of memory for iterating over path segments. However, VMRuntime.newNonMovableArray and VMRuntime.addressOf are libcore-only and not supported on the host JVM. This causes problems when Compose animations run on host runtimes such as LayoutLib, Ravenwood, and Robolectric. Add a variant method PathIterator.nNextHost that passes the float array (not just the address) to a regular JNI method. An alternative to this would be to convert `nNext` to a `FastNative`, but that would slow it down on Android. Another alternative would be to require LayoutLib/Ravenwood/Robolectric to use some DirectByteBuffer hacks to simulate a non-movable address, but that would require each framework to delegate/fake/shadow parts of PathIterator. This approach solves it in one fell swoop. Flag: NONE host-only change Bug: 354621198 Bug: 357624564 Test: cts PathIteratorTest Change-Id: Idfd2b6e41b499efffbbf5cbef343183981edd7b2
Diffstat (limited to 'libs/androidfw/AttributeResolution.cpp')
0 files changed, 0 insertions, 0 deletions