forked from Blendman974/faceclaw
Compatibility check; notification icon fixes
* Display a warning if paired glasses do not have a compatible custo firmware * Fix certain notification icons being missing on system card * Rescale large notification icons with proper sampling; don't send unnecessary
This commit is contained in:
1 parent
c9fe92dc1c
commit
3532b1f437
13 files changed
+383
-18
No files matched your search
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Per-render-pass channel for stale-data tracking. JS is single-threaded and
|
||||
* paints are synchronous, so module state set around a paint is visible to
|
||||
* every data source consulted during it, without threading flags through each
|
||||
* paint signature.
|
||||
*
|
||||
* Data sources with a cache (e.g. notification icons) consult
|
||||
* renderPassAllowsStaleData() to decide whether to return expired cached data
|
||||
* immediately instead of blocking the paint on a refetch, and report having
|
||||
* done so via noteStaleDataUsed(). The render loop reads the result from
|
||||
* endRenderPass() and schedules one follow-up repaint with fresh data, so the
|
||||
* first frame out of sleep is never blocked on slow data sources.
|
||||
*/
|
||||
|
||||
let allowStale = true;
|
||||
let staleDataUsed = false;
|
||||
|
||||
export function beginRenderPass(allowStaleData: boolean): void {
|
||||
allowStale = allowStaleData;
|
||||
staleDataUsed = false;
|
||||
}
|
||||
|
||||
export function renderPassAllowsStaleData(): boolean {
|
||||
return allowStale;
|
||||
}
|
||||
|
||||
export function noteStaleDataUsed(): void {
|
||||
staleDataUsed = true;
|
||||
}
|
||||
|
||||
/** End the pass, returning whether any source served stale data. */
|
||||
export function endRenderPass(): boolean {
|
||||
const usedStale = staleDataUsed;
|
||||
allowStale = true;
|
||||
staleDataUsed = false;
|
||||
return usedStale;
|
||||
}
|
||||
Reference in new issue
Block a user