Add Glanceboard depth setting

This commit is contained in:
James Babcock committed 2026-09-24 02:26:20 -07:00
1 parent 71c1971992
commit 915f155819
29 files changed
+262 -50

No files matched your search

+4
View File
@@ -524,6 +524,10 @@ export class FaceclawCommunicatorBridge {
await this.enqueueNativeCall(() => { this.communicator.setSurfaceVisibleIdVisible(id, Boolean(visible)); });
}
async setSurfaceDepth(id: string, depth: number): Promise<void> {
await this.enqueueNativeCall(() => { this.communicator.setSurfaceDepthIdDepth(id, Math.round(depth)); });
}
async setScreenBlanked(blanked: boolean): Promise<void> {
await this.enqueueNativeCall(() => { this.communicator.setScreenBlankedBlanked(Boolean(blanked)); });
}
+10
View File
@@ -550,6 +550,16 @@ export class FaceclawCommunicatorBridge {
});
}
/**
* Stereo depth for a surface, applied while it is the topmost visible
* surface and opaquely covers the screen; takes effect at its next frame.
*/
async setSurfaceDepth(id: string, depth: number): Promise<void> {
await this.enqueueJavaCall(() => {
this.communicator.setSurfaceDepth(id, Math.round(depth));
});
}
/**
* Blank (screen off) or unblank the composited output; retained surface
* state survives, so unblanking restores the screen without repaints.
+5
View File
@@ -14,6 +14,7 @@ export type DisplayTarget = Pick<
| "configureSurface"
| "removeSurface"
| "setSurfaceVisible"
| "setSurfaceDepth"
| "setUnderlayDim"
| "setScreenBlanked"
| "submitSurfaceFrame"
@@ -80,6 +81,10 @@ export class PreviewDisplayTarget implements DisplayTarget {
this.composited();
}
async setSurfaceDepth(id: string, depth: number): Promise<void> {
this.compositor.setSurfaceDepth(id, Math.round(depth));
}
async setUnderlayDim(belowZOrder: number, factor: number): Promise<void> {
this.compositor.setUnderlayDim(Math.round(belowZOrder), Math.max(0, Math.min(1, factor)));
this.composited();
+5
View File
@@ -19,6 +19,7 @@ export type DisplayTarget = Pick<
| "configureSurface"
| "removeSurface"
| "setSurfaceVisible"
| "setSurfaceDepth"
| "setUnderlayDim"
| "setScreenBlanked"
| "submitSurfaceFrame"
@@ -98,6 +99,10 @@ export class PreviewDisplayTarget implements DisplayTarget {
this.compositor.setSurfaceVisible(id, Boolean(visible));
}
async setSurfaceDepth(id: string, depth: number): Promise<void> {
this.compositor.setSurfaceDepth(id, Math.round(depth));
}
async submitShellScene(bytes: Uint8Array, paintMs = 0, frameId = 0): Promise<void> {
this.compositor.submitShellScene(new Uint8Array(bytes).buffer, paintMs, frameId);
}