- opaque canvas: the compositor stops alpha-blending 2.5Mpx at 60Hz - settled modals and the death summary idle at 20-24 fps; play untouched - TUNE.lowPower caps RES at 3 (-44% pixels/frame), flippable live Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7 lines
514 B
JavaScript
7 lines
514 B
JavaScript
// Canvas handles — imported by everyone, imports nothing (keeps module cycles harmless).
|
|
export const cv = document.getElementById('c');
|
|
// alpha:false — render() clears the whole frame to an opaque colour anyway, so declaring the canvas
|
|
// opaque lets the compositor skip blending a 2.5-megapixel layer 60 times a second (battery, not
|
|
// looks). desynchronized is a further no-op-where-unsupported compositor shortcut (Chrome).
|
|
export const ctx = cv.getContext('2d', { alpha: false, desynchronized: true });
|