Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

uber / deck.gl / 13030

26 Aug 2019 - 19:27 coverage decreased (-2.6%) to 80.38%
13030

Pull #3490

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
integrate mapbox's near plane fix
Pull Request #3490: [MapboxLayer] integrate mapbox-gl's near plane fix

3369 of 4577 branches covered (73.61%)

Branch coverage included in aggregate %.

6877 of 8170 relevant lines covered (84.17%)

4644.76 hits per line

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

28.57
/modules/aggregation-layers/src/heatmap-layer/triangle-layer.js
1
// Copyright (c) 2015 - 2019 Uber Technologies, Inc.
9×
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
import GL from '@luma.gl/constants';
22
import {Model, Geometry} from '@luma.gl/core';
23
import {Layer} from '@deck.gl/core';
24
import vs from './triangle-layer-vertex.glsl';
25
import fs from './triangle-layer-fragment.glsl';
26

27
const defaultProps = {
1×
28
  count: 0, // number of triangles to be rendered
29
  texture: null
30
};
31

32
export default class TriangleLayer extends Layer {
33
  getShaders() {
UNCOV
34
    return {vs, fs, modules: ['project32']};
!
35
  }
36

37
  initializeState() {
UNCOV
38
    const {gl} = this.context;
!
UNCOV
39
    const attributeManager = this.getAttributeManager();
!
UNCOV
40
    attributeManager.add({
!
41
      positions: {size: 3, noAlloc: true},
42
      texCoords: {size: 2, noAlloc: true}
43
    });
UNCOV
44
    this.setState({
!
45
      model: this._getModel(gl)
46
    });
47
  }
48

49
  _getModel(gl) {
UNCOV
50
    const {vertexCount} = this.props;
!
51

UNCOV
52
    return new Model(
!
53
      gl,
54
      Object.assign({}, this.getShaders(), {
55
        id: this.props.id,
56
        geometry: new Geometry({
57
          drawMode: GL.TRIANGLE_FAN,
58
          vertexCount
59
        }),
60
        shaderCache: this.context.shaderCache
61
      })
62
    );
63
  }
64

65
  draw({uniforms}) {
UNCOV
66
    const {model} = this.state;
!
UNCOV
67
    const {texture, maxTexture, colorTexture, intensity, threshold} = this.props;
!
UNCOV
68
    model.setUniforms({texture, maxTexture, colorTexture, intensity, threshold}).draw();
!
69
  }
70
}
71

72
TriangleLayer.layerName = 'TriangleLayer';
1×
73
TriangleLayer.defaultProps = defaultProps;
1×
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2019 Coveralls, LLC