@luma.gl/test-utils 9.0.0-alpha.35 → 9.0.0-alpha.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { luma, log, requestAnimationFrame, cancelAnimationFrame } from '@luma.gl/core';
2
2
  import { isBrowser } from '@probe.gl/env';
3
- import { isWebGL, resetParameters } from '@luma.gl/webgl';
3
+ import { isWebGL, resetGLParameters } from '@luma.gl/webgl';
4
4
  const isPage = isBrowser() && typeof document !== 'undefined';
5
5
  function getHTMLCanvasElement(canvas) {
6
6
  return typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement ? canvas : null;
@@ -350,7 +350,7 @@ export class ClassicAnimationLoop {
350
350
  if (!isWebGL(this.gl)) {
351
351
  throw new Error('ClassicAnimationLoop.onCreateContext - illegal context returned');
352
352
  }
353
- resetParameters(this.gl);
353
+ resetGLParameters(this.gl);
354
354
  this._createInfoDiv();
355
355
  }
356
356
  _createInfoDiv() {
@@ -1 +1 @@
1
- {"version":3,"file":"classic-animation-loop.js","names":["luma","log","requestAnimationFrame","cancelAnimationFrame","isBrowser","isWebGL","resetParameters","isPage","document","getHTMLCanvasElement","canvas","HTMLCanvasElement","statIdCounter","DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS","onCreateDevice","props","createDevice","onCreateContext","undefined","onAddHTML","onInitialize","onRender","onFinalize","onError","error","console","device","useDevicePixels","autoResizeViewport","autoResizeDrawingBuffer","stats","get","gl","glOptions","createFramebuffer","ClassicAnimationLoop","constructor","arguments","length","animationProps","timeline","cpuTime","gpuTime","frameRate","display","needsRedraw","_initialized","_running","_animationFrameId","_pageLoadPromise","_nextFramePromise","_resolveNextFrame","_cpuStartTime","deprecated","useDevicePixelRatio","setProps","start","bind","stop","_onMousemove","_onMouseleave","destroy","_setDisplay","delete","setNeedsRedraw","reason","opts","_start","_getPageLoadPromise","appContext","_createDevice","_initialize","_addCallbackData","_cancelAnimationFrame","_requestAnimationFrame","redraw","isContextLost","_beginTimers","_setupFrame","_updateCallbackData","_renderFrame","_clearNeedsRedraw","_endTimers","_finalizeCallbackData","attachTimeline","detachTimeline","waitForRender","Promise","resolve","toDataURL","_getHTMLCanvasElement","deviceProps","getHTMLControlValue","id","defaultValue","element","getElementById","Number","value","_createFramebuffer","_startEventHandling","_initializeCallbackData","_resizeCanvasDrawingBuffer","_resizeViewport","reject","readyState","window","addEventListener","animationLoop","_animationFrame","_resizeFramebuffer","startTime","Date","now","engineTime","tick","tock","time","_mousePosition","_timeline","_loop","_animationLoop","width","height","aspect","_getSizeAndAspect","update","Math","floor","getTime","Object","assign","Error","_createInfoDiv","wrapperDiv","createElement","body","appendChild","style","position","div","left","bottom","background","html","innerHTML","drawingBufferWidth","drawingBufferHeight","clientHeight","clientWidth","viewport","canvasContext","resize","timeEnd","timeStart","e","offsetX","offsetY"],"sources":["../../src/engine/classic-animation-loop.ts"],"sourcesContent":["// TODO - replace createGLContext, instrumentGLContext, resizeGLContext?\n// TODO - remove dependency on framebuffer (bundle size impact)\nimport {\n luma,\n Device,\n DeviceProps,\n log,\n requestAnimationFrame,\n cancelAnimationFrame\n} from '@luma.gl/core';\nimport {Timeline, AnimationProps} from '@luma.gl/engine';\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {isBrowser} from '@probe.gl/env';\n\nimport {isWebGL, resetParameters} from '@luma.gl/webgl';\n// import {default as Query} from '../classic/query';\n// import {ClassicFramebuffer} from '../classic/framebuffer';\n\ntype ContextProps = DeviceProps;\n\nconst isPage = isBrowser() && typeof document !== 'undefined';\nfunction getHTMLCanvasElement(\n canvas: HTMLCanvasElement | OffscreenCanvas\n): HTMLCanvasElement | null {\n return typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement\n ? canvas\n : null;\n}\n\nlet statIdCounter = 0;\n\n/**\n * Classic Animation Props.\n * Contain a number of deprecated fields\n * @deprecated Use new AnimationLoop in `@luma.gl/engine`\n */\nexport type ClassicAnimationProps = AnimationProps & {\n animationLoop: ClassicAnimationLoop;\n\n /** @deprecated Use .device */\n stop: () => ClassicAnimationLoop;\n\n /** @deprecated Use .device */\n gl: WebGLRenderingContext;\n /** @deprecated Will be removed */\n framebuffer: unknown;\n\n /** @deprecated Use .timeline */\n _timeline: Timeline;\n /** @deprecated Use .animationLoop */\n _loop: ClassicAnimationLoop;\n /** @deprecated Use .animationLoop */\n _animationLoop: ClassicAnimationLoop;\n};\n\n/** ClassicAnimationLoop properties */\nexport type ClassicAnimationLoopProps = {\n onCreateDevice?: (props: DeviceProps) => Promise<Device>;\n onCreateContext?: (props: ContextProps) => WebGLRenderingContext; // TODO: signature from createGLContext\n onAddHTML?: (div: HTMLDivElement) => string; // innerHTML\n onInitialize?: (animationProps: ClassicAnimationProps) => {} | void | Promise<{} | void>;\n onRender?: (animationProps: ClassicAnimationProps) => void;\n onFinalize?: (animationProps: ClassicAnimationProps) => void;\n onError?: (reason: any) => void;\n\n stats?: Stats;\n\n device?: Device;\n glOptions?: ContextProps; // createGLContext options\n // debug?: boolean;\n\n // view parameters\n autoResizeViewport?: boolean;\n autoResizeDrawingBuffer?: boolean;\n useDevicePixels?: number | boolean;\n\n /** @deprecated Use .device */\n gl?: WebGLRenderingContext | null;\n /** @deprecated Will be removed */\n createFramebuffer?: boolean;\n};\n\nconst DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS: Required<ClassicAnimationLoopProps> = {\n onCreateDevice: (props: DeviceProps) => luma.createDevice(props),\n onCreateContext: undefined,\n onAddHTML: undefined,\n onInitialize: () => ({}),\n onRender: () => {},\n onFinalize: () => {},\n onError: (error) => console.error(error), // eslint-disable-line no-console\n\n device: null,\n // debug: true,\n\n // view parameters\n useDevicePixels: true,\n autoResizeViewport: true,\n autoResizeDrawingBuffer: true,\n stats: luma.stats.get(`animation-loop-${statIdCounter++}`),\n\n // deprecated\n // onCreateContext: (opts) => createGLContext(opts),\n gl: undefined,\n glOptions: {},\n createFramebuffer: false\n};\n\n/**\n * Convenient animation loop\n * @deprecated Use `@luma.gl/engine` AnimationLoop\n */\nexport class ClassicAnimationLoop {\n device: Device;\n canvas?: HTMLCanvasElement | OffscreenCanvas;\n\n props: Required<ClassicAnimationLoopProps>;\n animationProps: ClassicAnimationProps;\n // framebuffer: ClassicFramebuffer = null;\n timeline: Timeline = null;\n stats: Stats;\n cpuTime: Stat;\n gpuTime: Stat;\n frameRate: Stat;\n\n display: any;\n\n needsRedraw: string | null = 'initialized';\n\n _initialized: boolean = false;\n _running: boolean = false;\n _animationFrameId: any = null;\n _pageLoadPromise: Promise<{}> | null = null;\n _nextFramePromise: Promise<ClassicAnimationLoop> | null = null;\n _resolveNextFrame: ((loop: ClassicAnimationLoop) => void) | null = null;\n _cpuStartTime: number = 0;\n\n // _gpuTimeQuery: Query | null = null;\n\n /** @deprecated */\n gl: WebGLRenderingContext;\n\n /*\n */\n constructor(props: ClassicAnimationLoopProps = {}) {\n this.props = {...DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS, ...props};\n props = this.props;\n\n let {useDevicePixels = true} = this.props;\n\n if ('useDevicePixelRatio' in props) {\n log.deprecated('useDevicePixelRatio', 'useDevicePixels')();\n // @ts-expect-error\n useDevicePixels = props.useDevicePixelRatio;\n }\n\n // state\n this.device = props.device;\n // @ts-expect-error\n this.gl = (this.device && this.device.gl) || props.gl;\n\n this.stats = props.stats;\n this.cpuTime = this.stats.get('CPU Time');\n this.gpuTime = this.stats.get('GPU Time');\n this.frameRate = this.stats.get('Frame Rate');\n\n this.setProps({\n autoResizeViewport: props.autoResizeViewport,\n autoResizeDrawingBuffer: props.autoResizeDrawingBuffer,\n useDevicePixels\n });\n\n // Bind methods\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n\n this._onMousemove = this._onMousemove.bind(this);\n this._onMouseleave = this._onMouseleave.bind(this);\n }\n\n destroy(): void {\n this.stop();\n this._setDisplay(null);\n }\n\n /** @deprecated Use .destroy() */\n delete(): void {\n this.destroy();\n }\n\n setNeedsRedraw(reason: string): this {\n this.needsRedraw = this.needsRedraw || reason;\n return this;\n }\n\n setProps(props: ClassicAnimationLoopProps): this {\n if ('autoResizeViewport' in props) {\n this.props.autoResizeViewport = props.autoResizeViewport;\n }\n if ('autoResizeDrawingBuffer' in props) {\n this.props.autoResizeDrawingBuffer = props.autoResizeDrawingBuffer;\n }\n if ('useDevicePixels' in props) {\n this.props.useDevicePixels = props.useDevicePixels;\n }\n return this;\n }\n\n start(opts = {}) {\n this._start(opts);\n return this;\n }\n\n /** Starts a render loop if not already running */\n async _start(props) {\n if (this._running) {\n return this;\n }\n this._running = true;\n\n // console.debug(`Starting ${this.constructor.name}`);\n // Wait for start promise before rendering frame\n try {\n await this._getPageLoadPromise();\n\n // check that we haven't been stopped\n if (!this._running) {\n return null;\n }\n\n let appContext;\n if (!this._initialized) {\n this._initialized = true;\n // Create the WebGL context\n await this._createDevice(props);\n this._initialize(props);\n\n // Note: onIntialize can return a promise (in case app needs to load resources)\n // eslint-disable-next-line @typescript-eslint/await-thenable\n appContext = await this.onInitialize(this.animationProps);\n this._addCallbackData(appContext || {});\n }\n\n // check that we haven't been stopped\n if (!this._running) {\n return null;\n }\n\n // Start the loop\n if (appContext !== false) {\n // cancel any pending renders to ensure only one loop can ever run\n this._cancelAnimationFrame();\n this._requestAnimationFrame();\n }\n\n return this;\n } catch (error) {\n this.props.onError(error);\n // this._running = false; // TODO\n return null;\n }\n }\n\n /** Explicitly draw a frame */\n redraw(): this {\n if (this.isContextLost()) {\n return this;\n }\n\n this._beginTimers();\n\n this._setupFrame();\n this._updateCallbackData();\n\n this._renderFrame(this.animationProps);\n\n // clear needsRedraw flag\n this._clearNeedsRedraw();\n\n if (this._resolveNextFrame) {\n this._resolveNextFrame(this);\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n }\n\n this._endTimers();\n\n return this;\n }\n\n // Stops a render loop if already running, finalizing\n stop() {\n // console.debug(`Stopping ${this.constructor.name}`);\n if (this._running) {\n this._finalizeCallbackData();\n this._cancelAnimationFrame();\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n this._running = false;\n }\n return this;\n }\n\n attachTimeline(timeline: Timeline): Timeline {\n this.timeline = timeline;\n return this.timeline;\n }\n\n detachTimeline(): void {\n this.timeline = null;\n }\n\n waitForRender(): Promise<ClassicAnimationLoop> {\n this.setNeedsRedraw('waitForRender');\n\n if (!this._nextFramePromise) {\n this._nextFramePromise = new Promise((resolve) => {\n this._resolveNextFrame = resolve;\n });\n }\n return this._nextFramePromise;\n }\n\n async toDataURL() {\n this.setNeedsRedraw('toDataURL');\n\n await this.waitForRender();\n\n return getHTMLCanvasElement(this.gl.canvas)?.toDataURL();\n }\n\n isContextLost(): boolean {\n return this.gl.isContextLost();\n }\n\n onCreateDevice(deviceProps: DeviceProps): Promise<Device> {\n const {onCreateDevice} = this.props;\n return onCreateDevice(deviceProps);\n }\n\n onInitialize(animationProps: ClassicAnimationProps): {} | void {\n const {onInitialize} = this.props;\n return onInitialize(animationProps);\n }\n\n onRender(animationProps: ClassicAnimationProps) {\n const {onRender} = this.props;\n return onRender(animationProps);\n }\n\n onFinalize(animationProps: ClassicAnimationProps) {\n const {onFinalize} = this.props;\n return onFinalize(animationProps);\n }\n\n // DEPRECATED/REMOVED METHODS\n\n /** @deprecated Use .onCreateDevice() */\n onCreateContext(props: ContextProps) {\n const {onCreateContext} = this.props;\n return onCreateContext(props);\n }\n\n /** @deprecated */\n getHTMLControlValue(id, defaultValue = 1) {\n const element = document.getElementById(id);\n // @ts-expect-error Not all html elements have value\n return element ? Number(element.value) : defaultValue;\n }\n\n // PRIVATE METHODS\n\n _initialize(props: ClassicAnimationLoopProps) {\n this._createFramebuffer();\n this._startEventHandling();\n\n // Initialize the callback data\n this._initializeCallbackData();\n this._updateCallbackData();\n\n // Default viewport setup, in case onInitialize wants to render\n this._resizeCanvasDrawingBuffer();\n this._resizeViewport();\n\n // this._gpuTimeQuery = Query.isSupported(this.gl, ['timers']) ? new Query(this.gl) : null;\n }\n\n _getPageLoadPromise() {\n if (!this._pageLoadPromise) {\n this._pageLoadPromise = isPage\n ? new Promise((resolve, reject) => {\n if (isPage && document.readyState === 'complete') {\n resolve(document);\n return;\n }\n window.addEventListener('load', () => {\n resolve(document);\n });\n })\n : Promise.resolve({});\n }\n return this._pageLoadPromise;\n }\n\n _setDisplay(display: any) {\n if (this.display) {\n this.display.destroy();\n this.display.animationLoop = null;\n }\n\n // store animation loop on the display\n if (display) {\n display.animationLoop = this;\n }\n\n this.display = display;\n }\n\n _requestAnimationFrame() {\n if (!this._running) {\n return;\n }\n\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.requestAnimationFrame) {\n // this._animationFrameId = this.display.requestAnimationFrame(this._animationFrame.bind(this));\n // }\n this._animationFrameId = requestAnimationFrame(this._animationFrame.bind(this));\n }\n\n _cancelAnimationFrame() {\n if (this._animationFrameId !== null) {\n return;\n }\n\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.cancelAnimationFrame) {\n // this.display.cancelAnimationFrame(this._animationFrameId);\n // }\n cancelAnimationFrame(this._animationFrameId);\n this._animationFrameId = null;\n }\n\n _animationFrame() {\n if (!this._running) {\n return;\n }\n this.redraw();\n this._requestAnimationFrame();\n }\n\n // Called on each frame, can be overridden to call onRender multiple times\n // to support e.g. stereoscopic rendering\n _renderFrame(props: ClassicAnimationProps) {\n // Allow e.g. VR display to render multiple frames.\n if (this.display) {\n this.display._renderFrame(props);\n return;\n }\n\n // call callback\n this.onRender(props);\n // end callback\n }\n\n _clearNeedsRedraw() {\n this.needsRedraw = null;\n }\n\n _setupFrame() {\n this._resizeCanvasDrawingBuffer();\n this._resizeViewport();\n this._resizeFramebuffer();\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Initialize the object that will be passed to app callbacks\n _initializeCallbackData() {\n this.animationProps = {\n device: this.device,\n gl: this.gl,\n\n stop: this.stop,\n canvas: this.gl.canvas,\n\n // Initial values\n useDevicePixels: this.props.useDevicePixels,\n needsRedraw: null,\n\n // Animation props\n startTime: Date.now(),\n engineTime: 0,\n tick: 0,\n tock: 0,\n\n timeline: this.timeline,\n // @ts-ignore\n animationLoop: this,\n\n // Timeline time for back compatibility\n time: 0,\n\n // Experimental\n _mousePosition: null, // Event props\n\n /** @deprecated */\n // framebuffer: this.framebuffer,\n /** @deprecated */\n _timeline: this.timeline,\n /** @deprecated */\n _loop: this,\n /** @deprecated */\n _animationLoop: this\n };\n }\n\n // Update the context object that will be passed to app callbacks\n _updateCallbackData() {\n const {width, height, aspect} = this._getSizeAndAspect();\n if (width !== this.animationProps.width || height !== this.animationProps.height) {\n this.setNeedsRedraw('drawing buffer resized');\n }\n if (aspect !== this.animationProps.aspect) {\n this.setNeedsRedraw('drawing buffer aspect changed');\n }\n\n this.animationProps.width = width;\n this.animationProps.height = height;\n this.animationProps.aspect = aspect;\n\n this.animationProps.needsRedraw = this.needsRedraw;\n\n // Update time properties\n this.animationProps.engineTime = Date.now() - this.animationProps.startTime;\n\n if (this.timeline) {\n this.timeline.update(this.animationProps.engineTime);\n }\n\n this.animationProps.tick = Math.floor((this.animationProps.time / 1000) * 60);\n this.animationProps.tock++;\n\n // For back compatibility\n this.animationProps.time = this.timeline\n ? this.timeline.getTime()\n : this.animationProps.engineTime;\n }\n\n _finalizeCallbackData() {\n // call callback\n this.onFinalize(this.animationProps);\n // end callback\n }\n\n /** Add application's data to the app context object */\n _addCallbackData(appContext) {\n if (typeof appContext === 'object' && appContext !== null) {\n this.animationProps = Object.assign({}, this.animationProps, appContext);\n }\n }\n\n /** Either uses supplied or existing context, or calls provided callback to create one */\n async _createDevice(props: DeviceProps) {\n const deviceProps = {...this.props, ...props, ...this.props.glOptions};\n\n // TODO - support this.onCreateContext\n // Create the WebGL context if necessary\n // this.gl = this.props.gl ? instrumentGLContext(this.props.gl, deviceProps) : this.onCreateContext(deviceProps);\n\n this.device = await this.onCreateDevice(deviceProps);\n // @ts-expect-error\n this.gl = this.device.gl;\n\n if (!isWebGL(this.gl)) {\n throw new Error('ClassicAnimationLoop.onCreateContext - illegal context returned');\n }\n\n // Reset the WebGL context.\n resetParameters(this.gl);\n\n this._createInfoDiv();\n }\n\n _createInfoDiv() {\n const canvas = getHTMLCanvasElement(this.gl.canvas)\n if (canvas && this.props.onAddHTML) {\n const wrapperDiv = document.createElement('div');\n document.body.appendChild(wrapperDiv);\n wrapperDiv.style.position = 'relative';\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '10px';\n div.style.bottom = '10px';\n div.style.width = '300px';\n div.style.background = 'white';\n if (canvas) {\n wrapperDiv.appendChild(canvas);\n }\n wrapperDiv.appendChild(div);\n const html = this.props.onAddHTML(div);\n if (html) {\n div.innerHTML = html;\n }\n }\n }\n\n _getSizeAndAspect() {\n // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html\n const width = this.gl.drawingBufferWidth;\n const height = this.gl.drawingBufferHeight;\n\n // https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html\n let aspect = 1;\n\n const canvas = getHTMLCanvasElement(this.gl.canvas);\n if (canvas && canvas.clientHeight) {\n aspect = canvas.clientWidth / canvas.clientHeight;\n } else if (width > 0 && height > 0) {\n aspect = width / height;\n }\n\n return {width, height, aspect};\n }\n\n /** Default viewport setup */\n _resizeViewport() {\n if (this.props.autoResizeViewport) {\n this.gl.viewport(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight);\n }\n }\n\n /**\n * Resize the render buffer of the canvas to match canvas client size\n * Optionally multiplying with devicePixel ratio\n */\n _resizeCanvasDrawingBuffer() {\n if (this.props.autoResizeDrawingBuffer) {\n this.device.canvasContext.resize({useDevicePixels: this.props.useDevicePixels});\n }\n }\n\n _beginTimers() {\n this.frameRate.timeEnd();\n this.frameRate.timeStart();\n\n // Check if timer for last frame has completed.\n // GPU timer results are never available in the same\n // frame they are captured.\n // if (\n // this._gpuTimeQuery &&\n // this._gpuTimeQuery.isResultAvailable() &&\n // !this._gpuTimeQuery.isTimerDisjoint()\n // ) {\n // this.stats.get('GPU Time').addTime(this._gpuTimeQuery.getTimerMilliseconds());\n // }\n\n // if (this._gpuTimeQuery) {\n // // GPU time query start\n // this._gpuTimeQuery.beginTimeElapsedQuery();\n // }\n\n this.cpuTime.timeStart();\n }\n\n _endTimers() {\n this.cpuTime.timeEnd();\n\n // if (this._gpuTimeQuery) {\n // // GPU time query end. Results will be available on next frame.\n // this._gpuTimeQuery.end();\n // }\n }\n\n // Event handling\n\n _startEventHandling() {\n const {canvas} = this.gl;\n if (canvas) {\n canvas.addEventListener('mousemove', this._onMousemove);\n canvas.addEventListener('mouseleave', this._onMouseleave);\n }\n }\n\n _onMousemove(e) {\n this.animationProps._mousePosition = [e.offsetX, e.offsetY];\n }\n _onMouseleave(e) {\n this.animationProps._mousePosition = null;\n }\n\n // Deprecated\n\n /** @deprecated */\n _createFramebuffer() {\n // Setup default framebuffer\n if (this.props.createFramebuffer) {\n // this.framebuffer = new ClassicFramebuffer(this.gl);\n }\n }\n\n /** @deprecated */\n _resizeFramebuffer() {\n // if (this.framebuffer) {\n // this.framebuffer.resize({\n // width: this.gl.drawingBufferWidth,\n // height: this.gl.drawingBufferHeight\n // });\n // }\n }\n}\n"],"mappings":"AAEA,SACEA,IAAI,EAGJC,GAAG,EACHC,qBAAqB,EACrBC,oBAAoB,QACf,eAAe;AAGtB,SAAQC,SAAS,QAAO,eAAe;AAEvC,SAAQC,OAAO,EAAEC,eAAe,QAAO,gBAAgB;AAMvD,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC,IAAI,OAAOI,QAAQ,KAAK,WAAW;AAC7D,SAASC,oBAAoBA,CAC3BC,MA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AKAnB,kBAAkBA,CAAA,EAAG;IAEnB,IAAI,IAAI,CAACpF,KAAK,CAACmB,iBAAiB,EAAE,CAElC;EACF;EAGA4E,kBAAkBA,CAAA,EAAG,CAOrB;AACF"}
1
+ {"version":3,"file":"classic-animation-loop.js","names":["luma","log","requestAnimationFrame","cancelAnimationFrame","isBrowser","isWebGL","resetGLParameters","isPage","document","getHTMLCanvasElement","canvas","HTMLCanvasElement","statIdCounter","DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS","onCreateDevice","props","createDevice","onCreateContext","undefined","onAddHTML","onInitialize","onRender","onFinalize","onError","error","console","device","useDevicePixels","autoResizeViewport","autoResizeDrawingBuffer","stats","get","gl","glOptions","createFramebuffer","ClassicAnimationLoop","constructor","arguments","length","animationProps","timeline","cpuTime","gpuTime","frameRate","display","needsRedraw","_initialized","_running","_animationFrameId","_pageLoadPromise","_nextFramePromise","_resolveNextFrame","_cpuStartTime","deprecated","useDevicePixelRatio","setProps","start","bind","stop","_onMousemove","_onMouseleave","destroy","_setDisplay","delete","setNeedsRedraw","reason","opts","_start","_getPageLoadPromise","appContext","_createDevice","_initialize","_addCallbackData","_cancelAnimationFrame","_requestAnimationFrame","redraw","isContextLost","_beginTimers","_setupFrame","_updateCallbackData","_renderFrame","_clearNeedsRedraw","_endTimers","_finalizeCallbackData","attachTimeline","detachTimeline","waitForRender","Promise","resolve","toDataURL","_getHTMLCanvasElement","deviceProps","getHTMLControlValue","id","defaultValue","element","getElementById","Number","value","_createFramebuffer","_startEventHandling","_initializeCallbackData","_resizeCanvasDrawingBuffer","_resizeViewport","reject","readyState","window","addEventListener","animationLoop","_animationFrame","_resizeFramebuffer","startTime","Date","now","engineTime","tick","tock","time","_mousePosition","_timeline","_loop","_animationLoop","width","height","aspect","_getSizeAndAspect","update","Math","floor","getTime","Object","assign","Error","_createInfoDiv","wrapperDiv","createElement","body","appendChild","style","position","div","left","bottom","background","html","innerHTML","drawingBufferWidth","drawingBufferHeight","clientHeight","clientWidth","viewport","canvasContext","resize","timeEnd","timeStart","e","offsetX","offsetY"],"sources":["../../src/engine/classic-animation-loop.ts"],"sourcesContent":["// TODO - replace createGLContext, instrumentGLContext, resizeGLContext?\n// TODO - remove dependency on framebuffer (bundle size impact)\nimport {\n luma,\n Device,\n DeviceProps,\n log,\n requestAnimationFrame,\n cancelAnimationFrame\n} from '@luma.gl/core';\nimport {Timeline, AnimationProps} from '@luma.gl/engine';\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {isBrowser} from '@probe.gl/env';\n\nimport {isWebGL, resetGLParameters} from '@luma.gl/webgl';\n// import {default as Query} from '../classic/query';\n// import {ClassicFramebuffer} from '../classic/framebuffer';\n\ntype ContextProps = DeviceProps;\n\nconst isPage = isBrowser() && typeof document !== 'undefined';\nfunction getHTMLCanvasElement(\n canvas: HTMLCanvasElement | OffscreenCanvas\n): HTMLCanvasElement | null {\n return typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement\n ? canvas\n : null;\n}\n\nlet statIdCounter = 0;\n\n/**\n * Classic Animation Props.\n * Contain a number of deprecated fields\n * @deprecated Use new AnimationLoop in `@luma.gl/engine`\n */\nexport type ClassicAnimationProps = AnimationProps & {\n animationLoop: ClassicAnimationLoop;\n\n /** @deprecated Use .device */\n stop: () => ClassicAnimationLoop;\n\n /** @deprecated Use .device */\n gl: WebGLRenderingContext;\n /** @deprecated Will be removed */\n framebuffer: unknown;\n\n /** @deprecated Use .timeline */\n _timeline: Timeline;\n /** @deprecated Use .animationLoop */\n _loop: ClassicAnimationLoop;\n /** @deprecated Use .animationLoop */\n _animationLoop: ClassicAnimationLoop;\n};\n\n/** ClassicAnimationLoop properties */\nexport type ClassicAnimationLoopProps = {\n onCreateDevice?: (props: DeviceProps) => Promise<Device>;\n onCreateContext?: (props: ContextProps) => WebGLRenderingContext; // TODO: signature from createGLContext\n onAddHTML?: (div: HTMLDivElement) => string; // innerHTML\n onInitialize?: (animationProps: ClassicAnimationProps) => {} | void | Promise<{} | void>;\n onRender?: (animationProps: ClassicAnimationProps) => void;\n onFinalize?: (animationProps: ClassicAnimationProps) => void;\n onError?: (reason: any) => void;\n\n stats?: Stats;\n\n device?: Device;\n glOptions?: ContextProps; // createGLContext options\n // debug?: boolean;\n\n // view parameters\n autoResizeViewport?: boolean;\n autoResizeDrawingBuffer?: boolean;\n useDevicePixels?: number | boolean;\n\n /** @deprecated Use .device */\n gl?: WebGLRenderingContext | null;\n /** @deprecated Will be removed */\n createFramebuffer?: boolean;\n};\n\nconst DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS: Required<ClassicAnimationLoopProps> = {\n onCreateDevice: (props: DeviceProps) => luma.createDevice(props),\n onCreateContext: undefined,\n onAddHTML: undefined,\n onInitialize: () => ({}),\n onRender: () => {},\n onFinalize: () => {},\n onError: (error) => console.error(error), // eslint-disable-line no-console\n\n device: null,\n // debug: true,\n\n // view parameters\n useDevicePixels: true,\n autoResizeViewport: true,\n autoResizeDrawingBuffer: true,\n stats: luma.stats.get(`animation-loop-${statIdCounter++}`),\n\n // deprecated\n // onCreateContext: (opts) => createGLContext(opts),\n gl: undefined,\n glOptions: {},\n createFramebuffer: false\n};\n\n/**\n * Convenient animation loop\n * @deprecated Use `@luma.gl/engine` AnimationLoop\n */\nexport class ClassicAnimationLoop {\n device: Device;\n canvas?: HTMLCanvasElement | OffscreenCanvas;\n\n props: Required<ClassicAnimationLoopProps>;\n animationProps: ClassicAnimationProps;\n // framebuffer: ClassicFramebuffer = null;\n timeline: Timeline = null;\n stats: Stats;\n cpuTime: Stat;\n gpuTime: Stat;\n frameRate: Stat;\n\n display: any;\n\n needsRedraw: string | null = 'initialized';\n\n _initialized: boolean = false;\n _running: boolean = false;\n _animationFrameId: any = null;\n _pageLoadPromise: Promise<{}> | null = null;\n _nextFramePromise: Promise<ClassicAnimationLoop> | null = null;\n _resolveNextFrame: ((loop: ClassicAnimationLoop) => void) | null = null;\n _cpuStartTime: number = 0;\n\n // _gpuTimeQuery: Query | null = null;\n\n /** @deprecated */\n gl: WebGLRenderingContext;\n\n /*\n */\n constructor(props: ClassicAnimationLoopProps = {}) {\n this.props = {...DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS, ...props};\n props = this.props;\n\n let {useDevicePixels = true} = this.props;\n\n if ('useDevicePixelRatio' in props) {\n log.deprecated('useDevicePixelRatio', 'useDevicePixels')();\n // @ts-expect-error\n useDevicePixels = props.useDevicePixelRatio;\n }\n\n // state\n this.device = props.device;\n // @ts-expect-error\n this.gl = (this.device && this.device.gl) || props.gl;\n\n this.stats = props.stats;\n this.cpuTime = this.stats.get('CPU Time');\n this.gpuTime = this.stats.get('GPU Time');\n this.frameRate = this.stats.get('Frame Rate');\n\n this.setProps({\n autoResizeViewport: props.autoResizeViewport,\n autoResizeDrawingBuffer: props.autoResizeDrawingBuffer,\n useDevicePixels\n });\n\n // Bind methods\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n\n this._onMousemove = this._onMousemove.bind(this);\n this._onMouseleave = this._onMouseleave.bind(this);\n }\n\n destroy(): void {\n this.stop();\n this._setDisplay(null);\n }\n\n /** @deprecated Use .destroy() */\n delete(): void {\n this.destroy();\n }\n\n setNeedsRedraw(reason: string): this {\n this.needsRedraw = this.needsRedraw || reason;\n return this;\n }\n\n setProps(props: ClassicAnimationLoopProps): this {\n if ('autoResizeViewport' in props) {\n this.props.autoResizeViewport = props.autoResizeViewport;\n }\n if ('autoResizeDrawingBuffer' in props) {\n this.props.autoResizeDrawingBuffer = props.autoResizeDrawingBuffer;\n }\n if ('useDevicePixels' in props) {\n this.props.useDevicePixels = props.useDevicePixels;\n }\n return this;\n }\n\n start(opts = {}) {\n this._start(opts);\n return this;\n }\n\n /** Starts a render loop if not already running */\n async _start(props) {\n if (this._running) {\n return this;\n }\n this._running = true;\n\n // console.debug(`Starting ${this.constructor.name}`);\n // Wait for start promise before rendering frame\n try {\n await this._getPageLoadPromise();\n\n // check that we haven't been stopped\n if (!this._running) {\n return null;\n }\n\n let appContext;\n if (!this._initialized) {\n this._initialized = true;\n // Create the WebGL context\n await this._createDevice(props);\n this._initialize(props);\n\n // Note: onIntialize can return a promise (in case app needs to load resources)\n // eslint-disable-next-line @typescript-eslint/await-thenable\n appContext = await this.onInitialize(this.animationProps);\n this._addCallbackData(appContext || {});\n }\n\n // check that we haven't been stopped\n if (!this._running) {\n return null;\n }\n\n // Start the loop\n if (appContext !== false) {\n // cancel any pending renders to ensure only one loop can ever run\n this._cancelAnimationFrame();\n this._requestAnimationFrame();\n }\n\n return this;\n } catch (error) {\n this.props.onError(error);\n // this._running = false; // TODO\n return null;\n }\n }\n\n /** Explicitly draw a frame */\n redraw(): this {\n if (this.isContextLost()) {\n return this;\n }\n\n this._beginTimers();\n\n this._setupFrame();\n this._updateCallbackData();\n\n this._renderFrame(this.animationProps);\n\n // clear needsRedraw flag\n this._clearNeedsRedraw();\n\n if (this._resolveNextFrame) {\n this._resolveNextFrame(this);\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n }\n\n this._endTimers();\n\n return this;\n }\n\n // Stops a render loop if already running, finalizing\n stop() {\n // console.debug(`Stopping ${this.constructor.name}`);\n if (this._running) {\n this._finalizeCallbackData();\n this._cancelAnimationFrame();\n this._nextFramePromise = null;\n this._resolveNextFrame = null;\n this._running = false;\n }\n return this;\n }\n\n attachTimeline(timeline: Timeline): Timeline {\n this.timeline = timeline;\n return this.timeline;\n }\n\n detachTimeline(): void {\n this.timeline = null;\n }\n\n waitForRender(): Promise<ClassicAnimationLoop> {\n this.setNeedsRedraw('waitForRender');\n\n if (!this._nextFramePromise) {\n this._nextFramePromise = new Promise((resolve) => {\n this._resolveNextFrame = resolve;\n });\n }\n return this._nextFramePromise;\n }\n\n async toDataURL() {\n this.setNeedsRedraw('toDataURL');\n\n await this.waitForRender();\n\n return getHTMLCanvasElement(this.gl.canvas)?.toDataURL();\n }\n\n isContextLost(): boolean {\n return this.gl.isContextLost();\n }\n\n onCreateDevice(deviceProps: DeviceProps): Promise<Device> {\n const {onCreateDevice} = this.props;\n return onCreateDevice(deviceProps);\n }\n\n onInitialize(animationProps: ClassicAnimationProps): {} | void {\n const {onInitialize} = this.props;\n return onInitialize(animationProps);\n }\n\n onRender(animationProps: ClassicAnimationProps) {\n const {onRender} = this.props;\n return onRender(animationProps);\n }\n\n onFinalize(animationProps: ClassicAnimationProps) {\n const {onFinalize} = this.props;\n return onFinalize(animationProps);\n }\n\n // DEPRECATED/REMOVED METHODS\n\n /** @deprecated Use .onCreateDevice() */\n onCreateContext(props: ContextProps) {\n const {onCreateContext} = this.props;\n return onCreateContext(props);\n }\n\n /** @deprecated */\n getHTMLControlValue(id, defaultValue = 1) {\n const element = document.getElementById(id);\n // @ts-expect-error Not all html elements have value\n return element ? Number(element.value) : defaultValue;\n }\n\n // PRIVATE METHODS\n\n _initialize(props: ClassicAnimationLoopProps) {\n this._createFramebuffer();\n this._startEventHandling();\n\n // Initialize the callback data\n this._initializeCallbackData();\n this._updateCallbackData();\n\n // Default viewport setup, in case onInitialize wants to render\n this._resizeCanvasDrawingBuffer();\n this._resizeViewport();\n\n // this._gpuTimeQuery = Query.isSupported(this.gl, ['timers']) ? new Query(this.gl) : null;\n }\n\n _getPageLoadPromise() {\n if (!this._pageLoadPromise) {\n this._pageLoadPromise = isPage\n ? new Promise((resolve, reject) => {\n if (isPage && document.readyState === 'complete') {\n resolve(document);\n return;\n }\n window.addEventListener('load', () => {\n resolve(document);\n });\n })\n : Promise.resolve({});\n }\n return this._pageLoadPromise;\n }\n\n _setDisplay(display: any) {\n if (this.display) {\n this.display.destroy();\n this.display.animationLoop = null;\n }\n\n // store animation loop on the display\n if (display) {\n display.animationLoop = this;\n }\n\n this.display = display;\n }\n\n _requestAnimationFrame() {\n if (!this._running) {\n return;\n }\n\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.requestAnimationFrame) {\n // this._animationFrameId = this.display.requestAnimationFrame(this._animationFrame.bind(this));\n // }\n this._animationFrameId = requestAnimationFrame(this._animationFrame.bind(this));\n }\n\n _cancelAnimationFrame() {\n if (this._animationFrameId !== null) {\n return;\n }\n\n // VR display has a separate animation frame to sync with headset\n // TODO WebVR API discontinued, replaced by WebXR: https://immersive-web.github.io/webxr/\n // See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame\n // if (this.display && this.display.cancelAnimationFrame) {\n // this.display.cancelAnimationFrame(this._animationFrameId);\n // }\n cancelAnimationFrame(this._animationFrameId);\n this._animationFrameId = null;\n }\n\n _animationFrame() {\n if (!this._running) {\n return;\n }\n this.redraw();\n this._requestAnimationFrame();\n }\n\n // Called on each frame, can be overridden to call onRender multiple times\n // to support e.g. stereoscopic rendering\n _renderFrame(props: ClassicAnimationProps) {\n // Allow e.g. VR display to render multiple frames.\n if (this.display) {\n this.display._renderFrame(props);\n return;\n }\n\n // call callback\n this.onRender(props);\n // end callback\n }\n\n _clearNeedsRedraw() {\n this.needsRedraw = null;\n }\n\n _setupFrame() {\n this._resizeCanvasDrawingBuffer();\n this._resizeViewport();\n this._resizeFramebuffer();\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Initialize the object that will be passed to app callbacks\n _initializeCallbackData() {\n this.animationProps = {\n device: this.device,\n gl: this.gl,\n\n stop: this.stop,\n canvas: this.gl.canvas,\n\n // Initial values\n useDevicePixels: this.props.useDevicePixels,\n needsRedraw: null,\n\n // Animation props\n startTime: Date.now(),\n engineTime: 0,\n tick: 0,\n tock: 0,\n\n timeline: this.timeline,\n // @ts-ignore\n animationLoop: this,\n\n // Timeline time for back compatibility\n time: 0,\n\n // Experimental\n _mousePosition: null, // Event props\n\n /** @deprecated */\n // framebuffer: this.framebuffer,\n /** @deprecated */\n _timeline: this.timeline,\n /** @deprecated */\n _loop: this,\n /** @deprecated */\n _animationLoop: this\n };\n }\n\n // Update the context object that will be passed to app callbacks\n _updateCallbackData() {\n const {width, height, aspect} = this._getSizeAndAspect();\n if (width !== this.animationProps.width || height !== this.animationProps.height) {\n this.setNeedsRedraw('drawing buffer resized');\n }\n if (aspect !== this.animationProps.aspect) {\n this.setNeedsRedraw('drawing buffer aspect changed');\n }\n\n this.animationProps.width = width;\n this.animationProps.height = height;\n this.animationProps.aspect = aspect;\n\n this.animationProps.needsRedraw = this.needsRedraw;\n\n // Update time properties\n this.animationProps.engineTime = Date.now() - this.animationProps.startTime;\n\n if (this.timeline) {\n this.timeline.update(this.animationProps.engineTime);\n }\n\n this.animationProps.tick = Math.floor((this.animationProps.time / 1000) * 60);\n this.animationProps.tock++;\n\n // For back compatibility\n this.animationProps.time = this.timeline\n ? this.timeline.getTime()\n : this.animationProps.engineTime;\n }\n\n _finalizeCallbackData() {\n // call callback\n this.onFinalize(this.animationProps);\n // end callback\n }\n\n /** Add application's data to the app context object */\n _addCallbackData(appContext) {\n if (typeof appContext === 'object' && appContext !== null) {\n this.animationProps = Object.assign({}, this.animationProps, appContext);\n }\n }\n\n /** Either uses supplied or existing context, or calls provided callback to create one */\n async _createDevice(props: DeviceProps) {\n const deviceProps = {...this.props, ...props, ...this.props.glOptions};\n\n // TODO - support this.onCreateContext\n // Create the WebGL context if necessary\n // this.gl = this.props.gl ? instrumentGLContext(this.props.gl, deviceProps) : this.onCreateContext(deviceProps);\n\n this.device = await this.onCreateDevice(deviceProps);\n // @ts-expect-error\n this.gl = this.device.gl;\n\n if (!isWebGL(this.gl)) {\n throw new Error('ClassicAnimationLoop.onCreateContext - illegal context returned');\n }\n\n // Reset the WebGL context.\n resetGLParameters(this.gl);\n\n this._createInfoDiv();\n }\n\n _createInfoDiv() {\n const canvas = getHTMLCanvasElement(this.gl.canvas)\n if (canvas && this.props.onAddHTML) {\n const wrapperDiv = document.createElement('div');\n document.body.appendChild(wrapperDiv);\n wrapperDiv.style.position = 'relative';\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.style.left = '10px';\n div.style.bottom = '10px';\n div.style.width = '300px';\n div.style.background = 'white';\n if (canvas) {\n wrapperDiv.appendChild(canvas);\n }\n wrapperDiv.appendChild(div);\n const html = this.props.onAddHTML(div);\n if (html) {\n div.innerHTML = html;\n }\n }\n }\n\n _getSizeAndAspect() {\n // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html\n const width = this.gl.drawingBufferWidth;\n const height = this.gl.drawingBufferHeight;\n\n // https://webglfundamentals.org/webgl/lessons/webgl-anti-patterns.html\n let aspect = 1;\n\n const canvas = getHTMLCanvasElement(this.gl.canvas);\n if (canvas && canvas.clientHeight) {\n aspect = canvas.clientWidth / canvas.clientHeight;\n } else if (width > 0 && height > 0) {\n aspect = width / height;\n }\n\n return {width, height, aspect};\n }\n\n /** Default viewport setup */\n _resizeViewport() {\n if (this.props.autoResizeViewport) {\n this.gl.viewport(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight);\n }\n }\n\n /**\n * Resize the render buffer of the canvas to match canvas client size\n * Optionally multiplying with devicePixel ratio\n */\n _resizeCanvasDrawingBuffer() {\n if (this.props.autoResizeDrawingBuffer) {\n this.device.canvasContext.resize({useDevicePixels: this.props.useDevicePixels});\n }\n }\n\n _beginTimers() {\n this.frameRate.timeEnd();\n this.frameRate.timeStart();\n\n // Check if timer for last frame has completed.\n // GPU timer results are never available in the same\n // frame they are captured.\n // if (\n // this._gpuTimeQuery &&\n // this._gpuTimeQuery.isResultAvailable() &&\n // !this._gpuTimeQuery.isTimerDisjoint()\n // ) {\n // this.stats.get('GPU Time').addTime(this._gpuTimeQuery.getTimerMilliseconds());\n // }\n\n // if (this._gpuTimeQuery) {\n // // GPU time query start\n // this._gpuTimeQuery.beginTimeElapsedQuery();\n // }\n\n this.cpuTime.timeStart();\n }\n\n _endTimers() {\n this.cpuTime.timeEnd();\n\n // if (this._gpuTimeQuery) {\n // // GPU time query end. Results will be available on next frame.\n // this._gpuTimeQuery.end();\n // }\n }\n\n // Event handling\n\n _startEventHandling() {\n const {canvas} = this.gl;\n if (canvas) {\n canvas.addEventListener('mousemove', this._onMousemove);\n canvas.addEventListener('mouseleave', this._onMouseleave);\n }\n }\n\n _onMousemove(e) {\n this.animationProps._mousePosition = [e.offsetX, e.offsetY];\n }\n _onMouseleave(e) {\n this.animationProps._mousePosition = null;\n }\n\n // Deprecated\n\n /** @deprecated */\n _createFramebuffer() {\n // Setup default framebuffer\n if (this.props.createFramebuffer) {\n // this.framebuffer = new ClassicFramebuffer(this.gl);\n }\n }\n\n /** @deprecated */\n _resizeFramebuffer() {\n // if (this.framebuffer) {\n // this.framebuffer.resize({\n // width: this.gl.drawingBufferWidth,\n // height: this.gl.drawingBufferHeight\n // });\n // }\n }\n}\n"],"mappings":"AAEA,SACEA,IAAI,EAGJC,GAAG,EACHC,qBAAqB,EACrBC,oBAAoB,QACf,eAAe;AAGtB,SAAQC,SAAS,QAAO,eAAe;AAEvC,SAAQC,OAAO,EAAEC,iBAAiB,QAAO,gBAAgB;AAMzD,MAAMC,MAAM,GAAGH,SAAS,CAAC,CAAC,IAAI,OAAOI,QAAQ,KAAK,WAAW;AAC7D,SAASC,oBAAoBA,CAC3BC,MAA2C,EACjB;EAC1B,OAAO,OAAOC,iBAAiB,KAAK,WAAW,IAAID,MAAM,YAAYC,iBAAiB,GAClFD,MAAM,GACN,IAAI;AACV;AAEA,IAAIE,aAAa,GAAG,CAAC;AAqDrB,MAAMC,oCAAyE,GAAG;EAChFC,cAAc,EAAGC,KAAkB,IAAKf,IAAI,CAACgB,YAAY,CAACD,KAAK,CAAC;EAChEE,eAAe,EAAEC,SAAS;EAC1BC,SAAS,EAAED,SAAS;EACpBE,YAAY,EAAEA,CAAA,MAAO,CAAC,CAAC,CAAC;EACxBC,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBC,UAAU,EAAEA,CAAA,KAAM,CAAC,CAAC;EACpBC,OAAO,EAAGC,KAAK,IAAKC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;EAExC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AC8G,OAAO,CAAC,CAAC;IACxB,IAAI,CAAC9G,SAAS,CAAC+G,SAAS,CAAC,CAAC;IAkB1B,IAAI,CAACjH,OAAO,CAACiH,SAAS,CAAC,CAAC;EAC1B;EAEAxE,UAAUA,CAAA,EAAG;IACX,IAAI,CAACzC,OAAO,CAACgH,OAAO,CAAC,CAAC;EAMxB;EAIArD,mBAAmBA,CAAA,EAAG;IACpB,MAAM;MAAC1F;IAAM,CAAC,GAAG,IAAI,CAACsB,EAAE;IACxB,IAAItB,MAAM,EAAE;MACVA,MAAM,CAACiG,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAChD,YAAY,CAAC;MACvDjD,MAAM,CAACiG,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC/C,aAAa,CAAC;IAC3D;EACF;EAEAD,YAAYA,CAACgG,CAAC,EAAE;IACd,IAAI,CAACpH,cAAc,CAAC+E,cAAc,GAAG,CAACqC,CAAC,CAACC,OAAO,EAAED,CAAC,CAACE,OAAO,CAAC;EAC7D;EACAjG,aAAaA,CAAC+F,CAAC,EAAE;IACf,IAAI,CAACpH,cAAc,CAAC+E,cAAc,GAAG,IAAI;EAC3C;EAKAnB,kBAAkBA,CAAA,EAAG;IAEnB,IAAI,IAAI,CAACpF,KAAK,CAACmB,iBAAiB,EAAE,CAElC;EACF;EAGA4E,kBAAkBA,CAAA,EAAG,CAOrB;AACF"}
package/dist/index.cjs CHANGED
@@ -498,7 +498,7 @@ var ClassicAnimationLoop = class {
498
498
  if (!(0, import_webgl3.isWebGL)(this.gl)) {
499
499
  throw new Error("ClassicAnimationLoop.onCreateContext - illegal context returned");
500
500
  }
501
- (0, import_webgl3.resetParameters)(this.gl);
501
+ (0, import_webgl3.resetGLParameters)(this.gl);
502
502
  this._createInfoDiv();
503
503
  });
504
504
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/test-utils",
3
- "version": "9.0.0-alpha.35",
3
+ "version": "9.0.0-alpha.36",
4
4
  "description": "Automated WebGL testing utilities with Puppeteer and image diffing",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -39,18 +39,18 @@
39
39
  "pre-build": "echo test utils has no bundle"
40
40
  },
