@luma.gl/test-utils 9.1.0-beta.5 → 9.1.0-beta.7

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.
package/dist/index.cjs CHANGED
@@ -37,22 +37,16 @@ __export(dist_exports, {
37
37
  });
38
38
  module.exports = __toCommonJS(dist_exports);
39
39
 
40
- // dist/register-devices.js
41
- var import_core = require("@luma.gl/core");
40
+ // dist/create-test-device.js
41
+ var import_core17 = require("@luma.gl/core");
42
42
  var import_webgl = require("@luma.gl/webgl");
43
43
  var import_webgpu = require("@luma.gl/webgpu");
44
- import_core.luma.registerAdapters([import_webgl.webgl2Adapter, import_webgpu.webgpuAdapter]);
45
-
46
- // dist/create-test-device.js
47
- var import_core18 = require("@luma.gl/core");
48
- var import_webgl2 = require("@luma.gl/webgl");
49
- var import_webgpu2 = require("@luma.gl/webgpu");
50
44
 
51
45
  // dist/null-device/null-adapter.js
52
- var import_core17 = require("@luma.gl/core");
46
+ var import_core16 = require("@luma.gl/core");
53
47
 
54
48
  // dist/null-device/null-device.js
55
- var import_core16 = require("@luma.gl/core");
49
+ var import_core15 = require("@luma.gl/core");
56
50
 
57
51
  // dist/null-device/null-device-info.js
