paint(x, y, painter, key=undefined) {
        if (!this._cachedCanvases.has(key)) {
            let canvas = /** @type {!HTMLCanvasElement} */ document.createElement('canvas');
            let {width, height} = this.sizeFunc(key);
            canvas.width = width;
            canvas.height = height;
            this._drawingFunc(new Painter(canvas, fixedRng.restarted()), key);
            this._cachedCanvases.set(key, canvas);
        }
        painter.ctx.drawImage(this._cachedCanvases.get(key), x, y);
    }
@param {!int} x
@param {!int} y
@param {!Painter} painter
@param {!*=} key