41
41
  "dependencies": {
42
- "@luma.gl/core": "9.0.0-alpha.35",
43
- "@luma.gl/engine": "9.0.0-alpha.35",
44
- "@luma.gl/webgl": "9.0.0-alpha.35",
45
- "@luma.gl/webgpu": "9.0.0-alpha.35",
42
+ "@luma.gl/core": "9.0.0-alpha.36",
43
+ "@luma.gl/engine": "9.0.0-alpha.36",
44
+ "@luma.gl/webgl": "9.0.0-alpha.36",
45
+ "@luma.gl/webgpu": "9.0.0-alpha.36",
46
46
  "@probe.gl/env": "^4.0.2",
47
47
  "@types/gl": "^6.0.2",
48
48
  "gl": "^6.0.1"
49
49
  },
50
50
  "peerDependencies": {
51
- "@luma.gl/core": "9.0.0-alpha.29",
52
- "@luma.gl/webgl": "9.0.0-alpha.29",
53
- "@luma.gl/webgpu": "9.0.0-alpha.29",
51
+ "@luma.gl/core": "9.0.0-alpha.35",
52
+ "@luma.gl/webgl": "9.0.0-alpha.35",
53
+ "@luma.gl/webgpu": "9.0.0-alpha.35",
54
54
  "@probe.gl/test-utils": "^4.0.2"
55
55
  },
56
56
  "engines_comment": [
@@ -59,5 +59,5 @@
59
59
  "engines": {
60
60
  "node": ">=16.18.0"
61
61
  },
62
- "gitHead": "5b93557731aaf1b9fd0fc1d84b5a3c7c0717298a"
62
+ "gitHead": "05d6f82f0006047f9a6a562a1da1011d3b6b15e3"
63
63
  }
@@ -12,7 +12,7 @@ import {Timeline, AnimationProps} from '@luma.gl/engine';
12
12
  import {Stats, Stat} from '@probe.gl/stats';
13
13
  import {isBrowser} from '@probe.gl/env';
14
14
 
15
- import {isWebGL, resetParameters} from '@luma.gl/webgl';
15
+ import {isWebGL, resetGLParameters} from '@luma.gl/webgl';
16
16
  // import {default as Query} from '../classic/query';
17
17
  // import {ClassicFramebuffer} from '../classic/framebuffer';
18
18
 
@@ -580,7 +580,7 @@ export class ClassicAnimationLoop {
580
580
  }
581
581
 
582
582
  // Reset the WebGL context.
583
- resetParameters(this.gl);
583
+ resetGLParameters(this.gl);
584
584
 
585
585
  this._createInfoDiv();
586
586
  }