| 30896 | }]); |
| 30897 | |
| 30898 | function AnimationLoopProxy(worker) { |
| 30899 | var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 30900 | (0, _classCallCheck2.default)(this, AnimationLoopProxy); |
| 30901 | var _opts$onInitialize = opts.onInitialize, |
| 30902 | onInitialize = _opts$onInitialize === void 0 ? function () {} : _opts$onInitialize, |
| 30903 | _opts$onFinalize = opts.onFinalize, |
| 30904 | onFinalize = _opts$onFinalize === void 0 ? function () {} : _opts$onFinalize, |
| 30905 | _opts$useDevicePixels = opts.useDevicePixels, |
| 30906 | useDevicePixels = _opts$useDevicePixels === void 0 ? true : _opts$useDevicePixels, |
| 30907 | _opts$autoResizeDrawi = opts.autoResizeDrawingBuffer, |
| 30908 | autoResizeDrawingBuffer = _opts$autoResizeDrawi === void 0 ? true : _opts$autoResizeDrawi; |
| 30909 | this.props = { |
| 30910 | onInitialize: onInitialize, |
| 30911 | onFinalize: onFinalize |
| 30912 | }; |
| 30913 | this.setProps({ |
| 30914 | autoResizeDrawingBuffer: autoResizeDrawingBuffer, |
| 30915 | useDevicePixels: useDevicePixels |
| 30916 | }); // state |
| 30917 | |
| 30918 | (0, _assert.default)(worker instanceof Worker); |
| 30919 | this.worker = worker; |
| 30920 | this.canvas = null; |
| 30921 | this.width = null; |
| 30922 | this.height = null; |
| 30923 | this._stopped = true; |
| 30924 | this._animationFrameId = null; |
| 30925 | this._startPromise = null; // bind methods |
| 30926 | |
| 30927 | this._onMessage = this._onMessage.bind(this); |
| 30928 | this._onEvent = this._onEvent.bind(this); |
| 30929 | this._updateFrame = this._updateFrame.bind(this); |
| 30930 | } |
| 30931 | |
| 30932 | (0, _createClass2.default)(AnimationLoopProxy, [{ |
| 30933 | key: "setProps", |