58
52
  var NullDeviceInfo = {
@@ -68,8 +62,8 @@ var NullDeviceInfo = {
68
62
  };
69
63
 
70
64
  // dist/null-device/null-device-features.js
71
- var import_core2 = require("@luma.gl/core");
72
- var NullDeviceLimits = class extends import_core2.DeviceLimits {
65
+ var import_core = require("@luma.gl/core");
66
+ var NullDeviceLimits = class extends import_core.DeviceLimits {
73
67
  maxTextureDimension1D = 0;
74
68
  maxTextureDimension2D = 2048;
75
69
  maxTextureDimension3D = 256;
@@ -99,11 +93,11 @@ var NullDeviceLimits = class extends import_core2.DeviceLimits {
99
93
  };
100
94
 
101
95
  // dist/null-device/null-canvas-context.js
102
- var import_core4 = require("@luma.gl/core");
96
+ var import_core3 = require("@luma.gl/core");
103
97
 
104
98
  // dist/null-device/resources/null-framebuffer.js
105
- var import_core3 = require("@luma.gl/core");
106
- var NullFramebuffer = class extends import_core3.Framebuffer {
99
+ var import_core2 = require("@luma.gl/core");
100
+ var NullFramebuffer = class extends import_core2.Framebuffer {
107
101
  device;
108
102
  colorAttachments = [];
109
103
  depthStencilAttachment = null;
@@ -116,7 +110,7 @@ var NullFramebuffer = class extends import_core3.Framebuffer {
116
110
  };
117
111
 
118
112
  // dist/null-device/null-canvas-context.js
119
- var NullCanvasContext = class extends import_core4.CanvasContext {
113
+ var NullCanvasContext = class extends import_core3.CanvasContext {
120
114
  device;
121
115
  handle = null;
122
116
  presentationSize;
@@ -145,8 +139,8 @@ var NullCanvasContext = class extends import_core4.CanvasContext {
145
139
  };
146
140
 
147
141
  // dist/null-device/resources/null-buffer.js
148
- var import_core5 = require("@luma.gl/core");
149
- var NullBuffer = class extends import_core5.Buffer {
142
+ var import_core4 = require("@luma.gl/core");
143
+ var NullBuffer = class extends import_core4.Buffer {
150
144
  device;
151
145
  byteLength;
152
146
  constructor(device, props = {}) {
@@ -172,8 +166,8 @@ var NullBuffer = class extends import_core5.Buffer {
172
166
  };
173
167
 
174
168
  // dist/null-device/resources/null-shader.js
175
- var import_core6 = require("@luma.gl/core");
176
- var NullShader = class extends import_core6.Shader {
169
+ var import_core5 = require("@luma.gl/core");
170
+ var NullShader = class extends import_core5.Shader {
177
171
  device;
178
172
  constructor(device, props) {
179
173
  super(device, props);
@@ -188,8 +182,8 @@ var NullShader = class extends import_core6.Shader {
188
182
  };
189
183
 
190
184
  // dist/null-device/resources/null-command-buffer.js
191
- var import_core7 = require("@luma.gl/core");
192
- var NullCommandEncoder = class extends import_core7.CommandEncoder {
185
+ var import_core6 = require("@luma.gl/core");
186
+ var NullCommandEncoder = class extends import_core6.CommandEncoder {
193
187
  device;
194
188
  constructor(device, props) {
195
189
  super(device, props);
@@ -216,8 +210,8 @@ var NullCommandEncoder = class extends import_core7.CommandEncoder {
216
210
  };
217
211
 
218
212
  // dist/null-device/resources/null-sampler.js
219
- var import_core8 = require("@luma.gl/core");
220
- var NullSampler = class extends import_core8.Sampler {
213
+ var import_core7 = require("@luma.gl/core");
214
+ var NullSampler = class extends import_core7.Sampler {
221
215
  device;
222
216
  constructor(device, props) {
223
217
  super(device, props);
@@ -226,22 +220,22 @@ var NullSampler = class extends import_core8.Sampler {
226
220
  };
227
221
 
228
222
  // dist/null-device/resources/null-texture.js
229
- var import_core10 = require("@luma.gl/core");
223
+ var import_core9 = require("@luma.gl/core");
230
224
 
231
225
  // dist/null-device/resources/null-texture-view.js
232
- var import_core9 = require("@luma.gl/core");
233
- var NullTextureView = class extends import_core9.TextureView {
226
+ var import_core8 = require("@luma.gl/core");
227
+ var NullTextureView = class extends import_core8.TextureView {
234
228
  device;
235
229
  texture;
236
230
  constructor(device, props) {
237
- super(device, { ...import_core9.Texture.defaultProps, ...props });
231
+ super(device, { ...import_core8.Texture.defaultProps, ...props });
238
232
  this.device = device;
239
233
  this.texture = props.texture;
240
234
  }
241
235
  };
242
236
 
243
237
  // dist/null-device/resources/null-texture.js
244
- var NullTexture = class extends import_core10.Texture {
238
+ var NullTexture = class extends import_core9.Texture {
245
239
  device;
246
240
  sampler;
247
241
  view;
@@ -312,8 +306,8 @@ var NullTexture = class extends import_core10.Texture {
312
306
  };
313
307
 
314
308
  // dist/null-device/resources/null-render-pass.js
315
- var import_core11 = require("@luma.gl/core");
316
- var NullRenderPass = class extends import_core11.RenderPass {
309
+ var import_core10 = require("@luma.gl/core");
310
+ var NullRenderPass = class extends import_core10.RenderPass {
317
311
  device;
318
312
  constructor(device, props) {
319
313
  super(device, props);
@@ -336,8 +330,8 @@ var NullRenderPass = class extends import_core11.RenderPass {
336
330
  };
337
331
 
338
332
  // dist/null-device/resources/null-render-pipeline.js
339
- var import_core12 = require("@luma.gl/core");
340
- var NullRenderPipeline = class extends import_core12.RenderPipeline {
333
+ var import_core11 = require("@luma.gl/core");
334
+ var NullRenderPipeline = class extends import_core11.RenderPipeline {
341
335
  device;
342
336
  vs;
343
337
  fs;
@@ -369,8 +363,8 @@ var NullRenderPipeline = class extends import_core12.RenderPipeline {
369
363
  };
370
364
 
371
365
  // dist/null-device/resources/null-vertex-array.js
372
- var import_core13 = require("@luma.gl/core");
373
- var NullVertexArray = class extends import_core13.VertexArray {
366
+ var import_core12 = require("@luma.gl/core");
367
+ var NullVertexArray = class extends import_core12.VertexArray {
374
368
  device;
375
369
  // Create a VertexArray
376
370
  constructor(device, props) {
@@ -397,8 +391,8 @@ var NullVertexArray = class extends import_core13.VertexArray {
397
391
  };
398
392
 
399
393
  // dist/null-device/resources/null-transform-feedback.js
400
- var import_core14 = require("@luma.gl/core");
401
- var NullTransformFeedback = class extends import_core14.TransformFeedback {
394
+ var import_core13 = require("@luma.gl/core");
395
+ var NullTransformFeedback = class extends import_core13.TransformFeedback {
402
396
  device;
403
397
  layout;
404
398
  buffers = {};
@@ -430,8 +424,8 @@ var NullTransformFeedback = class extends import_core14.TransformFeedback {
430
424
  };
431
425
 
432
426
  // dist/null-device/resources/null-query-set.js
433
- var import_core15 = require("@luma.gl/core");
434
- var NullQuerySet = class extends import_core15.QuerySet {
427
+ var import_core14 = require("@luma.gl/core");
428
+ var NullQuerySet = class extends import_core14.QuerySet {
435
429
  device;
436
430
  constructor(device, props) {
437
431
  super(device, props);
@@ -440,7 +434,7 @@ var NullQuerySet = class extends import_core15.QuerySet {
440
434
  };
441
435
 
442
436
  // dist/null-device/null-device.js
443
- var NullDevice = class extends import_core16.Device {
437
+ var NullDevice = class extends import_core15.Device {
444
438
  static isSupported() {
445
439
  return true;
446
440
  }
@@ -448,7 +442,7 @@ var NullDevice = class extends import_core16.Device {
448
442
  handle = null;
449
443
  preferredColorFormat = "rgba8unorm";
450
444
  preferredDepthFormat = "depth24plus";
451
- features = new import_core16.DeviceFeatures([], this.props._disabledFeatures);
445
+ features = new import_core15.DeviceFeatures([], this.props._disabledFeatures);
452
446
  limits = new NullDeviceLimits();
453
447
  info = NullDeviceInfo;
454
448
  canvasContext;
@@ -543,7 +537,7 @@ var NullDevice = class extends import_core16.Device {
543
537
  };
544
538
 
545
539
  // dist/null-device/null-adapter.js
546
- var NullAdapter = class extends import_core17.Adapter {
540
+ var NullAdapter = class extends import_core16.Adapter {
547
541
  /** type of device's created by this adapter */
548
542
  type = "unknown";
549
543
  constructor() {
@@ -595,16 +589,16 @@ async function getNullTestDevice() {
595
589
  async function makeWebGPUTestDevice() {
596
590
  const webgpuDeviceResolvers = withResolvers();
597
591
  try {
598
- const webgpuDevice = await import_core18.luma.createDevice({
592
+ const webgpuDevice = await import_core17.luma.createDevice({
599
593
  id: "webgpu-test-device",
600
594
  type: "webgpu",
601
- adapters: [import_webgpu2.webgpuAdapter],
595
+ adapters: [import_webgpu.webgpuAdapter],
602
596
  createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,
603
597
  debug: true
604
598
  });
605
599
  webgpuDeviceResolvers.resolve(webgpuDevice);
606
600
  } catch (error) {
607
- import_core18.log.error(String(error))();
601
+ import_core17.log.error(String(error))();
608
602
  webgpuDeviceResolvers.resolve(null);
609
603
  }
610
604
  return webgpuDeviceResolvers.promise;
@@ -612,17 +606,17 @@ async function makeWebGPUTestDevice() {
612
606
  async function makeWebGLTestDevice() {
613
607
  const webglDeviceResolvers = withResolvers();
614
608
  try {
615
- const webglDevice3 = await import_core18.luma.createDevice({
609
+ const webglDevice3 = await import_core17.luma.createDevice({
616
610
  id: "webgl-test-device",
617
611
  type: "webgl",
618
- adapters: [import_webgl2.webgl2Adapter],
612
+ adapters: [import_webgl.webgl2Adapter],
619
613
  createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,
620
614
  debug: true,
621
615
  debugWebGL: true
622
616
  });
623
617
  webglDeviceResolvers.resolve(webglDevice3);
624
618
  } catch (error) {
625
- import_core18.log.error(String(error))();
619
+ import_core17.log.error(String(error))();
626
620
  webglDeviceResolvers.resolve(null);
627
621
  }
628
622
  return webglDeviceResolvers.promise;
@@ -630,7 +624,7 @@ async function makeWebGLTestDevice() {
630
624
  async function makeNullTestDevice() {
631
625
  const nullDeviceResolvers = withResolvers();
632
626
  try {
633
- const nullDevice = await import_core18.luma.createDevice({
627
+ const nullDevice = await import_core17.luma.createDevice({
634
628
  id: "null-test-device",
635
629
  type: "unknown",
636
630
  adapters: [nullAdapter],
@@ -640,24 +634,24 @@ async function makeNullTestDevice() {
640
634
  });
641
635
  nullDeviceResolvers.resolve(nullDevice);
642
636
  } catch (error) {
643
- import_core18.log.error(String(error))();
637
+ import_core17.log.error(String(error))();
644
638
  nullDevicePromise = Promise.resolve(null);
645
639
  }
646
640
  return nullDeviceResolvers.promise;
647
641
  }
648
642
 
649
643
  // dist/deprecated/classic-animation-loop.js
650
- var import_core19 = require("@luma.gl/core");
644
+ var import_core18 = require("@luma.gl/core");
651
645
  var import_engine = require("@luma.gl/engine");
652
646
  var import_env = require("@probe.gl/env");
653
- var import_webgl3 = require("@luma.gl/webgl");
647
+ var import_webgl2 = require("@luma.gl/webgl");
654
648
  var isPage = (0, import_env.isBrowser)() && typeof document !== "undefined";
655
649
  function getHTMLCanvasElement(canvas) {
656
650
  return typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement ? canvas : null;
657
651
  }
658
652
  var statIdCounter = 0;
659
653
  var DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS = {
660
- onCreateDevice: (props) => import_core19.luma.createDevice({ ...props, debug: true }),
654
+ onCreateDevice: (props) => import_core18.luma.createDevice({ ...props, debug: true }),
661
655
  onCreateContext: void 0,
662
656
  onAddHTML: void 0,
663
657
  onInitialize: () => ({}),
@@ -673,7 +667,7 @@ var DEFAULT_CLASSIC_ANIMATION_LOOP_PROPS = {
673
667
  useDevicePixels: true,
674
668
  autoResizeViewport: true,
675
669
  autoResizeDrawingBuffer: true,
676
- stats: import_core19.luma.stats.get(`animation-loop-${statIdCounter++}`),
670
+ stats: import_core18.luma.stats.get(`animation-loop-${statIdCounter++}`),
677
671
  // deprecated
678
672
  // onCreateContext: (opts) => createGLContext(opts),
679
673
  gl: void 0,
@@ -710,7 +704,7 @@ var ClassicAnimationLoop = class {
710
704
  props = this.props;
711
705
  let { useDevicePixels = true } = this.props;
712
706
  if ("useDevicePixelRatio" in props) {
713
- import_core19.log.deprecated("useDevicePixelRatio", "useDevicePixels")();
707
+ import_core18.log.deprecated("useDevicePixelRatio", "useDevicePixels")();
714
708
  useDevicePixels = props.useDevicePixelRatio;
715
709
  }
716
710
  this.device = props.device;
@@ -1009,7 +1003,7 @@ var ClassicAnimationLoop = class {
1009
1003
  const deviceProps = { ...this.props, ...props, ...this.props.glOptions };
1010
1004
  this.device = await this.onCreateDevice(deviceProps);
1011
1005
  this.gl = this.device.gl;
1012
- (0, import_webgl3.resetGLParameters)(this.gl);
1006
+ (0, import_webgl2.resetGLParameters)(this.gl);
1013
1007
  this._createInfoDiv();
1014
1008
  }
1015
1009
  _createInfoDiv() {
@@ -1410,14 +1404,14 @@ function getLeakedResources(startCounts, endCounts) {
1410
1404
  }
1411
1405
 
1412
1406
  // dist/deprecated/sync-test-device.js
1413
- var import_webgl4 = require("@luma.gl/webgl");
1407
+ var import_webgl3 = require("@luma.gl/webgl");
1414
1408
  var DEFAULT_CANVAS_CONTEXT_PROPS2 = {
1415
1409
  width: 1,
1416
1410
  height: 1
1417
1411
  };
1418
1412
  function createTestDevice() {
1419
1413
  try {
1420
- return new import_webgl4.WebGLDevice({ createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS2 });
1414
+ return new import_webgl3.WebGLDevice({ createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS2 });
1421
1415
  } catch (error) {
1422
1416
  console.error(`Failed to created device: ${error.message}`);
1423
1417
  debugger;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts", "../src/register-devices.ts", "../src/create-test-device.ts", "../src/null-device/null-adapter.ts", "../src/null-device/null-device.ts", "../src/null-device/null-device-info.ts", "../src/null-device/null-device-features.ts", "../src/null-device/null-canvas-context.ts", "../src/null-device/resources/null-framebuffer.ts", "../src/null-device/resources/null-buffer.ts", "../src/null-device/resources/null-shader.ts", "../src/null-device/resources/null-command-buffer.ts", "../src/null-device/resources/null-sampler.ts", "../src/null-device/resources/null-texture.ts", "../src/null-device/resources/null-texture-view.ts", "../src/null-device/resources/null-render-pass.ts", "../src/null-device/resources/null-render-pipeline.ts", "../src/null-device/resources/null-vertex-array.ts", "../src/null-device/resources/null-transform-feedback.ts", "../src/null-device/resources/null-query-set.ts", "../src/deprecated/classic-animation-loop.ts", "../src/test-runner.ts", "../src/utils/get-bounding-box.ts", "../src/snapshot-test-runner.ts", "../src/performance-test-runner.ts", "../src/utils/check-type.ts", "../src/utils/deep-copy.ts", "../src/utils/resource-tracker.ts", "../src/deprecated/sync-test-device.ts"],
4
- "sourcesContent": ["import './register-devices';\n\n// TEST RUNNERS\nexport type {TestRunnerTestCase} from './test-runner';\nexport type {SnapshotTestRunnerTestCase} from './snapshot-test-runner';\n\nexport {SnapshotTestRunner} from './snapshot-test-runner';\nexport {PerformanceTestRunner} from './performance-test-runner';\n\n// TEST DEVICES\nexport {\n getTestDevices,\n getWebGLTestDevice,\n getWebGPUTestDevice,\n getNullTestDevice\n} from './create-test-device';\n\n// Null device\nexport {nullAdapter, NullAdapter} from './null-device/null-adapter';\nexport {NullDevice} from './null-device/null-device';\n\n// UTILS\nexport {checkType} from './utils/check-type';\nexport {deepCopy} from './utils/deep-copy';\nexport {getResourceCounts, getLeakedResources} from './utils/resource-tracker';\n\n// DEPRECATED\nexport {createTestDevice, webglDevice} from './deprecated/sync-test-device';\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {luma} from '@luma.gl/core';\nimport {webgl2Adapter} from '@luma.gl/webgl';\nimport {webgpuAdapter} from '@luma.gl/webgpu';\n\nluma.registerAdapters([webgl2Adapter, webgpuAdapter]);\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device, CanvasContextProps} from '@luma.gl/core';\nimport {luma, log} from '@luma.gl/core';\nimport {webgl2Adapter, WebGLDevice} from '@luma.gl/webgl';\nimport {webgpuAdapter, WebGPUDevice} from '@luma.gl/webgpu';\nimport {nullAdapter} from './null-device/null-adapter';\nimport {NullDevice} from './null-device/null-device';\n\nconst DEFAULT_CANVAS_CONTEXT_PROPS: CanvasContextProps = {\n width: 1,\n height: 1\n};\n\n// TODO - replace with Promise.withResolvers once we upgrade TS baseline\nconst withResolvers = <T>(): {\n promise: Promise<T>;\n resolve: (t: T) => void;\n reject: (error: Error) => void;\n} => {\n let resolve;\n let reject;\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n return {promise, resolve, reject};\n};\n\n/** A null device intended for testing - @note Only available after getTestDevices() has completed */\nlet nullDevicePromise = makeNullTestDevice();\n/** This WebGL Device can be used directly but will not have WebGL debugging initialized */\nconst webglDevicePromise = makeWebGLTestDevice();\n/** A WebGL 2 Device intended for testing - @note Only available after getTestDevices() has completed */\nconst webgpuDevicePromise = makeWebGPUTestDevice();\n\n/** Includes WebGPU device if available */\nexport async function getTestDevices(\n types: ('webgl' | 'webgpu' | 'unknown')[] = ['webgl', 'webgpu']\n): Promise<Device[]> {\n return [await getNullTestDevice(), await getWebGLTestDevice(), await getWebGPUTestDevice()]\n .filter(Boolean)\n .filter(device => types.includes(device.type));\n}\n\n/** returns WebGPU device promise, if available */\nexport function getWebGPUTestDevice(): Promise<WebGPUDevice | null> {\n return webgpuDevicePromise;\n}\n\n/** returns WebGL device promise, if available */\nexport async function getWebGLTestDevice(): Promise<WebGLDevice> {\n return webglDevicePromise;\n}\n\n/** returns null device promise, if available */\nexport async function getNullTestDevice(): Promise<NullDevice> {\n return nullDevicePromise;\n}\n\nasync function makeWebGPUTestDevice(): Promise<WebGPUDevice | null> {\n const webgpuDeviceResolvers = withResolvers<WebGPUDevice | null>();\n try {\n const webgpuDevice = (await luma.createDevice({\n id: 'webgpu-test-device',\n type: 'webgpu',\n adapters: [webgpuAdapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true\n })) as WebGPUDevice;\n webgpuDeviceResolvers.resolve(webgpuDevice);\n } catch (error) {\n log.error(String(error))();\n webgpuDeviceResolvers.resolve(null);\n }\n return webgpuDeviceResolvers.promise;\n}\n\n/** returns WebGL device promise, if available */\nasync function makeWebGLTestDevice(): Promise<WebGLDevice> {\n const webglDeviceResolvers = withResolvers<WebGLDevice>();\n try {\n const webglDevice = (await luma.createDevice({\n id: 'webgl-test-device',\n type: 'webgl',\n adapters: [webgl2Adapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true,\n debugWebGL: true\n })) as WebGLDevice;\n webglDeviceResolvers.resolve(webglDevice);\n } catch (error) {\n log.error(String(error))();\n webglDeviceResolvers.resolve(null);\n }\n return webglDeviceResolvers.promise;\n}\n\n/** returns null device promise, if available */\nasync function makeNullTestDevice(): Promise<NullDevice> {\n const nullDeviceResolvers = withResolvers<NullDevice>();\n try {\n const nullDevice = (await luma.createDevice({\n id: 'null-test-device',\n type: 'unknown',\n adapters: [nullAdapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true,\n debugWebGL: true\n })) as NullDevice;\n nullDeviceResolvers.resolve(nullDevice);\n } catch (error) {\n log.error(String(error))();\n nullDevicePromise = Promise.resolve(null);\n }\n return nullDeviceResolvers.promise;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Adapter, DeviceProps} from '@luma.gl/core';\nimport {NullDevice} from './null-device';\n\nexport class NullAdapter extends Adapter {\n /** type of device's created by this adapter */\n readonly type: NullDevice['type'] = 'unknown';\n\n constructor() {\n super();\n // @ts-ignore DEPRECATED For backwards compatibility luma.registerDevices\n NullDevice.adapter = this;\n }\n\n /** Check if WebGPU is available */\n isSupported(): boolean {\n return true;\n }\n\n async attach(handle: null): Promise<NullDevice> {\n return new NullDevice({});\n }\n\n async create(props: DeviceProps = {}): Promise<NullDevice> {\n return new NullDevice(props);\n }\n}\n\nexport const nullAdapter = new NullAdapter();\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n DeviceProps,\n CanvasContextProps,\n VertexArray,\n VertexArrayProps,\n BufferProps,\n ShaderProps,\n SamplerProps,\n TextureProps,\n ExternalTexture,\n ExternalTextureProps,\n FramebufferProps,\n RenderPipelineProps,\n ComputePipeline,\n ComputePipelineProps,\n RenderPassProps,\n ComputePass,\n ComputePassProps,\n CommandEncoderProps,\n TransformFeedbackProps,\n QuerySetProps\n} from '@luma.gl/core';\nimport {Device, DeviceFeatures} from '@luma.gl/core';\n\nimport {NullDeviceInfo} from './null-device-info';\nimport {NullDeviceLimits} from './null-device-features';\nimport {NullCanvasContext} from './null-canvas-context';\nimport {NullBuffer} from './resources/null-buffer';\nimport {NullFramebuffer} from './resources/null-framebuffer';\nimport {NullShader} from './resources/null-shader';\nimport {NullCommandEncoder} from './resources/null-command-buffer';\nimport {NullSampler} from './resources/null-sampler';\nimport {NullTexture} from './resources/null-texture';\nimport {NullRenderPass} from './resources/null-render-pass';\nimport {NullRenderPipeline} from './resources/null-render-pipeline';\nimport {NullVertexArray} from './resources/null-vertex-array';\nimport {NullTransformFeedback} from './resources/null-transform-feedback';\nimport {NullQuerySet} from './resources/null-query-set';\n\n/** Do-nothing device implementation for testing */\nexport class NullDevice extends Device {\n static isSupported(): boolean {\n return true;\n }\n readonly type = 'unknown';\n readonly handle = null;\n\n readonly preferredColorFormat = 'rgba8unorm';\n readonly preferredDepthFormat = 'depth24plus';\n\n features: DeviceFeatures = new DeviceFeatures([], this.props._disabledFeatures);\n limits: NullDeviceLimits = new NullDeviceLimits();\n readonly info = NullDeviceInfo;\n\n readonly canvasContext: NullCanvasContext;\n readonly lost: Promise<{reason: 'destroyed'; message: string}>;\n\n constructor(props: DeviceProps) {\n super({...props, id: props.id || 'null-device'});\n\n const canvasContextProps = props.createCanvasContext === true ? {} : props.createCanvasContext;\n this.canvasContext = new NullCanvasContext(this, canvasContextProps);\n this.lost = new Promise(resolve => {});\n }\n\n /**\n * Destroys the context\n * @note Has no effect for null contexts\n */\n destroy(): void {}\n\n get isLost(): boolean {\n return false;\n }\n\n // IMPLEMENTATION OF ABSTRACT DEVICE\n\n createCanvasContext(props: CanvasContextProps): NullCanvasContext {\n return new NullCanvasContext(this, props);\n }\n\n createBuffer(props: BufferProps | ArrayBuffer | ArrayBufferView): NullBuffer {\n const newProps = this._normalizeBufferProps(props);\n return new NullBuffer(this, newProps);\n }\n\n getDefaultRenderPass(): NullRenderPass {\n return new NullRenderPass(this, {});\n }\n\n createTexture(props: TextureProps): NullTexture {\n return new NullTexture(this, props);\n }\n\n createExternalTexture(props: ExternalTextureProps): ExternalTexture {\n throw new Error('createExternalTexture() not implemented'); // return new Program(props);\n }\n\n createSampler(props: SamplerProps): NullSampler {\n return new NullSampler(this, props);\n }\n\n createShader(props: ShaderProps): NullShader {\n return new NullShader(this, props);\n }\n\n createFramebuffer(props: FramebufferProps): NullFramebuffer {\n return new NullFramebuffer(this, props);\n }\n\n createVertexArray(props: VertexArrayProps): VertexArray {\n return new NullVertexArray(this, props);\n }\n\n createTransformFeedback(props: TransformFeedbackProps): NullTransformFeedback {\n return new NullTransformFeedback(this, props);\n }\n\n createQuerySet(props: QuerySetProps): NullQuerySet {\n return new NullQuerySet(this, props);\n }\n\n createRenderPipeline(props: RenderPipelineProps): NullRenderPipeline {\n return new NullRenderPipeline(this, props);\n }\n\n beginRenderPass(props: RenderPassProps): NullRenderPass {\n return new NullRenderPass(this, props);\n }\n\n createComputePipeline(props?: ComputePipelineProps): ComputePipeline {\n throw new Error('ComputePipeline not supported in WebGL');\n }\n\n beginComputePass(props: ComputePassProps): ComputePass {\n throw new Error('ComputePass not supported in WebGL');\n }\n\n override createCommandEncoder(props: CommandEncoderProps = {}): NullCommandEncoder {\n return new NullCommandEncoder(this, props);\n }\n\n submit(): void {}\n\n override setParametersWebGL(parameters: any): void {}\n\n override getParametersWebGL(parameters: any): any {}\n\n override withParametersWebGL(parameters: any, func: any): any {\n const {nocatch = true} = parameters;\n let value: any;\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n return func();\n }\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func();\n } catch {\n // ignore\n }\n return value;\n }\n\n override _getDeviceSpecificTextureFormatCapabilities(format: any): any {\n return format;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {DeviceInfo} from '@luma.gl/core';\n\nexport const NullDeviceInfo = {\n type: 'unknown',\n gpu: 'software',\n gpuType: 'unknown',\n gpuBackend: 'unknown',\n vendor: 'no one',\n renderer: 'none',\n version: '1.0',\n shadingLanguage: 'glsl',\n shadingLanguageVersion: 300\n} as const satisfies DeviceInfo;\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {DeviceLimits} from '@luma.gl/core';\n\nexport class NullDeviceLimits extends DeviceLimits {\n maxTextureDimension1D = 0;\n maxTextureDimension2D = 2048;\n maxTextureDimension3D = 256;\n maxTextureArrayLayers = 256;\n maxBindGroups = 0;\n maxDynamicUniformBuffersPerPipelineLayout = 0;\n maxDynamicStorageBuffersPerPipelineLayout = 0;\n maxSampledTexturesPerShaderStage = 8;\n maxSamplersPerShaderStage = 16;\n maxStorageBuffersPerShaderStage = 0;\n maxStorageTexturesPerShaderStage = 0;\n maxUniformBuffersPerShaderStage = 20;\n maxUniformBufferBindingSize = 16384;\n maxStorageBufferBindingSize = 0;\n minUniformBufferOffsetAlignment = 0;\n minStorageBufferOffsetAlignment = 0;\n maxVertexBuffers = 16;\n maxVertexAttributes = 16;\n maxVertexBufferArrayStride = 2048;\n maxInterStageShaderComponents = 60;\n maxComputeWorkgroupStorageSize = 0;\n maxComputeInvocationsPerWorkgroup = 0;\n maxComputeWorkgroupSizeX = 0;\n maxComputeWorkgroupSizeY = 0;\n maxComputeWorkgroupSizeZ = 0;\n maxComputeWorkgroupsPerDimension = 0;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {CanvasContextProps} from '@luma.gl/core';\nimport {CanvasContext} from '@luma.gl/core';\nimport type {NullDevice} from './null-device';\nimport {NullFramebuffer} from './resources/null-framebuffer';\n\n/**\n * A WebGL Canvas Context which manages the canvas and handles drawing buffer resizing etc\n */\nexport class NullCanvasContext extends CanvasContext {\n readonly device: NullDevice;\n readonly handle = null;\n\n presentationSize: [number, number];\n private _framebuffer: NullFramebuffer | null = null;\n\n get [Symbol.toStringTag]() {\n return 'NullCanvasContext';\n }\n\n constructor(device: NullDevice, props: CanvasContextProps) {\n // Note: Base class creates / looks up the canvas (unless under Node.js)\n super(props);\n this.device = device;\n\n // Base class constructor cannot access derived methods/fields, so we need to call these functions in the subclass constructor\n this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);\n this.updateSize([this.drawingBufferWidth, this.drawingBufferHeight]);\n }\n\n getCurrentFramebuffer(): NullFramebuffer {\n // Setting handle to null returns a reference to the default framebuffer\n this._framebuffer = this._framebuffer || new NullFramebuffer(this.device, {handle: null});\n return this._framebuffer;\n }\n\n /** Resizes and updates render targets if necessary */\n updateSize(size: [number, number]) {}\n\n resize(options?: {width?: number; height?: number; useDevicePixels?: boolean | number}): void {\n throw new Error('not implemented');\n }\n\n commit() {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {FramebufferProps} from '@luma.gl/core';\nimport {Framebuffer} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\nimport type {NullTextureView} from './null-texture-view';\n\nexport class NullFramebuffer extends Framebuffer {\n device: NullDevice;\n\n colorAttachments: NullTextureView[] = [];\n depthStencilAttachment: NullTextureView | null = null;\n\n constructor(device: NullDevice, props: FramebufferProps) {\n super(device, props);\n this.device = device;\n }\n\n protected override updateAttachments(): void {\n // Null framebuffers are JS only objects, nothing to\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {BufferProps} from '@luma.gl/core';\nimport {Buffer} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullBuffer extends Buffer {\n device: NullDevice;\n\n byteLength: number;\n\n constructor(device: NullDevice, props: BufferProps = {}) {\n super(device, props);\n this.device = device;\n\n const byteOffset = props.byteOffset || 0;\n const byteLength = props.byteLength ?? (props.data ? props.data.byteLength + byteOffset : 0);\n\n // assert(byteLength >= 0);\n\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n }\n\n override destroy(): void {\n if (!this.destroyed) {\n super.destroy();\n this.trackDeallocatedMemory();\n }\n }\n\n async readAsync(byteOffset = 0, byteLength?: number): Promise<Uint8Array> {\n byteLength = byteLength ?? this.byteLength - byteOffset;\n return new Uint8Array(byteLength);\n }\n\n write(data: ArrayBufferView, byteOffset: number = 0): void {\n // assert(data.byteLength + byteOffset <= this.byteLength);\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Shader, ShaderProps, CompilerMessage} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullShader extends Shader {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: ShaderProps) {\n super(device, props);\n this.device = device;\n }\n\n get asyncCompilationStatus(): Promise<any> {\n return this.getCompilationInfo().then(() => 'success');\n }\n\n async getCompilationInfo(): Promise<readonly CompilerMessage[]> {\n return [];\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CommandEncoder, CommandEncoderProps} from '@luma.gl/core';\nimport type {\n CopyBufferToBufferOptions,\n CopyBufferToTextureOptions,\n CopyTextureToBufferOptions,\n CopyTextureToTextureOptions,\n QuerySet\n} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullCommandEncoder extends CommandEncoder {\n device: NullDevice;\n\n constructor(device: NullDevice, props: CommandEncoderProps) {\n super(device, props);\n this.device = device;\n }\n\n finish(): void {}\n\n copyBufferToBuffer(options: CopyBufferToBufferOptions): void {}\n\n copyBufferToTexture(options: CopyBufferToTextureOptions) {}\n\n copyTextureToBuffer(options: CopyTextureToBufferOptions): void {}\n\n copyTextureToTexture(options: CopyTextureToTextureOptions): void {}\n\n pushDebugGroup(groupLabel: string): void {}\n popDebugGroup() {}\n\n insertDebugMarker(markerLabel: string): void {}\n resolveQuerySet(querySet: QuerySet): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Sampler, SamplerProps} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullSampler extends Sampler {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: SamplerProps) {\n super(device, props);\n this.device = device;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n TextureProps,\n Sampler,\n SamplerProps,\n TextureViewProps,\n CopyExternalImageOptions,\n Texture1DData,\n Texture2DData,\n Texture3DData,\n TextureCubeData,\n TextureArrayData,\n TextureCubeArrayData\n} from '@luma.gl/core';\n\nimport {Texture} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\nimport {NullSampler} from './null-sampler';\nimport {NullTextureView} from './null-texture-view';\n\nexport class NullTexture extends Texture {\n readonly device: NullDevice;\n\n sampler: NullSampler;\n view: NullTextureView;\n\n constructor(device: NullDevice, props: TextureProps) {\n super(device, props);\n\n // Texture base class strips out the data prop, so we need to add it back in\n const propsWithData = {...this.props};\n propsWithData.data = props.data;\n\n this.device = device;\n\n this.initialize(propsWithData);\n\n Object.seal(this);\n }\n\n override destroy(): void {\n if (!this.destroyed) {\n super.destroy();\n this.trackDeallocatedMemory('Texture');\n }\n }\n\n createView(props: TextureViewProps): NullTextureView {\n return new NullTextureView(this.device, {...props, texture: this});\n }\n\n setTexture1DData(data: Texture1DData): void {\n throw new Error('not implemented');\n }\n\n setTexture2DData(lodData: Texture2DData, depth?: number, target?: number): void {\n throw new Error('not implemented');\n }\n\n setTexture3DData(lodData: Texture3DData, depth?: number, target?: number): void {\n throw new Error('not implemented');\n }\n\n setTextureCubeData(data: TextureCubeData, depth?: number): void {\n throw new Error('not implemented');\n }\n\n setTextureArrayData(data: TextureArrayData): void {\n throw new Error('not implemented');\n }\n\n setTextureCubeArrayData(data: TextureCubeArrayData): void {\n throw new Error('not implemented');\n }\n\n initialize(props: TextureProps = {}): this {\n // const data = props.data;\n // this.setImageData(props);\n\n this.setSampler(props.sampler);\n\n this.view = new NullTextureView(this.device, {\n ...props,\n texture: this,\n mipLevelCount: 1,\n arrayLayerCount: 1\n });\n\n return this;\n }\n\n setSampler(sampler: Sampler | SamplerProps = {}): this {\n if (sampler instanceof NullSampler) {\n this.sampler = sampler;\n } else {\n this.sampler = new NullSampler(this.device, sampler);\n }\n\n return this;\n }\n\n copyExternalImage(options: CopyExternalImageOptions): {width: number; height: number} {\n this.trackDeallocatedMemory('Texture');\n\n const {image: data} = options;\n\n // if (data && data.byteLength) {\n // this.trackAllocatedMemory(data.byteLength, 'Texture');\n // } else {\n const bytesPerPixel = 4;\n this.trackAllocatedMemory(this.width * this.height * bytesPerPixel, 'Texture');\n // }\n\n const width = options.width ?? (data as ImageBitmap).width;\n const height = options.height ?? (data as ImageBitmap).height;\n\n this.width = width;\n this.height = height;\n\n return {width, height};\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TextureViewProps} from '@luma.gl/core';\nimport {TextureView, Texture} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\nimport type {NullTexture} from './null-texture';\n\nexport class NullTextureView extends TextureView {\n readonly device: NullDevice;\n readonly texture: NullTexture;\n\n constructor(device: NullDevice, props: TextureViewProps & {texture: NullTexture}) {\n super(device, {...Texture.defaultProps, ...props});\n\n this.device = device;\n this.texture = props.texture;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {RenderPass, RenderPassProps, RenderPassParameters} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullRenderPass extends RenderPass {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: RenderPassProps) {\n super(device, props);\n this.device = device;\n }\n\n end(): void {}\n\n pushDebugGroup(groupLabel: string): void {}\n popDebugGroup(): void {}\n insertDebugMarker(markerLabel: string): void {}\n\n setParameters(parameters: RenderPassParameters = {}): void {}\n\n beginOcclusionQuery(queryIndex: number): void {}\n endOcclusionQuery(): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n UniformValue,\n RenderPipelineProps,\n Binding,\n RenderPass,\n VertexArray\n} from '@luma.gl/core';\nimport {RenderPipeline} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\nimport {NullShader} from './null-shader';\n\n/** Creates a new render pipeline */\nexport class NullRenderPipeline extends RenderPipeline {\n device: NullDevice;\n vs: NullShader;\n fs: NullShader;\n\n uniforms: Record<string, UniformValue> = {};\n bindings: Record<string, Binding> = {};\n\n constructor(device: NullDevice, props: RenderPipelineProps) {\n super(device, props);\n this.device = device;\n\n this.vs = props.vs as NullShader;\n this.fs = props.fs as NullShader;\n\n this.shaderLayout = props.shaderLayout || {\n attributes: [],\n bindings: [],\n uniforms: []\n };\n }\n\n setBindings(bindings: Record<string, Binding>): void {\n Object.assign(this.bindings, bindings);\n }\n\n override setUniformsWebGL(uniforms: Record<string, UniformValue>): void {\n Object.assign(this.uniforms, uniforms);\n }\n\n draw(options: {\n renderPass: RenderPass;\n vertexArray: VertexArray;\n vertexCount?: number;\n instanceCount?: number;\n }): boolean {\n const {renderPass, vertexArray} = options;\n vertexArray.bindBeforeRender(renderPass);\n vertexArray.unbindAfterRender(renderPass);\n return true;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray} from '@math.gl/types';\nimport type {Buffer, VertexArrayProps} from '@luma.gl/core';\nimport {VertexArray} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\n\nexport class NullVertexArray extends VertexArray {\n device: NullDevice;\n\n // Create a VertexArray\n constructor(device: NullDevice, props: VertexArrayProps) {\n super(device, props);\n this.device = device;\n }\n\n setIndexBuffer(indexBuffer: Buffer | null): void {\n this.indexBuffer = indexBuffer;\n }\n\n /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */\n setBuffer(location: number, attributeBuffer: Buffer): void {\n const attributeInfo = this.attributeInfos[location];\n if (!attributeInfo) {\n throw new Error(`Unknown attribute location ${location}`);\n }\n this.attributes[location] = attributeBuffer;\n }\n\n bindBeforeRender(): void {}\n\n unbindAfterRender(): void {}\n\n override setConstantWebGL(location: number, value: TypedArray | null): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {PrimitiveTopology, ShaderLayout, TransformFeedbackProps} from '@luma.gl/core';\nimport {TransformFeedback, Buffer, BufferRange} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullTransformFeedback extends TransformFeedback {\n readonly device: NullDevice;\n\n readonly layout: ShaderLayout;\n buffers: Record<string, Buffer | BufferRange> = {};\n\n constructor(device: NullDevice, props: TransformFeedbackProps) {\n super(device, props);\n this.device = device;\n this.layout = this.props.layout;\n\n if (props.buffers) {\n this.setBuffers(props.buffers);\n }\n\n Object.seal(this);\n }\n\n begin(topology: PrimitiveTopology = 'point-list'): void {}\n\n end(): void {}\n\n setBuffers(buffers: Record<string, Buffer | BufferRange>): void {\n this.buffers = {};\n\n for (const bufferName in buffers) {\n this.setBuffer(bufferName, buffers[bufferName]);\n }\n }\n\n setBuffer(locationOrName: string | number, bufferOrRange: Buffer | BufferRange): void {\n this.buffers[locationOrName] = bufferOrRange;\n }\n\n getBuffer(locationOrName: string | number): Buffer | BufferRange | null {\n return this.buffers[locationOrName] || null;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {QuerySet, QuerySetProps} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullQuerySet extends QuerySet {\n device: NullDevice;\n\n constructor(device: NullDevice, props: QuerySetProps) {\n super(device, props);\n this.device = device;\n }\n}\n", "// luma.gl\n// SPDX-License\n// Copyright (c) vis.gl contributors\n\n// TODO - replace createGLContext, instrumentGLContext, resizeGLContext?\n// TODO - remove dependency on framebuffer (bundle size impact)\nimport {luma, Device, DeviceProps, log} from '@luma.gl/core';\nimport {\n requestAnimationFramePolyfill,\n cancelAnimationFramePolyfill,\n Timeline,\n AnimationProps\n} from '@luma.gl/engine';\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {isBrowser} from '@probe.gl/env';\n\nimport {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: WebGL2RenderingContext;\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) => WebGL2RenderingContext; // 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?: WebGL2RenderingContext | 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, debug: true}),\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: WebGL2RenderingContext;\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 = requestAnimationFramePolyfill(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 cancelAnimationFramePolyfill(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 // 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", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// @ts-nocheck\n/* eslint-disable */\n\nimport {AnimationProps} from '@luma.gl/engine';\nimport {getWebGLTestDevice} from './create-test-device';\n\n// TODO - Replace with new AnimationLoop from `@luma.gl/engine`\nimport {ClassicAnimationLoop as AnimationLoop} from './deprecated/classic-animation-loop';\n\n/** Describes a test case */\nexport type TestRunnerTestCase = {\n /** Name of the test case (for logging) */\n name: string;\n /** Initialize the test case. Can return a promise */\n onInitialize: (props: AnimationProps) => Promise<void | {}>;\n /** Perform rendering */\n onRender: (props: AnimationProps & {done}) => void;\n /** Clean up after the test case */\n onFinalize: (props: AnimationProps) => void;\n animationLoop?: AnimationLoop;\n};\n\nconst DEFAULT_TEST_CASE: TestRunnerTestCase = {\n name: 'Unnamed test',\n onInitialize: async () => {},\n onRender: ({done}) => done(),\n onFinalize: () => {}\n};\n\n/** Options for a TestRunner */\nexport type TestRunnerProps = {\n width?: number;\n height?: number;\n // test lifecycle callback\n onTestStart?: (testCase: TestRunnerTestCase) => void;\n onTestPass?: (testCase: TestRunnerTestCase, result?: unknown) => void;\n onTestFail?: (testCase: TestRunnerTestCase, error?: unknown) => void;\n /** milliseconds to wait for each test case before aborting */\n timeout?: number;\n maxFramesToRender?: number;\n // HACK - this is for the snapshot test runner\n imageDiffOptions?: any;\n};\n\nconst DEFAULT_TEST_PROPS: Required<TestRunnerProps> = {\n width: undefined,\n height: undefined,\n\n // test lifecycle callback\n onTestStart: (testCase: TestRunnerTestCase) => console.log(`# ${testCase.name}`),\n onTestPass: (testCase: TestRunnerTestCase, result?: unknown) =>\n console.log(`ok ${testCase.name} passed`),\n onTestFail: (testCase: TestRunnerTestCase, error?: unknown) =>\n console.log(`not ok ${testCase.name} failed`),\n\n // milliseconds to wait for each test case before aborting\n timeout: 2000,\n maxFramesToRender: undefined,\n imageDiffOptions: undefined\n};\n\n/** Runs an array of test cases */\nexport class TestRunner {\n device = webglDevice;\n props: Record<string, any>;\n isRunning: boolean = false;\n testOptions: Required<TestRunnerProps> = {...DEFAULT_TEST_PROPS};\n readonly _animationProps?: AnimationProps;\n private _animationLoop: AnimationLoop | null;\n private _testCases: TestRunnerTestCase[] = [];\n private _testCaseData: any = null;\n private _currentTestCase: TestRunnerTestCase | null;\n private _currentTestCaseStartTime: number;\n private _currentTestCaseStartTick: number;\n\n // should be defined in snapshot-test-runner\n isDiffing: boolean = false;\n\n // @ts-expect-error\n isHeadless: boolean = Boolean(window.browserTestDriver_isHeadless);\n\n /**\n * props\n * AnimationLoop props\n */\n constructor(props: Record<string, any> = {}) {\n this.props = props;\n }\n\n /**\n * Add testCase(s)\n */\n add(testCases: TestRunnerTestCase[]): this {\n if (!Array.isArray(testCases)) {\n testCases = [testCases];\n }\n for (const testCase of testCases) {\n this._testCases.push(testCase);\n }\n return this;\n }\n\n /**\n * Returns a promise that resolves when all the test cases are done\n */\n async run(options: object = {}): Promise<void> {\n this.testOptions = {...this.testOptions, ...options};\n\n const device = await getWebGLTestDevice();\n\n return new Promise<void>((resolve, reject) => {\n this._animationLoop = new AnimationLoop({\n ...this.props,\n device: this.device,\n onRender: this._onRender.bind(this),\n onFinalize: () => {\n this.isRunning = false;\n resolve();\n }\n });\n this._animationLoop.start(this.props);\n\n this.isRunning = true;\n this.isDiffing = false;\n this._currentTestCase = null;\n }).catch(error => {\n this._fail({error: error.message});\n // reject(error);\n });\n }\n\n /* Lifecycle methods for subclassing */\n\n initTestCase(testCase: TestRunnerTestCase) {\n const {animationLoop} = testCase;\n if (animationLoop) {\n testCase.onInitialize = animationLoop.props.onInitialize.bind(animationLoop);\n testCase.onRender = animationLoop.props.onRender.bind(animationLoop);\n testCase.onFinalize = animationLoop.props.onFinalize.bind(animationLoop);\n }\n for (const key in DEFAULT_TEST_CASE) {\n testCase[key] = testCase[key] || DEFAULT_TEST_CASE[key];\n }\n }\n\n shouldRender(animationProps): boolean {\n return true;\n }\n\n assert(testCase: TestRunnerTestCase): void {\n this._pass(testCase);\n this._next();\n }\n\n /* Utilities */\n\n _pass(result: unknown): void {\n this.testOptions.onTestPass(this._currentTestCase, result);\n // this._animationLoop?.stop();\n }\n\n _fail(result: unknown): void {\n this.testOptions.onTestFail(this._currentTestCase, result);\n // this._animationLoop?.stop();\n }\n\n _next(): void {\n this._nextTestCase();\n }\n\n /* Private methods */\n\n _onRender(animationProps): void {\n this._animationProps = animationProps;\n\n const testCase = this._currentTestCase || this._nextTestCase();\n if (!testCase) {\n // all test cases are done\n this._animationLoop.stop();\n return;\n }\n\n let isDone = false;\n const testCaseAnimationProps: AnimationProps = {\n ...animationProps,\n ...this._testCaseData,\n // tick/time starts from 0 for each test case\n startTime: this._currentTestCaseStartTime,\n time: animationProps.time - this._currentTestCaseStartTime,\n tick: animationProps.tick - this._currentTestCaseStartTick,\n // called by the test case when it is done rendering and ready for capture and diff\n done: () => {\n isDone = true;\n }\n };\n\n if (this._testCaseData && this.shouldRender(testCaseAnimationProps)) {\n // try {\n // test case is initialized, render frame\n testCase.onRender(testCaseAnimationProps);\n // } catch {\n // isDone = true;\n // }\n }\n\n const timeout = testCase.timeout || this.testOptions.timeout;\n if (timeout && testCaseAnimationProps.time > timeout) {\n isDone = true;\n }\n\n if (isDone) {\n this.assert(testCase);\n }\n }\n\n _nextTestCase(): Promise<TestRunnerTestCase> {\n const animationProps = this._animationProps;\n\n // finalize the current test case\n if (this._testCaseData) {\n for (const key in this._testCaseData) {\n const value = this._testCaseData[key];\n if (value && value.delete) {\n value.destroy();\n }\n }\n this._currentTestCase.onFinalize(Object.assign({}, animationProps, this._testCaseData));\n\n // reset WebGL context\n this.device.popState();\n\n this._currentTestCase = null;\n this._testCaseData = null;\n }\n\n // get the next test case\n const testCase = this._testCases.shift();\n if (testCase) {\n // start new test case\n this._currentTestCase = testCase;\n this._currentTestCaseStartTime = animationProps.time;\n this._currentTestCaseStartTick = animationProps.tick;\n this.initTestCase(testCase);\n\n // initialize test case\n\n // save WebGL context\n this.device.pushState();\n\n // aligned with the behavior of AnimationLoop.onInitialized\n // onInitialized could return a plain object or a promise\n const initProps = {\n ...animationProps,\n // tick/time starts from 0 for each test case\n startTime: animationProps.time,\n time: 0,\n tick: 0\n };\n\n // aligned with the behavior of AnimationLoop.onInitialized\n // onInitialized could return a plain object or a promise\n Promise.resolve(testCase.onInitialize(initProps)).then(userData => {\n this._testCaseData = userData || {};\n });\n\n // invoke user callback\n this.testOptions.onTestStart(testCase);\n }\n return testCase;\n }\n}\n", "// Get the bounding box of a DOMElement relative to the page\nexport function getBoundingBoxInPage(domElement: HTMLElement): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const bbox = domElement.getBoundingClientRect();\n return {\n x: window.scrollX + bbox.x,\n y: window.scrollY + bbox.y,\n width: bbox.width,\n height: bbox.height\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {TestRunner, TestRunnerProps, TestRunnerTestCase} from './test-runner';\nimport {getBoundingBoxInPage} from './utils/get-bounding-box';\n\n/** A snapshot test case */\nexport type SnapshotTestRunnerTestCase = TestRunnerTestCase & {\n /** URL to golden image */\n goldenImage: string;\n /** Diff options */\n imageDiffOptions?: {[key: string]: any};\n};\n\nexport type SnapshotTestRunnerProps = TestRunnerProps;\n\nexport class SnapshotTestRunner extends TestRunner {\n // should be defined here but hack access in TestRunner\n // private isDiffing: boolean = false;\n\n constructor(props: SnapshotTestRunnerProps) {\n super(props);\n this.testOptions.imageDiffOptions = {};\n }\n\n override initTestCase(testCase: SnapshotTestRunnerTestCase): void {\n super.initTestCase(testCase);\n if (!testCase.goldenImage) {\n throw new Error(`Test case ${testCase.name} does not have golden image`);\n }\n }\n\n override shouldRender(): boolean {\n // wait for the current diffing to finish\n return !this.isDiffing;\n }\n\n override async assert(testCase: SnapshotTestRunnerTestCase): Promise<void> {\n if (this.isDiffing) {\n // Already performing diffing\n return;\n }\n this.isDiffing = true;\n\n const canvas = this._animationProps?.canvas;\n if (!(canvas instanceof HTMLCanvasElement)) {\n throw new Error('canvas');\n }\n\n const diffOptions = {\n ...this.testOptions.imageDiffOptions,\n ...testCase.imageDiffOptions,\n goldenImage: testCase.goldenImage,\n region: getBoundingBoxInPage(canvas)\n };\n\n // Take screenshot and compare\n const result = await globalThis.browserTestDriver_captureAndDiffScreen(diffOptions);\n\n // invoke user callback\n if (result.success) {\n this._pass(result);\n } else {\n this._fail(result);\n }\n\n this.isDiffing = false;\n this._next();\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {TestRunner, TestRunnerProps, TestRunnerTestCase} from './test-runner';\n\nexport type PerformanceTestRunnerProps = TestRunnerProps;\n\nexport class PerformanceTestRunner extends TestRunner {\n private _stats: Stats | null = null;\n private _fps: Stat | null = null;\n\n constructor(props: PerformanceTestRunnerProps) {\n super(props);\n\n Object.assign(this.testOptions, {\n maxFramesToRender: 60,\n targetFPS: 50\n });\n }\n\n override initTestCase(testCase: TestRunnerTestCase): void {\n super.initTestCase(testCase);\n this._stats = new Stats({id: testCase.name});\n this._fps = this._stats.get('fps');\n }\n\n override shouldRender(animationProps: Record<string, any>): boolean {\n this._fps?.timeEnd();\n this._fps?.timeStart();\n\n if (this._fps.count > this.testOptions.maxFramesToRender) {\n animationProps.done();\n }\n\n return true;\n }\n\n override assert(testCase: TestRunnerTestCase): void {\n // @ts-expect-error\n const targetFPS = testCase.targetFPS || this.testOptions.targetFPS;\n const count = this._fps?.count;\n const fps = this._fps?.getHz() || 0;\n\n if (fps >= targetFPS) {\n this._pass({fps, framesRendered: count});\n } else {\n this._fail({fps, framesRendered: count});\n }\n this._next();\n }\n}\n", "/**\n * Tests that an argument matches the type.\n * @note fails during typescript type check, not during runtime.\n */\nexport function checkType<T>(value: T): void {}\n", "/** Recursively copies objects */\nexport function deepCopy(object: Record<string, any>) {\n if (Array.isArray(object)) {\n return object.map(element => deepCopy(element));\n }\n\n if (object !== null && typeof object === 'object') {\n const newObject = {};\n for (const key in object) {\n newObject[key] = deepCopy(object[key]);\n }\n return newObject;\n }\n\n return object;\n}\n", "/* global luma */\nexport function getResourceCounts() {\n // @ts-ignore\n const resourceStats = luma.stats.get('Resource Counts');\n return {\n Texture2D: resourceStats.get('Texture2Ds Active').count,\n Buffer: resourceStats.get('Buffers Active').count\n };\n}\n\nexport function getLeakedResources(\n startCounts: Record<string, number>,\n endCounts: Record<string, number>\n): number | null {\n let leakedResources = null;\n const info = 'leaking: ';\n for (const resourceName in endCounts) {\n const leakCount = endCounts[resourceName] - startCounts[resourceName];\n if (leakCount !== 0) {\n leakedResources = Object.assign({}, leakedResources, {\n [resourceName]: leakCount,\n info: `${info} ${resourceName}: ${leakCount}, `\n });\n }\n }\n return leakedResources;\n}\n", "// luma.gl\n// SPDX-License\n// Copyright (c) vis.gl contributors\n\nimport type {CanvasContextProps} from '@luma.gl/core';\nimport {WebGLDevice} from '@luma.gl/webgl';\n\nconst DEFAULT_CANVAS_CONTEXT_PROPS: CanvasContextProps = {\n width: 1,\n height: 1\n};\n\n/**\n * Create a test WebGLDevice\n * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized\n * @deprecated Use getWebGLTestDevice().\n */\nexport function createTestDevice(): WebGLDevice | null {\n try {\n // TODO - We do not use luma.createDevice since createTestDevice currently expect WebGL context to be created synchronously\n return new WebGLDevice({createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS});\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Failed to created device: ${(error as Error).message}`);\n debugger; // eslint-disable-line no-debugger\n return null;\n }\n}\n\n/**\n * A pre-created WebGLDevice\n * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized\n * @deprecated Use getWebGLTestDevice().\n */\nexport const webglDevice = createTestDevice();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;qBAAAA;;AAAA;;;ACIA,kBAAmB;AACnB,mBAA4B;AAC5B,oBAA4B;AAE5B,iBAAK,iBAAiB,CAAC,4BAAe,2BAAa,CAAC;;;ACHpD,IAAAC,gBAAwB;AACxB,IAAAC,gBAAyC;AACzC,IAAAC,iBAA0C;;;ACH1C,IAAAC,gBAAmC;;;ACsBnC,IAAAC,gBAAqC;;;ACpB9B,IAAM,iBAAiB;EAC5B,MAAM;EACN,KAAK;EACL,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,SAAS;EACT,iBAAiB;EACjB,wBAAwB;;;;ACX1B,IAAAC,eAA2B;AAErB,IAAO,mBAAP,cAAgC,0BAAY;EAChD,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,gBAAgB;EAChB,4CAA4C;EAC5C,4CAA4C;EAC5C,mCAAmC;EACnC,4BAA4B;EAC5B,kCAAkC;EAClC,mCAAmC;EACnC,kCAAkC;EAClC,8BA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AAO,OAAO,IAAI,aAAW,SAAS,OAAO,CAAC;EAChD;AAEA,MAAI,WAAW,QAAQ,OAAO,WAAW,UAAU;AACjD,UAAM,YAAY,CAAA;AAClB,eAAW,OAAO,QAAQ;AACxB,gBAAU,GAAG,IAAI,SAAS,OAAO,GAAG,CAAC;IACvC;AACA,WAAO;EACT;AAEA,SAAO;AACT;;;ACdM,SAAU,oBAAiB;AAE/B,QAAM,gBAAgB,KAAK,MAAM,IAAI,iBAAiB;AACtD,SAAO;IACL,WAAW,cAAc,IAAI,mBAAmB,EAAE;IAClD,QAAQ,cAAc,IAAI,gBAAgB,EAAE;;AAEhD;AAEM,SAAU,mBACd,aACA,WAAiC;AAEjC,MAAI,kBAAkB;AACtB,QAAM,OAAO;AACb,aAAW,gBAAgB,WAAW;AACpC,UAAM,YAAY,UAAU,YAAY,IAAI,YAAY,YAAY;AACpE,QAAI,cAAc,GAAG;AACnB,wBAAkB,OAAO,OAAO,CAAA,GAAI,iBAAiB;QACnD,CAAC,YAAY,GAAG;QAChB,MAAM,GAAG,QAAQ,iBAAiB;OACnC;IACH;EACF;AACA,SAAO;AACT;;;ACrBA,IAAAC,gBAA0B;AAE1B,IAAMC,gCAAmD;EACvD,OAAO;EACP,QAAQ;;AAQJ,SAAU,mBAAgB;AAC9B,MAAI;AAEF,WAAO,IAAI,0BAAY,EAAC,qBAAqBA,8BAA4B,CAAC;EAC5E,SAAS,OAAP;AAEA,YAAQ,MAAM,6BAA8B,MAAgB,SAAS;AACrE;AACA,WAAO;EACT;AACF;AAOO,IAAMC,eAAc,iBAAgB;",
6
- "names": ["webglDevice", "import_core", "import_webgl", "import_webgpu", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "webglDevice", "import_core", "import_webgl", "import_webgl", "DEFAULT_CANVAS_CONTEXT_PROPS", "webglDevice"]
3
+ "sources": ["../src/index.ts", "../src/create-test-device.ts", "../src/null-device/null-adapter.ts", "../src/null-device/null-device.ts", "../src/null-device/null-device-info.ts", "../src/null-device/null-device-features.ts", "../src/null-device/null-canvas-context.ts", "../src/null-device/resources/null-framebuffer.ts", "../src/null-device/resources/null-buffer.ts", "../src/null-device/resources/null-shader.ts", "../src/null-device/resources/null-command-buffer.ts", "../src/null-device/resources/null-sampler.ts", "../src/null-device/resources/null-texture.ts", "../src/null-device/resources/null-texture-view.ts", "../src/null-device/resources/null-render-pass.ts", "../src/null-device/resources/null-render-pipeline.ts", "../src/null-device/resources/null-vertex-array.ts", "../src/null-device/resources/null-transform-feedback.ts", "../src/null-device/resources/null-query-set.ts", "../src/deprecated/classic-animation-loop.ts", "../src/test-runner.ts", "../src/utils/get-bounding-box.ts", "../src/snapshot-test-runner.ts", "../src/performance-test-runner.ts", "../src/utils/check-type.ts", "../src/utils/deep-copy.ts", "../src/utils/resource-tracker.ts", "../src/deprecated/sync-test-device.ts"],
4
+ "sourcesContent": ["// TEST RUNNERS\nexport type {TestRunnerTestCase} from './test-runner';\nexport type {SnapshotTestRunnerTestCase} from './snapshot-test-runner';\n\nexport {SnapshotTestRunner} from './snapshot-test-runner';\nexport {PerformanceTestRunner} from './performance-test-runner';\n\n// TEST DEVICES\nexport {\n getTestDevices,\n getWebGLTestDevice,\n getWebGPUTestDevice,\n getNullTestDevice\n} from './create-test-device';\n\n// Null device\nexport {nullAdapter, NullAdapter} from './null-device/null-adapter';\nexport {NullDevice} from './null-device/null-device';\n\n// UTILS\nexport {checkType} from './utils/check-type';\nexport {deepCopy} from './utils/deep-copy';\nexport {getResourceCounts, getLeakedResources} from './utils/resource-tracker';\n\n// DEPRECATED\nexport {createTestDevice, webglDevice} from './deprecated/sync-test-device';\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device, CanvasContextProps} from '@luma.gl/core';\nimport {luma, log} from '@luma.gl/core';\nimport {webgl2Adapter, WebGLDevice} from '@luma.gl/webgl';\nimport {webgpuAdapter, WebGPUDevice} from '@luma.gl/webgpu';\nimport {nullAdapter} from './null-device/null-adapter';\nimport {NullDevice} from './null-device/null-device';\n\nconst DEFAULT_CANVAS_CONTEXT_PROPS: CanvasContextProps = {\n width: 1,\n height: 1\n};\n\n// TODO - replace with Promise.withResolvers once we upgrade TS baseline\nconst withResolvers = <T>(): {\n promise: Promise<T>;\n resolve: (t: T) => void;\n reject: (error: Error) => void;\n} => {\n let resolve;\n let reject;\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n return {promise, resolve, reject};\n};\n\n/** A null device intended for testing - @note Only available after getTestDevices() has completed */\nlet nullDevicePromise = makeNullTestDevice();\n/** This WebGL Device can be used directly but will not have WebGL debugging initialized */\nconst webglDevicePromise = makeWebGLTestDevice();\n/** A WebGL 2 Device intended for testing - @note Only available after getTestDevices() has completed */\nconst webgpuDevicePromise = makeWebGPUTestDevice();\n\n/** Includes WebGPU device if available */\nexport async function getTestDevices(\n types: ('webgl' | 'webgpu' | 'unknown')[] = ['webgl', 'webgpu']\n): Promise<Device[]> {\n return [await getNullTestDevice(), await getWebGLTestDevice(), await getWebGPUTestDevice()]\n .filter(Boolean)\n .filter(device => types.includes(device.type));\n}\n\n/** returns WebGPU device promise, if available */\nexport function getWebGPUTestDevice(): Promise<WebGPUDevice | null> {\n return webgpuDevicePromise;\n}\n\n/** returns WebGL device promise, if available */\nexport async function getWebGLTestDevice(): Promise<WebGLDevice> {\n return webglDevicePromise;\n}\n\n/** returns null device promise, if available */\nexport async function getNullTestDevice(): Promise<NullDevice> {\n return nullDevicePromise;\n}\n\nasync function makeWebGPUTestDevice(): Promise<WebGPUDevice | null> {\n const webgpuDeviceResolvers = withResolvers<WebGPUDevice | null>();\n try {\n const webgpuDevice = (await luma.createDevice({\n id: 'webgpu-test-device',\n type: 'webgpu',\n adapters: [webgpuAdapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true\n })) as WebGPUDevice;\n webgpuDeviceResolvers.resolve(webgpuDevice);\n } catch (error) {\n log.error(String(error))();\n webgpuDeviceResolvers.resolve(null);\n }\n return webgpuDeviceResolvers.promise;\n}\n\n/** returns WebGL device promise, if available */\nasync function makeWebGLTestDevice(): Promise<WebGLDevice> {\n const webglDeviceResolvers = withResolvers<WebGLDevice>();\n try {\n const webglDevice = (await luma.createDevice({\n id: 'webgl-test-device',\n type: 'webgl',\n adapters: [webgl2Adapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true,\n debugWebGL: true\n })) as WebGLDevice;\n webglDeviceResolvers.resolve(webglDevice);\n } catch (error) {\n log.error(String(error))();\n webglDeviceResolvers.resolve(null);\n }\n return webglDeviceResolvers.promise;\n}\n\n/** returns null device promise, if available */\nasync function makeNullTestDevice(): Promise<NullDevice> {\n const nullDeviceResolvers = withResolvers<NullDevice>();\n try {\n const nullDevice = (await luma.createDevice({\n id: 'null-test-device',\n type: 'unknown',\n adapters: [nullAdapter],\n createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS,\n debug: true,\n debugWebGL: true\n })) as NullDevice;\n nullDeviceResolvers.resolve(nullDevice);\n } catch (error) {\n log.error(String(error))();\n nullDevicePromise = Promise.resolve(null);\n }\n return nullDeviceResolvers.promise;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Adapter, DeviceProps} from '@luma.gl/core';\nimport {NullDevice} from './null-device';\n\nexport class NullAdapter extends Adapter {\n /** type of device's created by this adapter */\n readonly type: NullDevice['type'] = 'unknown';\n\n constructor() {\n super();\n // @ts-ignore DEPRECATED For backwards compatibility luma.registerDevices\n NullDevice.adapter = this;\n }\n\n /** Check if WebGPU is available */\n isSupported(): boolean {\n return true;\n }\n\n async attach(handle: null): Promise<NullDevice> {\n return new NullDevice({});\n }\n\n async create(props: DeviceProps = {}): Promise<NullDevice> {\n return new NullDevice(props);\n }\n}\n\nexport const nullAdapter = new NullAdapter();\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n DeviceProps,\n CanvasContextProps,\n VertexArray,\n VertexArrayProps,\n BufferProps,\n ShaderProps,\n SamplerProps,\n TextureProps,\n ExternalTexture,\n ExternalTextureProps,\n FramebufferProps,\n RenderPipelineProps,\n ComputePipeline,\n ComputePipelineProps,\n RenderPassProps,\n ComputePass,\n ComputePassProps,\n CommandEncoderProps,\n TransformFeedbackProps,\n QuerySetProps\n} from '@luma.gl/core';\nimport {Device, DeviceFeatures} from '@luma.gl/core';\n\nimport {NullDeviceInfo} from './null-device-info';\nimport {NullDeviceLimits} from './null-device-features';\nimport {NullCanvasContext} from './null-canvas-context';\nimport {NullBuffer} from './resources/null-buffer';\nimport {NullFramebuffer} from './resources/null-framebuffer';\nimport {NullShader} from './resources/null-shader';\nimport {NullCommandEncoder} from './resources/null-command-buffer';\nimport {NullSampler} from './resources/null-sampler';\nimport {NullTexture} from './resources/null-texture';\nimport {NullRenderPass} from './resources/null-render-pass';\nimport {NullRenderPipeline} from './resources/null-render-pipeline';\nimport {NullVertexArray} from './resources/null-vertex-array';\nimport {NullTransformFeedback} from './resources/null-transform-feedback';\nimport {NullQuerySet} from './resources/null-query-set';\n\n/** Do-nothing device implementation for testing */\nexport class NullDevice extends Device {\n static isSupported(): boolean {\n return true;\n }\n readonly type = 'unknown';\n readonly handle = null;\n\n readonly preferredColorFormat = 'rgba8unorm';\n readonly preferredDepthFormat = 'depth24plus';\n\n features: DeviceFeatures = new DeviceFeatures([], this.props._disabledFeatures);\n limits: NullDeviceLimits = new NullDeviceLimits();\n readonly info = NullDeviceInfo;\n\n readonly canvasContext: NullCanvasContext;\n readonly lost: Promise<{reason: 'destroyed'; message: string}>;\n\n constructor(props: DeviceProps) {\n super({...props, id: props.id || 'null-device'});\n\n const canvasContextProps = props.createCanvasContext === true ? {} : props.createCanvasContext;\n this.canvasContext = new NullCanvasContext(this, canvasContextProps);\n this.lost = new Promise(resolve => {});\n }\n\n /**\n * Destroys the context\n * @note Has no effect for null contexts\n */\n destroy(): void {}\n\n get isLost(): boolean {\n return false;\n }\n\n // IMPLEMENTATION OF ABSTRACT DEVICE\n\n createCanvasContext(props: CanvasContextProps): NullCanvasContext {\n return new NullCanvasContext(this, props);\n }\n\n createBuffer(props: BufferProps | ArrayBuffer | ArrayBufferView): NullBuffer {\n const newProps = this._normalizeBufferProps(props);\n return new NullBuffer(this, newProps);\n }\n\n getDefaultRenderPass(): NullRenderPass {\n return new NullRenderPass(this, {});\n }\n\n createTexture(props: TextureProps): NullTexture {\n return new NullTexture(this, props);\n }\n\n createExternalTexture(props: ExternalTextureProps): ExternalTexture {\n throw new Error('createExternalTexture() not implemented'); // return new Program(props);\n }\n\n createSampler(props: SamplerProps): NullSampler {\n return new NullSampler(this, props);\n }\n\n createShader(props: ShaderProps): NullShader {\n return new NullShader(this, props);\n }\n\n createFramebuffer(props: FramebufferProps): NullFramebuffer {\n return new NullFramebuffer(this, props);\n }\n\n createVertexArray(props: VertexArrayProps): VertexArray {\n return new NullVertexArray(this, props);\n }\n\n createTransformFeedback(props: TransformFeedbackProps): NullTransformFeedback {\n return new NullTransformFeedback(this, props);\n }\n\n createQuerySet(props: QuerySetProps): NullQuerySet {\n return new NullQuerySet(this, props);\n }\n\n createRenderPipeline(props: RenderPipelineProps): NullRenderPipeline {\n return new NullRenderPipeline(this, props);\n }\n\n beginRenderPass(props: RenderPassProps): NullRenderPass {\n return new NullRenderPass(this, props);\n }\n\n createComputePipeline(props?: ComputePipelineProps): ComputePipeline {\n throw new Error('ComputePipeline not supported in WebGL');\n }\n\n beginComputePass(props: ComputePassProps): ComputePass {\n throw new Error('ComputePass not supported in WebGL');\n }\n\n override createCommandEncoder(props: CommandEncoderProps = {}): NullCommandEncoder {\n return new NullCommandEncoder(this, props);\n }\n\n submit(): void {}\n\n override setParametersWebGL(parameters: any): void {}\n\n override getParametersWebGL(parameters: any): any {}\n\n override withParametersWebGL(parameters: any, func: any): any {\n const {nocatch = true} = parameters;\n let value: any;\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n return func();\n }\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func();\n } catch {\n // ignore\n }\n return value;\n }\n\n override _getDeviceSpecificTextureFormatCapabilities(format: any): any {\n return format;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {DeviceInfo} from '@luma.gl/core';\n\nexport const NullDeviceInfo = {\n type: 'unknown',\n gpu: 'software',\n gpuType: 'unknown',\n gpuBackend: 'unknown',\n vendor: 'no one',\n renderer: 'none',\n version: '1.0',\n shadingLanguage: 'glsl',\n shadingLanguageVersion: 300\n} as const satisfies DeviceInfo;\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {DeviceLimits} from '@luma.gl/core';\n\nexport class NullDeviceLimits extends DeviceLimits {\n maxTextureDimension1D = 0;\n maxTextureDimension2D = 2048;\n maxTextureDimension3D = 256;\n maxTextureArrayLayers = 256;\n maxBindGroups = 0;\n maxDynamicUniformBuffersPerPipelineLayout = 0;\n maxDynamicStorageBuffersPerPipelineLayout = 0;\n maxSampledTexturesPerShaderStage = 8;\n maxSamplersPerShaderStage = 16;\n maxStorageBuffersPerShaderStage = 0;\n maxStorageTexturesPerShaderStage = 0;\n maxUniformBuffersPerShaderStage = 20;\n maxUniformBufferBindingSize = 16384;\n maxStorageBufferBindingSize = 0;\n minUniformBufferOffsetAlignment = 0;\n minStorageBufferOffsetAlignment = 0;\n maxVertexBuffers = 16;\n maxVertexAttributes = 16;\n maxVertexBufferArrayStride = 2048;\n maxInterStageShaderComponents = 60;\n maxComputeWorkgroupStorageSize = 0;\n maxComputeInvocationsPerWorkgroup = 0;\n maxComputeWorkgroupSizeX = 0;\n maxComputeWorkgroupSizeY = 0;\n maxComputeWorkgroupSizeZ = 0;\n maxComputeWorkgroupsPerDimension = 0;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {CanvasContextProps} from '@luma.gl/core';\nimport {CanvasContext} from '@luma.gl/core';\nimport type {NullDevice} from './null-device';\nimport {NullFramebuffer} from './resources/null-framebuffer';\n\n/**\n * A WebGL Canvas Context which manages the canvas and handles drawing buffer resizing etc\n */\nexport class NullCanvasContext extends CanvasContext {\n readonly device: NullDevice;\n readonly handle = null;\n\n presentationSize: [number, number];\n private _framebuffer: NullFramebuffer | null = null;\n\n get [Symbol.toStringTag]() {\n return 'NullCanvasContext';\n }\n\n constructor(device: NullDevice, props: CanvasContextProps) {\n // Note: Base class creates / looks up the canvas (unless under Node.js)\n super(props);\n this.device = device;\n\n // Base class constructor cannot access derived methods/fields, so we need to call these functions in the subclass constructor\n this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);\n this.updateSize([this.drawingBufferWidth, this.drawingBufferHeight]);\n }\n\n getCurrentFramebuffer(): NullFramebuffer {\n // Setting handle to null returns a reference to the default framebuffer\n this._framebuffer = this._framebuffer || new NullFramebuffer(this.device, {handle: null});\n return this._framebuffer;\n }\n\n /** Resizes and updates render targets if necessary */\n updateSize(size: [number, number]) {}\n\n resize(options?: {width?: number; height?: number; useDevicePixels?: boolean | number}): void {\n throw new Error('not implemented');\n }\n\n commit() {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {FramebufferProps} from '@luma.gl/core';\nimport {Framebuffer} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\nimport type {NullTextureView} from './null-texture-view';\n\nexport class NullFramebuffer extends Framebuffer {\n device: NullDevice;\n\n colorAttachments: NullTextureView[] = [];\n depthStencilAttachment: NullTextureView | null = null;\n\n constructor(device: NullDevice, props: FramebufferProps) {\n super(device, props);\n this.device = device;\n }\n\n protected override updateAttachments(): void {\n // Null framebuffers are JS only objects, nothing to\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {BufferProps} from '@luma.gl/core';\nimport {Buffer} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullBuffer extends Buffer {\n device: NullDevice;\n\n byteLength: number;\n\n constructor(device: NullDevice, props: BufferProps = {}) {\n super(device, props);\n this.device = device;\n\n const byteOffset = props.byteOffset || 0;\n const byteLength = props.byteLength ?? (props.data ? props.data.byteLength + byteOffset : 0);\n\n // assert(byteLength >= 0);\n\n this.byteLength = byteLength;\n this.trackAllocatedMemory(byteLength);\n }\n\n override destroy(): void {\n if (!this.destroyed) {\n super.destroy();\n this.trackDeallocatedMemory();\n }\n }\n\n async readAsync(byteOffset = 0, byteLength?: number): Promise<Uint8Array> {\n byteLength = byteLength ?? this.byteLength - byteOffset;\n return new Uint8Array(byteLength);\n }\n\n write(data: ArrayBufferView, byteOffset: number = 0): void {\n // assert(data.byteLength + byteOffset <= this.byteLength);\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Shader, ShaderProps, CompilerMessage} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullShader extends Shader {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: ShaderProps) {\n super(device, props);\n this.device = device;\n }\n\n get asyncCompilationStatus(): Promise<any> {\n return this.getCompilationInfo().then(() => 'success');\n }\n\n async getCompilationInfo(): Promise<readonly CompilerMessage[]> {\n return [];\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {CommandEncoder, CommandEncoderProps} from '@luma.gl/core';\nimport type {\n CopyBufferToBufferOptions,\n CopyBufferToTextureOptions,\n CopyTextureToBufferOptions,\n CopyTextureToTextureOptions,\n QuerySet\n} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullCommandEncoder extends CommandEncoder {\n device: NullDevice;\n\n constructor(device: NullDevice, props: CommandEncoderProps) {\n super(device, props);\n this.device = device;\n }\n\n finish(): void {}\n\n copyBufferToBuffer(options: CopyBufferToBufferOptions): void {}\n\n copyBufferToTexture(options: CopyBufferToTextureOptions) {}\n\n copyTextureToBuffer(options: CopyTextureToBufferOptions): void {}\n\n copyTextureToTexture(options: CopyTextureToTextureOptions): void {}\n\n pushDebugGroup(groupLabel: string): void {}\n popDebugGroup() {}\n\n insertDebugMarker(markerLabel: string): void {}\n resolveQuerySet(querySet: QuerySet): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Sampler, SamplerProps} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullSampler extends Sampler {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: SamplerProps) {\n super(device, props);\n this.device = device;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n TextureProps,\n Sampler,\n SamplerProps,\n TextureViewProps,\n CopyExternalImageOptions,\n Texture1DData,\n Texture2DData,\n Texture3DData,\n TextureCubeData,\n TextureArrayData,\n TextureCubeArrayData\n} from '@luma.gl/core';\n\nimport {Texture} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\nimport {NullSampler} from './null-sampler';\nimport {NullTextureView} from './null-texture-view';\n\nexport class NullTexture extends Texture {\n readonly device: NullDevice;\n\n sampler: NullSampler;\n view: NullTextureView;\n\n constructor(device: NullDevice, props: TextureProps) {\n super(device, props);\n\n // Texture base class strips out the data prop, so we need to add it back in\n const propsWithData = {...this.props};\n propsWithData.data = props.data;\n\n this.device = device;\n\n this.initialize(propsWithData);\n\n Object.seal(this);\n }\n\n override destroy(): void {\n if (!this.destroyed) {\n super.destroy();\n this.trackDeallocatedMemory('Texture');\n }\n }\n\n createView(props: TextureViewProps): NullTextureView {\n return new NullTextureView(this.device, {...props, texture: this});\n }\n\n setTexture1DData(data: Texture1DData): void {\n throw new Error('not implemented');\n }\n\n setTexture2DData(lodData: Texture2DData, depth?: number, target?: number): void {\n throw new Error('not implemented');\n }\n\n setTexture3DData(lodData: Texture3DData, depth?: number, target?: number): void {\n throw new Error('not implemented');\n }\n\n setTextureCubeData(data: TextureCubeData, depth?: number): void {\n throw new Error('not implemented');\n }\n\n setTextureArrayData(data: TextureArrayData): void {\n throw new Error('not implemented');\n }\n\n setTextureCubeArrayData(data: TextureCubeArrayData): void {\n throw new Error('not implemented');\n }\n\n initialize(props: TextureProps = {}): this {\n // const data = props.data;\n // this.setImageData(props);\n\n this.setSampler(props.sampler);\n\n this.view = new NullTextureView(this.device, {\n ...props,\n texture: this,\n mipLevelCount: 1,\n arrayLayerCount: 1\n });\n\n return this;\n }\n\n setSampler(sampler: Sampler | SamplerProps = {}): this {\n if (sampler instanceof NullSampler) {\n this.sampler = sampler;\n } else {\n this.sampler = new NullSampler(this.device, sampler);\n }\n\n return this;\n }\n\n copyExternalImage(options: CopyExternalImageOptions): {width: number; height: number} {\n this.trackDeallocatedMemory('Texture');\n\n const {image: data} = options;\n\n // if (data && data.byteLength) {\n // this.trackAllocatedMemory(data.byteLength, 'Texture');\n // } else {\n const bytesPerPixel = 4;\n this.trackAllocatedMemory(this.width * this.height * bytesPerPixel, 'Texture');\n // }\n\n const width = options.width ?? (data as ImageBitmap).width;\n const height = options.height ?? (data as ImageBitmap).height;\n\n this.width = width;\n this.height = height;\n\n return {width, height};\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TextureViewProps} from '@luma.gl/core';\nimport {TextureView, Texture} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\nimport type {NullTexture} from './null-texture';\n\nexport class NullTextureView extends TextureView {\n readonly device: NullDevice;\n readonly texture: NullTexture;\n\n constructor(device: NullDevice, props: TextureViewProps & {texture: NullTexture}) {\n super(device, {...Texture.defaultProps, ...props});\n\n this.device = device;\n this.texture = props.texture;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {RenderPass, RenderPassProps, RenderPassParameters} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullRenderPass extends RenderPass {\n readonly device: NullDevice;\n\n constructor(device: NullDevice, props: RenderPassProps) {\n super(device, props);\n this.device = device;\n }\n\n end(): void {}\n\n override pushDebugGroup(groupLabel: string): void {}\n override popDebugGroup(): void {}\n override insertDebugMarker(markerLabel: string): void {}\n\n setParameters(parameters: RenderPassParameters = {}): void {}\n\n beginOcclusionQuery(queryIndex: number): void {}\n endOcclusionQuery(): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n UniformValue,\n RenderPipelineProps,\n Binding,\n RenderPass,\n VertexArray\n} from '@luma.gl/core';\nimport {RenderPipeline} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\nimport {NullShader} from './null-shader';\n\n/** Creates a new render pipeline */\nexport class NullRenderPipeline extends RenderPipeline {\n device: NullDevice;\n vs: NullShader;\n fs: NullShader;\n\n uniforms: Record<string, UniformValue> = {};\n bindings: Record<string, Binding> = {};\n\n constructor(device: NullDevice, props: RenderPipelineProps) {\n super(device, props);\n this.device = device;\n\n this.vs = props.vs as NullShader;\n this.fs = props.fs as NullShader;\n\n this.shaderLayout = props.shaderLayout || {\n attributes: [],\n bindings: [],\n uniforms: []\n };\n }\n\n setBindings(bindings: Record<string, Binding>): void {\n Object.assign(this.bindings, bindings);\n }\n\n override setUniformsWebGL(uniforms: Record<string, UniformValue>): void {\n Object.assign(this.uniforms, uniforms);\n }\n\n draw(options: {\n renderPass: RenderPass;\n vertexArray: VertexArray;\n vertexCount?: number;\n instanceCount?: number;\n }): boolean {\n const {renderPass, vertexArray} = options;\n vertexArray.bindBeforeRender(renderPass);\n vertexArray.unbindAfterRender(renderPass);\n return true;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray} from '@math.gl/types';\nimport type {Buffer, VertexArrayProps} from '@luma.gl/core';\nimport {VertexArray} from '@luma.gl/core';\n\nimport type {NullDevice} from '../null-device';\n\nexport class NullVertexArray extends VertexArray {\n device: NullDevice;\n\n // Create a VertexArray\n constructor(device: NullDevice, props: VertexArrayProps) {\n super(device, props);\n this.device = device;\n }\n\n setIndexBuffer(indexBuffer: Buffer | null): void {\n this.indexBuffer = indexBuffer;\n }\n\n /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */\n setBuffer(location: number, attributeBuffer: Buffer): void {\n const attributeInfo = this.attributeInfos[location];\n if (!attributeInfo) {\n throw new Error(`Unknown attribute location ${location}`);\n }\n this.attributes[location] = attributeBuffer;\n }\n\n bindBeforeRender(): void {}\n\n unbindAfterRender(): void {}\n\n override setConstantWebGL(location: number, value: TypedArray | null): void {}\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {PrimitiveTopology, ShaderLayout, TransformFeedbackProps} from '@luma.gl/core';\nimport {TransformFeedback, Buffer, BufferRange} from '@luma.gl/core';\nimport type {NullDevice} from '../null-device';\n\nexport class NullTransformFeedback extends TransformFeedback {\n readonly device: NullDevice;\n\n readonly layout: ShaderLayout;\n buffers: Record<string, Buffer | BufferRange> = {};\n\n constructor(device: NullDevice, props: TransformFeedbackProps) {\n super(device, props);\n this.device = device;\n this.layout = this.props.layout;\n\n if (props.buffers) {\n this.setBuffers(props.buffers);\n }\n\n Object.seal(this);\n }\n\n begin(topology: PrimitiveTopology = 'point-list'): void {}\n\n end(): void {}\n\n setBuffers(buffers: Record<string, Buffer | BufferRange>): void {\n this.buffers = {};\n\n for (const bufferName in buffers) {\n this.setBuffer(bufferName, buffers[bufferName]);\n }\n }\n\n setBuffer(locationOrName: string | number, bufferOrRange: Buffer | BufferRange): void {\n this.buffers[locationOrName] = bufferOrRange;\n }\n\n getBuffer(locationOrName: string | number): Buffer | BufferRange | null {\n return this.buffers[locationOrName] || null;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {QuerySet, QuerySetProps} from '@luma.gl/core';\nimport {NullDevice} from '../null-device';\n\nexport class NullQuerySet extends QuerySet {\n device: NullDevice;\n\n constructor(device: NullDevice, props: QuerySetProps) {\n super(device, props);\n this.device = device;\n }\n}\n", "// luma.gl\n// SPDX-License\n// Copyright (c) vis.gl contributors\n\n// TODO - replace createGLContext, instrumentGLContext, resizeGLContext?\n// TODO - remove dependency on framebuffer (bundle size impact)\nimport {luma, Device, DeviceProps, log} from '@luma.gl/core';\nimport {\n requestAnimationFramePolyfill,\n cancelAnimationFramePolyfill,\n Timeline,\n AnimationProps\n} from '@luma.gl/engine';\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {isBrowser} from '@probe.gl/env';\n\nimport {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: WebGL2RenderingContext;\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) => WebGL2RenderingContext; // 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?: WebGL2RenderingContext | 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, debug: true}),\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: WebGL2RenderingContext;\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 = requestAnimationFramePolyfill(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 cancelAnimationFramePolyfill(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 // 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", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// @ts-nocheck\n/* eslint-disable */\n\nimport {AnimationProps} from '@luma.gl/engine';\nimport {getWebGLTestDevice} from './create-test-device';\n\n// TODO - Replace with new AnimationLoop from `@luma.gl/engine`\nimport {ClassicAnimationLoop as AnimationLoop} from './deprecated/classic-animation-loop';\n\n/** Describes a test case */\nexport type TestRunnerTestCase = {\n /** Name of the test case (for logging) */\n name: string;\n /** Initialize the test case. Can return a promise */\n onInitialize: (props: AnimationProps) => Promise<void | {}>;\n /** Perform rendering */\n onRender: (props: AnimationProps & {done}) => void;\n /** Clean up after the test case */\n onFinalize: (props: AnimationProps) => void;\n animationLoop?: AnimationLoop;\n};\n\nconst DEFAULT_TEST_CASE: TestRunnerTestCase = {\n name: 'Unnamed test',\n onInitialize: async () => {},\n onRender: ({done}) => done(),\n onFinalize: () => {}\n};\n\n/** Options for a TestRunner */\nexport type TestRunnerProps = {\n width?: number;\n height?: number;\n // test lifecycle callback\n onTestStart?: (testCase: TestRunnerTestCase) => void;\n onTestPass?: (testCase: TestRunnerTestCase, result?: unknown) => void;\n onTestFail?: (testCase: TestRunnerTestCase, error?: unknown) => void;\n /** milliseconds to wait for each test case before aborting */\n timeout?: number;\n maxFramesToRender?: number;\n // HACK - this is for the snapshot test runner\n imageDiffOptions?: any;\n};\n\nconst DEFAULT_TEST_PROPS: Required<TestRunnerProps> = {\n width: undefined,\n height: undefined,\n\n // test lifecycle callback\n onTestStart: (testCase: TestRunnerTestCase) => console.log(`# ${testCase.name}`),\n onTestPass: (testCase: TestRunnerTestCase, result?: unknown) =>\n console.log(`ok ${testCase.name} passed`),\n onTestFail: (testCase: TestRunnerTestCase, error?: unknown) =>\n console.log(`not ok ${testCase.name} failed`),\n\n // milliseconds to wait for each test case before aborting\n timeout: 2000,\n maxFramesToRender: undefined,\n imageDiffOptions: undefined\n};\n\n/** Runs an array of test cases */\nexport class TestRunner {\n device = webglDevice;\n props: Record<string, any>;\n isRunning: boolean = false;\n testOptions: Required<TestRunnerProps> = {...DEFAULT_TEST_PROPS};\n readonly _animationProps?: AnimationProps;\n private _animationLoop: AnimationLoop | null;\n private _testCases: TestRunnerTestCase[] = [];\n private _testCaseData: any = null;\n private _currentTestCase: TestRunnerTestCase | null;\n private _currentTestCaseStartTime: number;\n private _currentTestCaseStartTick: number;\n\n // should be defined in snapshot-test-runner\n isDiffing: boolean = false;\n\n // @ts-expect-error\n isHeadless: boolean = Boolean(window.browserTestDriver_isHeadless);\n\n /**\n * props\n * AnimationLoop props\n */\n constructor(props: Record<string, any> = {}) {\n this.props = props;\n }\n\n /**\n * Add testCase(s)\n */\n add(testCases: TestRunnerTestCase[]): this {\n if (!Array.isArray(testCases)) {\n testCases = [testCases];\n }\n for (const testCase of testCases) {\n this._testCases.push(testCase);\n }\n return this;\n }\n\n /**\n * Returns a promise that resolves when all the test cases are done\n */\n async run(options: object = {}): Promise<void> {\n this.testOptions = {...this.testOptions, ...options};\n\n const device = await getWebGLTestDevice();\n\n return new Promise<void>((resolve, reject) => {\n this._animationLoop = new AnimationLoop({\n ...this.props,\n device: this.device,\n onRender: this._onRender.bind(this),\n onFinalize: () => {\n this.isRunning = false;\n resolve();\n }\n });\n this._animationLoop.start(this.props);\n\n this.isRunning = true;\n this.isDiffing = false;\n this._currentTestCase = null;\n }).catch(error => {\n this._fail({error: error.message});\n // reject(error);\n });\n }\n\n /* Lifecycle methods for subclassing */\n\n initTestCase(testCase: TestRunnerTestCase) {\n const {animationLoop} = testCase;\n if (animationLoop) {\n testCase.onInitialize = animationLoop.props.onInitialize.bind(animationLoop);\n testCase.onRender = animationLoop.props.onRender.bind(animationLoop);\n testCase.onFinalize = animationLoop.props.onFinalize.bind(animationLoop);\n }\n for (const key in DEFAULT_TEST_CASE) {\n testCase[key] = testCase[key] || DEFAULT_TEST_CASE[key];\n }\n }\n\n shouldRender(animationProps): boolean {\n return true;\n }\n\n assert(testCase: TestRunnerTestCase): void {\n this._pass(testCase);\n this._next();\n }\n\n /* Utilities */\n\n _pass(result: unknown): void {\n this.testOptions.onTestPass(this._currentTestCase, result);\n // this._animationLoop?.stop();\n }\n\n _fail(result: unknown): void {\n this.testOptions.onTestFail(this._currentTestCase, result);\n // this._animationLoop?.stop();\n }\n\n _next(): void {\n this._nextTestCase();\n }\n\n /* Private methods */\n\n _onRender(animationProps): void {\n this._animationProps = animationProps;\n\n const testCase = this._currentTestCase || this._nextTestCase();\n if (!testCase) {\n // all test cases are done\n this._animationLoop.stop();\n return;\n }\n\n let isDone = false;\n const testCaseAnimationProps: AnimationProps = {\n ...animationProps,\n ...this._testCaseData,\n // tick/time starts from 0 for each test case\n startTime: this._currentTestCaseStartTime,\n time: animationProps.time - this._currentTestCaseStartTime,\n tick: animationProps.tick - this._currentTestCaseStartTick,\n // called by the test case when it is done rendering and ready for capture and diff\n done: () => {\n isDone = true;\n }\n };\n\n if (this._testCaseData && this.shouldRender(testCaseAnimationProps)) {\n // try {\n // test case is initialized, render frame\n testCase.onRender(testCaseAnimationProps);\n // } catch {\n // isDone = true;\n // }\n }\n\n const timeout = testCase.timeout || this.testOptions.timeout;\n if (timeout && testCaseAnimationProps.time > timeout) {\n isDone = true;\n }\n\n if (isDone) {\n this.assert(testCase);\n }\n }\n\n _nextTestCase(): Promise<TestRunnerTestCase> {\n const animationProps = this._animationProps;\n\n // finalize the current test case\n if (this._testCaseData) {\n for (const key in this._testCaseData) {\n const value = this._testCaseData[key];\n if (value && value.delete) {\n value.destroy();\n }\n }\n this._currentTestCase.onFinalize(Object.assign({}, animationProps, this._testCaseData));\n\n // reset WebGL context\n this.device.popState();\n\n this._currentTestCase = null;\n this._testCaseData = null;\n }\n\n // get the next test case\n const testCase = this._testCases.shift();\n if (testCase) {\n // start new test case\n this._currentTestCase = testCase;\n this._currentTestCaseStartTime = animationProps.time;\n this._currentTestCaseStartTick = animationProps.tick;\n this.initTestCase(testCase);\n\n // initialize test case\n\n // save WebGL context\n this.device.pushState();\n\n // aligned with the behavior of AnimationLoop.onInitialized\n // onInitialized could return a plain object or a promise\n const initProps = {\n ...animationProps,\n // tick/time starts from 0 for each test case\n startTime: animationProps.time,\n time: 0,\n tick: 0\n };\n\n // aligned with the behavior of AnimationLoop.onInitialized\n // onInitialized could return a plain object or a promise\n Promise.resolve(testCase.onInitialize(initProps)).then(userData => {\n this._testCaseData = userData || {};\n });\n\n // invoke user callback\n this.testOptions.onTestStart(testCase);\n }\n return testCase;\n }\n}\n", "// Get the bounding box of a DOMElement relative to the page\nexport function getBoundingBoxInPage(domElement: HTMLElement): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const bbox = domElement.getBoundingClientRect();\n return {\n x: window.scrollX + bbox.x,\n y: window.scrollY + bbox.y,\n width: bbox.width,\n height: bbox.height\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {TestRunner, TestRunnerProps, TestRunnerTestCase} from './test-runner';\nimport {getBoundingBoxInPage} from './utils/get-bounding-box';\n\n/** A snapshot test case */\nexport type SnapshotTestRunnerTestCase = TestRunnerTestCase & {\n /** URL to golden image */\n goldenImage: string;\n /** Diff options */\n imageDiffOptions?: {[key: string]: any};\n};\n\nexport type SnapshotTestRunnerProps = TestRunnerProps;\n\nexport class SnapshotTestRunner extends TestRunner {\n // should be defined here but hack access in TestRunner\n // private isDiffing: boolean = false;\n\n constructor(props: SnapshotTestRunnerProps) {\n super(props);\n this.testOptions.imageDiffOptions = {};\n }\n\n override initTestCase(testCase: SnapshotTestRunnerTestCase): void {\n super.initTestCase(testCase);\n if (!testCase.goldenImage) {\n throw new Error(`Test case ${testCase.name} does not have golden image`);\n }\n }\n\n override shouldRender(): boolean {\n // wait for the current diffing to finish\n return !this.isDiffing;\n }\n\n override async assert(testCase: SnapshotTestRunnerTestCase): Promise<void> {\n if (this.isDiffing) {\n // Already performing diffing\n return;\n }\n this.isDiffing = true;\n\n const canvas = this._animationProps?.canvas;\n if (!(canvas instanceof HTMLCanvasElement)) {\n throw new Error('canvas');\n }\n\n const diffOptions = {\n ...this.testOptions.imageDiffOptions,\n ...testCase.imageDiffOptions,\n goldenImage: testCase.goldenImage,\n region: getBoundingBoxInPage(canvas)\n };\n\n // Take screenshot and compare\n const result = await globalThis.browserTestDriver_captureAndDiffScreen(diffOptions);\n\n // invoke user callback\n if (result.success) {\n this._pass(result);\n } else {\n this._fail(result);\n }\n\n this.isDiffing = false;\n this._next();\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Stats, Stat} from '@probe.gl/stats';\nimport {TestRunner, TestRunnerProps, TestRunnerTestCase} from './test-runner';\n\nexport type PerformanceTestRunnerProps = TestRunnerProps;\n\nexport class PerformanceTestRunner extends TestRunner {\n private _stats: Stats | null = null;\n private _fps: Stat | null = null;\n\n constructor(props: PerformanceTestRunnerProps) {\n super(props);\n\n Object.assign(this.testOptions, {\n maxFramesToRender: 60,\n targetFPS: 50\n });\n }\n\n override initTestCase(testCase: TestRunnerTestCase): void {\n super.initTestCase(testCase);\n this._stats = new Stats({id: testCase.name});\n this._fps = this._stats.get('fps');\n }\n\n override shouldRender(animationProps: Record<string, any>): boolean {\n this._fps?.timeEnd();\n this._fps?.timeStart();\n\n if (this._fps.count > this.testOptions.maxFramesToRender) {\n animationProps.done();\n }\n\n return true;\n }\n\n override assert(testCase: TestRunnerTestCase): void {\n // @ts-expect-error\n const targetFPS = testCase.targetFPS || this.testOptions.targetFPS;\n const count = this._fps?.count;\n const fps = this._fps?.getHz() || 0;\n\n if (fps >= targetFPS) {\n this._pass({fps, framesRendered: count});\n } else {\n this._fail({fps, framesRendered: count});\n }\n this._next();\n }\n}\n", "/**\n * Tests that an argument matches the type.\n * @note fails during typescript type check, not during runtime.\n */\nexport function checkType<T>(value: T): void {}\n", "/** Recursively copies objects */\nexport function deepCopy(object: Record<string, any>) {\n if (Array.isArray(object)) {\n return object.map(element => deepCopy(element));\n }\n\n if (object !== null && typeof object === 'object') {\n const newObject = {};\n for (const key in object) {\n newObject[key] = deepCopy(object[key]);\n }\n return newObject;\n }\n\n return object;\n}\n", "/* global luma */\nexport function getResourceCounts() {\n // @ts-ignore\n const resourceStats = luma.stats.get('Resource Counts');\n return {\n Texture2D: resourceStats.get('Texture2Ds Active').count,\n Buffer: resourceStats.get('Buffers Active').count\n };\n}\n\nexport function getLeakedResources(\n startCounts: Record<string, number>,\n endCounts: Record<string, number>\n): number | null {\n let leakedResources = null;\n const info = 'leaking: ';\n for (const resourceName in endCounts) {\n const leakCount = endCounts[resourceName] - startCounts[resourceName];\n if (leakCount !== 0) {\n leakedResources = Object.assign({}, leakedResources, {\n [resourceName]: leakCount,\n info: `${info} ${resourceName}: ${leakCount}, `\n });\n }\n }\n return leakedResources;\n}\n", "// luma.gl\n// SPDX-License\n// Copyright (c) vis.gl contributors\n\nimport type {CanvasContextProps} from '@luma.gl/core';\nimport {WebGLDevice} from '@luma.gl/webgl';\n\nconst DEFAULT_CANVAS_CONTEXT_PROPS: CanvasContextProps = {\n width: 1,\n height: 1\n};\n\n/**\n * Create a test WebGLDevice\n * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized\n * @deprecated Use getWebGLTestDevice().\n */\nexport function createTestDevice(): WebGLDevice | null {\n try {\n // TODO - We do not use luma.createDevice since createTestDevice currently expect WebGL context to be created synchronously\n return new WebGLDevice({createCanvasContext: DEFAULT_CANVAS_CONTEXT_PROPS});\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Failed to created device: ${(error as Error).message}`);\n debugger; // eslint-disable-line no-debugger\n return null;\n }\n}\n\n/**\n * A pre-created WebGLDevice\n * @note This WebGL Device is create synchronously and can be used directly but will not have WebGL debugging initialized\n * @deprecated Use getWebGLTestDevice().\n */\nexport const webglDevice = createTestDevice();\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;qBAAAA;;AAAA;;;ACCA,IAAAC,gBAAwB;AACxB,mBAAyC;AACzC,oBAA0C;;;ACH1C,IAAAC,gBAAmC;;;ACsBnC,IAAAC,gBAAqC;;;ACpB9B,IAAM,iBAAiB;EAC5B,MAAM;EACN,KAAK;EACL,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,UAAU;EACV,SAAS;EACT,iBAAiB;EACjB,wBAAwB;;;;ACX1B,kBAA2B;AAErB,IAAO,mBAAP,cAAgC,yBAAY;EAChD,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,wBAAwB;EACxB,gBAAgB;EAChB,4CAA4C;EAC5C,4CAA4C;EAC5C,mCAAmC;EACnC,4BAA4B;EAC5B,kCAAkC;EAClC,mCAAmC;EACnC,kCAAkC;EAClC,8BAA8B;EAC9B,8BAA8B;EAC9B,kCAAkC;EAClC,kCAAkC;EAClC,mBAAmB;EACnB,sBAAsB;EACtB,6BAA6B;EAC7B,gCAAgC;EAChC,iCAAiC;EACjC,oCAAoC;EACpC,2BAA2B;EAC3B,2BAA2B;EAC3B,2BAA2B;EAC3B,mCAAmC;;;;AC3BrC,IAAAC,eAA4B;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;;;ACdM,SAAU,oBAAiB;AAE/B,QAAM,gBAAgB,KAAK,MAAM,IAAI,iBAAiB;AACtD,SAAO;IACL,WAAW,cAAc,IAAI,mBAAmB,EAAE;IAClD,QAAQ,cAAc,IAAI,gBAAgB,EAAE;;AAEhD;AAEM,SAAU,mBACd,aACA,WAAiC;AAEjC,MAAI,kBAAkB;AACtB,QAAM,OAAO;AACb,aAAW,gBAAgB,WAAW;AACpC,UAAM,YAAY,UAAU,YAAY,IAAI,YAAY,YAAY;AACpE,QAAI,cAAc,GAAG;AACnB,wBAAkB,OAAO,OAAO,CAAA,GAAI,iBAAiB;QACnD,CAAC,YAAY,GAAG;QAChB,MAAM,GAAG,QAAQ,iBAAiB;OACnC;IACH;EACF;AACA,SAAO;AACT;;;ACrBA,IAAAC,gBAA0B;AAE1B,IAAMC,gCAAmD;EACvD,OAAO;EACP,QAAQ;;AAQJ,SAAU,mBAAgB;AAC9B,MAAI;AAEF,WAAO,IAAI,0BAAY,EAAC,qBAAqBA,8BAA4B,CAAC;EAC5E,SAAS,OAAP;AAEA,YAAQ,MAAM,6BAA8B,MAAgB,SAAS;AACrE;AACA,WAAO;EACT;AACF;AAOO,IAAMC,eAAc,iBAAgB;",
6
+ "names": ["webglDevice", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "import_core", "webglDevice", "import_core", "import_webgl", "import_webgl", "DEFAULT_CANVAS_CONTEXT_PROPS", "webglDevice"]
7
7
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import "./register-devices.js";
2
1
  export type { TestRunnerTestCase } from "./test-runner.js";
3
2
  export type { SnapshotTestRunnerTestCase } from "./snapshot-test-runner.js";
4
3
  export { SnapshotTestRunner } from "./snapshot-test-runner.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA4B;AAG5B,YAAY,EAAC,kBAAkB,EAAC,yBAAsB;AACtD,YAAY,EAAC,0BAA0B,EAAC,kCAA+B;AAEvE,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAGhE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,gCAA6B;AAG9B,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,sCAAmC;AACpE,OAAO,EAAC,UAAU,EAAC,qCAAkC;AAGrD,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAC7C,OAAO,EAAC,QAAQ,EAAC,6BAA0B;AAC3C,OAAO,EAAC,iBAAiB,EAAE,kBAAkB,EAAC,oCAAiC;AAG/E,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,yCAAsC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAC,kBAAkB,EAAC,yBAAsB;AACtD,YAAY,EAAC,0BAA0B,EAAC,kCAA+B;AAEvE,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAGhE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,gCAA6B;AAG9B,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,sCAAmC;AACpE,OAAO,EAAC,UAAU,EAAC,qCAAkC;AAGrD,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAC7C,OAAO,EAAC,QAAQ,EAAC,6BAA0B;AAC3C,OAAO,EAAC,iBAAiB,EAAE,kBAAkB,EAAC,oCAAiC;AAG/E,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,yCAAsC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./register-devices.js";
2
1
  export { SnapshotTestRunner } from "./snapshot-test-runner.js";
3
2
  export { PerformanceTestRunner } from "./performance-test-runner.js";
4
3
  // TEST DEVICES
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+BAA4B;AAM5B,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAEhE,eAAe;AACf,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,gCAA6B;AAE9B,cAAc;AACd,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,sCAAmC;AACpE,OAAO,EAAC,UAAU,EAAC,qCAAkC;AAErD,QAAQ;AACR,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAC7C,OAAO,EAAC,QAAQ,EAAC,6BAA0B;AAC3C,OAAO,EAAC,iBAAiB,EAAE,kBAAkB,EAAC,oCAAiC;AAE/E,aAAa;AACb,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,yCAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,qBAAqB,EAAC,qCAAkC;AAEhE,eAAe;AACf,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,gCAA6B;AAE9B,cAAc;AACd,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,sCAAmC;AACpE,OAAO,EAAC,UAAU,EAAC,qCAAkC;AAErD,QAAQ;AACR,OAAO,EAAC,SAAS,EAAC,8BAA2B;AAC7C,OAAO,EAAC,QAAQ,EAAC,6BAA0B;AAC3C,OAAO,EAAC,iBAAiB,EAAE,kBAAkB,EAAC,oCAAiC;AAE/E,aAAa;AACb,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,yCAAsC"}
@@ -1 +1 @@
1
- {"version":3,"file":"null-render-pass.d.ts","sourceRoot":"","sources":["../../../src/null-device/resources/null-render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,0BAAuB;AAE1C,qBAAa,cAAe,SAAQ,UAAU;IAC5C,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe;IAKtD,GAAG,IAAI,IAAI;IAEX,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa,IAAI,IAAI;IACrB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAE5C,aAAa,CAAC,UAAU,GAAE,oBAAyB,GAAG,IAAI;IAE1D,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAC7C,iBAAiB,IAAI,IAAI;CAC1B"}
1
+ {"version":3,"file":"null-render-pass.d.ts","sourceRoot":"","sources":["../../../src/null-device/resources/null-render-pass.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAChF,OAAO,EAAC,UAAU,EAAC,0BAAuB;AAE1C,qBAAa,cAAe,SAAQ,UAAU;IAC5C,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;gBAEhB,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe;IAKtD,GAAG,IAAI,IAAI;IAEF,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa,IAAI,IAAI;IACrB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAErD,aAAa,CAAC,UAAU,GAAE,oBAAyB,GAAG,IAAI;IAE1D,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAC7C,iBAAiB,IAAI,IAAI;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"null-render-pass.js","sourceRoot":"","sources":["../../../src/null-device/resources/null-render-pass.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,EAAwC,MAAM,eAAe,CAAC;AAGhF,MAAM,OAAO,cAAe,SAAQ,UAAU;IACnC,MAAM,CAAa;IAE5B,YAAY,MAAkB,EAAE,KAAsB;QACpD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,GAAG,KAAU,CAAC;IAEd,cAAc,CAAC,UAAkB,IAAS,CAAC;IAC3C,aAAa,KAAU,CAAC;IACxB,iBAAiB,CAAC,WAAmB,IAAS,CAAC;IAE/C,aAAa,CAAC,aAAmC,EAAE,IAAS,CAAC;IAE7D,mBAAmB,CAAC,UAAkB,IAAS,CAAC;IAChD,iBAAiB,KAAU,CAAC;CAC7B"}
1
+ {"version":3,"file":"null-render-pass.js","sourceRoot":"","sources":["../../../src/null-device/resources/null-render-pass.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,UAAU,EAAwC,MAAM,eAAe,CAAC;AAGhF,MAAM,OAAO,cAAe,SAAQ,UAAU;IACnC,MAAM,CAAa;IAE5B,YAAY,MAAkB,EAAE,KAAsB;QACpD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,GAAG,KAAU,CAAC;IAEL,cAAc,CAAC,UAAkB,IAAS,CAAC;IAC3C,aAAa,KAAU,CAAC;IACxB,iBAAiB,CAAC,WAAmB,IAAS,CAAC;IAExD,aAAa,CAAC,aAAmC,EAAE,IAAS,CAAC;IAE7D,mBAAmB,CAAC,UAAkB,IAAS,CAAC;IAChD,iBAAiB,KAAU,CAAC;CAC7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/test-utils",
3
- "version": "9.1.0-beta.5",
3
+ "version": "9.1.0-beta.7",
4
4
  "description": "Automated WebGL testing utilities with Puppeteer and image diffing",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,5 +46,5 @@
46
46
  "@probe.gl/env": "^4.0.8",
47
47
  "@probe.gl/stats": "^4.0.8"
48
48
  },
49
- "gitHead": "d5c2ee1e8da9ec65d14330bb2535141c43df5636"
49
+ "gitHead": "3aa0005cb47cdf4108672949efce15e36c1079ed"
50
50
  }
package/src/index.ts CHANGED
@@ -1,5 +1,3 @@
1
- import './register-devices';
2
-
3
1
  // TEST RUNNERS
4
2
  export type {TestRunnerTestCase} from './test-runner';
5
3
  export type {SnapshotTestRunnerTestCase} from './snapshot-test-runner';
@@ -15,9 +15,9 @@ export class NullRenderPass extends RenderPass {
15
15
 
16
16
  end(): void {}
17
17
 
18
- pushDebugGroup(groupLabel: string): void {}
19
- popDebugGroup(): void {}
20
- insertDebugMarker(markerLabel: string): void {}
18
+ override pushDebugGroup(groupLabel: string): void {}
19
+ override popDebugGroup(): void {}
20
+ override insertDebugMarker(markerLabel: string): void {}
21
21
 
22
22
  setParameters(parameters: RenderPassParameters = {}): void {}
23
23
 
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=register-devices.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register-devices.d.ts","sourceRoot":"","sources":["../src/register-devices.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- // luma.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- import { luma } from '@luma.gl/core';
5
- import { webgl2Adapter } from '@luma.gl/webgl';
6
- import { webgpuAdapter } from '@luma.gl/webgpu';
7
- luma.registerAdapters([webgl2Adapter, webgpuAdapter]);
8
- //# sourceMappingURL=register-devices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register-devices.js","sourceRoot":"","sources":["../src/register-devices.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,IAAI,CAAC,gBAAgB,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- // luma.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
-
5
- import {luma} from '@luma.gl/core';
6
- import {webgl2Adapter} from '@luma.gl/webgl';
7
- import {webgpuAdapter} from '@luma.gl/webgpu';
8
-
9
- luma.registerAdapters([webgl2Adapter, webgpuAdapter]);