forked from Blendman974/faceclaw
Refactor iOS version to use a bunch more shared code
This commit is contained in:
1 parent
c3a0ba9f56
commit
4a194e37bb
40 files changed
+1874
-2605
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { fromData, toData } from '../native/kotlin-data'
|
||||
import type { TextureFrame } from '../g2/texture-planner'
|
||||
import type { SurfaceConfiguration, SurfaceRect } from './surface-compositor'
|
||||
export type { SurfaceConfiguration, SurfaceRect } from './surface-compositor'
|
||||
declare const FaceclawKitIosSurfaceCompositor: any
|
||||
@@ -35,8 +34,4 @@ export class SurfaceCompositor {
|
||||
}
|
||||
setShellScene(bytes: Uint8Array): void { this.native.shellData(toData(bytes)) }
|
||||
composite(): Uint8Array { return fromData(this.native.composite()) }
|
||||
compositeFrame(): { pixels: Uint8Array; textures: TextureFrame } {
|
||||
const native = this.native.compositeFrame()
|
||||
return { pixels: fromData(native.pixels), textures: { native } }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { presentationRecords, readPresentation, paintPresentation, type Selection } from "./presentation-wire"
|
||||
/** Platform-independent 8bpp surface composition for the local display. */
|
||||
import type { TextureFrame } from '../g2/texture-planner'
|
||||
export type SurfaceRect = { x: number; y: number; width: number; height: number }
|
||||
export type SurfaceConfiguration = SurfaceRect & {
|
||||
zOrder: number
|
||||
@@ -55,7 +54,6 @@ export class SurfaceCompositor {
|
||||
surface.pixels.set(pixels.subarray(source, source + right - left), y * surface.width + left)
|
||||
}
|
||||
}
|
||||
compositeFrame(): { pixels: Uint8Array; textures?: TextureFrame } { return { pixels: this.composite() } }
|
||||
composite(): Uint8Array {
|
||||
const output = new Uint8Array(this.width * this.height)
|
||||
if (this.blanked) return output
|
||||
|
||||
Reference in new issue
Block a user