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

visgl / luma.gl / 16861002932

10 Aug 2025 11:45AM UTC coverage: 51.305% (-22.6%) from 73.868%
16861002932

Pull #2416

github

web-flow
Merge 92c90562d into f90a93cf3
Pull Request #2416: chore: Tests for texture reads

595 of 835 branches covered (71.26%)

Branch coverage included in aggregate %.

66 of 101 new or added lines in 7 files covered. (65.35%)

8541 existing lines in 129 files now uncovered.

18683 of 36740 relevant lines covered (50.85%)

11.74 hits per line

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

16.98
/modules/engine/src/utils/buffer-layout-helper.ts
1
// luma.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import {log, type BufferLayout} from '@luma.gl/core';
1✔
6

1✔
7
/** BufferLayoutHelper is a helper class that should not be used directly by applications */
1✔
8
export class BufferLayoutHelper {
1!
UNCOV
9
  bufferLayouts: BufferLayout[];
×
UNCOV
10

×
UNCOV
11
  constructor(bufferLayouts: BufferLayout[]) {
×
UNCOV
12
    this.bufferLayouts = bufferLayouts;
×
UNCOV
13
  }
×
UNCOV
14

×
UNCOV
15
  getBufferLayout(name: string): BufferLayout | null {
×
UNCOV
16
    return this.bufferLayouts.find(layout => layout.name === name) || null;
×
UNCOV
17
  }
×
UNCOV
18

×
UNCOV
19
  /** Get attribute names from a BufferLayout */
×
UNCOV
20
  getAttributeNamesForBuffer(bufferLayout: BufferLayout): string[] {
×
UNCOV
21
    return bufferLayout.attributes
×
22
      ? bufferLayout.attributes?.map(layout => layout.attribute)
×
UNCOV
23
      : [bufferLayout.name];
×
UNCOV
24
  }
×
UNCOV
25

×
UNCOV
26
  mergeBufferLayouts(
×
UNCOV
27
    bufferLayouts1: BufferLayout[],
×
UNCOV
28
    bufferLayouts2: BufferLayout[]
×
UNCOV
29
  ): BufferLayout[] {
×
UNCOV
30
    const mergedLayouts = [...bufferLayouts1];
×
UNCOV
31
    for (const attribute of bufferLayouts2) {
×
32
      const index = mergedLayouts.findIndex(attribute2 => attribute2.name === attribute.name);
×
33
      if (index < 0) {
×
34
        mergedLayouts.push(attribute);
×
35
      } else {
×
36
        mergedLayouts[index] = attribute;
×
37
      }
×
38
    }
×
UNCOV
39
    return mergedLayouts;
×
UNCOV
40
  }
×
UNCOV
41

×
UNCOV
42
  getBufferIndex(bufferName: string): number {
×
43
    const bufferIndex = this.bufferLayouts.findIndex(layout => layout.name === bufferName);
×
44

×
45
    if (bufferIndex === -1) {
×
46
      log.warn(`BufferLayout: Missing buffer for "${bufferName}".`)();
×
47
    }
×
48

×
49
    return bufferIndex;
×
50
  }
×
UNCOV
51
}
×
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