forked from Blendman974/faceclaw
Refactor texture cache usage to shared Kotlin for iOS
This commit is contained in:
1 parent
ccb320c66f
commit
07828db0bf
23 files changed
+552
-74
No files matched your search
@@ -1,8 +1,12 @@
|
||||
/** Workers send baked grayscale frames to the main-thread iOS compositor. */
|
||||
/** Workers send baked pixels and shared-Kotlin atlas references together. */
|
||||
const display = {
|
||||
submitSurfaceFrame(buffer: ArrayBuffer, surfaceId: string, _x: number, _y: number, width: number, height: number): void {
|
||||
submitSurfaceFrame(buffer: ArrayBuffer, surfaceId: string, _x: number, _y: number, width: number, height: number,
|
||||
_fingerprint?: string, _paintMs?: number, _frameId?: number, draws: ArrayBuffer | null = null): void {
|
||||
const data = NSData.dataWithBytesLength(interop.handleof(buffer), buffer.byteLength)
|
||||
global.postMessage({ type: 'surface-frame', surfaceId, width, height, pixels: data.base64EncodedStringWithOptions(0 as NSDataBase64EncodingOptions) })
|
||||
const drawData = draws ? NSData.dataWithBytesLength(interop.handleof(draws), draws.byteLength) : null
|
||||
global.postMessage({ type: 'surface-frame', surfaceId, width, height,
|
||||
pixels: data.base64EncodedStringWithOptions(0 as NSDataBase64EncodingOptions),
|
||||
draws: drawData?.base64EncodedStringWithOptions(0 as NSDataBase64EncodingOptions) })
|
||||
},
|
||||
}
|
||||
export function getActiveDisplay(): typeof display { return display }
|
||||
Reference in new issue
Block a user