• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 23412316304

22 Mar 2026 08:56PM UTC coverage: 73.59% (-0.6%) from 74.227%
23412316304

push

github

web-flow
feat(engine): add async texture buffer read (#2439)

4597 of 7074 branches covered (64.98%)

Branch coverage included in aggregate %.

111 of 213 new or added lines in 20 files covered. (52.11%)

40 existing lines in 8 files now uncovered.

10525 of 13475 relevant lines covered (78.11%)

263.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.17
/modules/test-utils/src/null-device/resources/null-texture.ts
1
// luma.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
import {
6
  type TextureProps,
7
  type TextureViewProps,
8
  type CopyExternalImageOptions,
9
  type CopyImageDataOptions,
10
  type TextureReadOptions,
11
  type TextureWriteOptions,
12
  type Sampler,
13
  type SamplerProps,
14
  Buffer,
15
  Texture
16
} from '@luma.gl/core';
17
import {NullDevice} from '../null-device';
18
import {NullSampler} from './null-sampler';
19
import {NullTextureView} from './null-texture-view';
20

21
export class NullTexture extends Texture {
22
  readonly device: NullDevice;
23
  readonly handle = null;
47✔
24

25
  sampler: NullSampler;
26
  view: NullTextureView;
27

28
  constructor(device: NullDevice, props: TextureProps) {
29
    super(device, props);
47✔
30

31
    this.device = device;
47✔
32

33
    // const data = props.data;
34
    // this.setImageData(props);
35

36
    if (props.sampler) {
47✔
37
      this.setSampler(props.sampler);
42✔
38
    }
39

40
    this.sampler = new NullSampler(this.device, this.props.sampler);
47✔
41

42
    this.view = new NullTextureView(this.device, {
47✔
43
      ...props,
44
      texture: this,
45
      mipLevelCount: 1,
46
      arrayLayerCount: 1
47
    });
48

49
    this.trackAllocatedMemory(this.getAllocatedByteLength(), 'Texture');
47✔
50

51
    Object.seal(this);
47✔
52
  }
53

54
  override destroy(): void {
55
    if (!this.destroyed) {
45!
56
      super.destroy();
45✔
57
      this.trackDeallocatedMemory('Texture');
45✔
58
    }
59
  }
60

61
  createView(props: TextureViewProps): NullTextureView {
62
    return new NullTextureView(this.device, {...props, texture: this});
×
63
  }
64

65
  copyExternalImage(options: CopyExternalImageOptions): {width: number; height: number} {
66
    return {width: this.width, height: this.height};
×
67
  }
68

69
  override setSampler(sampler?: Sampler | SamplerProps): void {
70
    // ignore
71
  }
72

73
  override copyImageData(options: CopyImageDataOptions): void {
74
    super.copyImageData(options);
×
75
  }
76

77
  override readBuffer(_options: TextureReadOptions = {}, buffer?: Buffer): Buffer {
×
NEW
78
    if (!buffer) {
×
NEW
79
      throw new Error('buffer required');
×
80
    }
NEW
81
    return buffer;
×
82
  }
83

84
  override async readDataAsync(_options: TextureReadOptions = {}): Promise<ArrayBuffer> {
×
NEW
85
    throw new Error(
×
86
      `${this} readDataAsync is deprecated; use readBuffer() with an explicit destination buffer or DynamicTexture.readAsync()`
87
    );
88
  }
89

90
  override writeBuffer(buffer: Buffer, options: TextureWriteOptions = {}) {
×
91
    // ignore
92
  }
93

94
  override writeData(
95
    data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView,
96
    options: TextureWriteOptions = {}
14✔
97
  ): void {
98
    // ignore
99
  }
100
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc