livecode icon indicating copy to clipboard operation
livecode copied to clipboard

[[ TileCache ]] Use HardwareBuffer for direct memory access on Android

Open livecodeian opened this issue 5 years ago • 1 comments

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.

livecodeian avatar Sep 15 '20 12:09 livecodeian

@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

livecodeian avatar Oct 28 '20 17:10 livecodeian