constructor(canvas, rng = new RestartableRng()) {
        /** @type {!HTMLCanvasElement} */
        this.canvas = canvas;
        /** @type {!CanvasRenderingContext2D} */
        this.ctx = canvas.getContext("2d");
        /**
         * @type {!Array.<!function()>}
         * @private
         */
        this._deferredPaintActions = [];
        /**
         * @type {!TraceAction}
         * @private
         */
        this._traceAction = new TraceAction(this.ctx);
        /**
         * @type {!Tracer}
         * @private
         */
        this._tracer = new Tracer(this.ctx);
        /**
         * @type {undefined|!string}
         */
        this.desiredCursorStyle = undefined;
        /**
         * @type {!Array.<!{rect: !Rect, cursor: undefined|!string}>}
         */
        this.touchBlockers = [];
        /**
         * @type {!RestartableRng}
         */
        this.rng = rng;

        this._ignoringTouchBlockers = 0;
    }
@param {!HTMLCanvasElement} canvas
@param {!RestartableRng=} rng