livecode
livecode copied to clipboard
[[ TileCache ]] Use HardwareBuffer for direct memory access on Android
This patch modifies the creation and update of GL textures to use a native hardware buffer. This allows fast upload of texture data by accessing the underlying buffer and copying pixel data to the texture directly.
To do:
- [x] Make compatible with API < 26 (AHardwareBuffer calls need to be dlsym'd)
- [ ] Make work with 32-bit ARM
Of these the first is critical (otherwise the engine will not work on anything less than Android 8.0). The second would be nice, but isn't hugely important - 64-bit devices are common-place, even more so as API level increases.
@runrevmark I've revised this PR so that platform-specific code is moved to a seperate source file, and implemented the fallback for Android < 26. I've also abstracted the hardwarebuffer stuff generally and moved the #ifdef`d stuff to the bottom of the tilecache source as advised