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

uber / deck.gl / 13340

10 Sep 2019 - 3:13 coverage decreased (-2.6%) to 80.892%
13340

Pull #3552

travis-ci-com

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
[#3548 - Part 4] Modify setup.py to specify that README is markdown
Pull Request #3552: [#3548 - Part 4] Update notebook documentation to include additional pydeck features

3330 of 4491 branches covered (74.15%)

Branch coverage included in aggregate %.

6860 of 8106 relevant lines covered (84.63%)

5923.39 hits per line

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

83.33
/modules/core/src/passes/pick-layers-pass.js
1
import LayersPass from './layers-pass';
8×
2
import {withParameters} from '@luma.gl/core';
3

4
export default class PickLayersPass extends LayersPass {
5
  render(props) {
6
    if (props.pickingFBO) {
Branches [[0, 1]] missed. 6×
7
      this.drawPickingBuffer(props);
6×
8
    } else {
UNCOV
9
      super.render(props);
!
10
    }
11
  }
12

13
  // Private
14
  // Draws list of layers and viewports into the picking buffer
15
  // Note: does not sample the buffer, that has to be done by the caller
16
  drawPickingBuffer({
17
    layers,
18
    viewports,
19
    onViewportActive,
20
    pickingFBO,
21
    effectProps,
22
    deviceRect: {x, y, width, height},
23
    redrawReason = ''
24
  }) {
25
    const gl = this.gl;
6×
26
    // Make sure we clear scissor test and fbo bindings in case of exceptions
27
    // We are only interested in one pixel, no need to render anything else
28
    // Note that the callback here is called synchronously.
29
    // Set blend mode for picking
30
    // always overwrite existing pixel with [r,g,b,layerIndex]
31
    return withParameters(
6×
32
      gl,
33
      {
34
        framebuffer: pickingFBO,
35
        scissorTest: true,
36
        scissor: [x, y, width, height],
37
        clearColor: [0, 0, 0, 0]
38
      },
39
      () => {
40
        this.drawLayers({
6×
41
          layers,
42
          viewports,
43
          onViewportActive,
44
          pass: 'picking',
45
          redrawReason,
46
          effectProps,
47
          parameters: {
48
            blend: true,
49
            blendFunc: [gl.ONE, gl.ZERO, gl.CONSTANT_ALPHA, gl.ZERO],
50
            blendEquation: gl.FUNC_ADD,
51
            blendColor: [0, 0, 0, 0],
52

53
            // When used as Mapbox custom layer, the context state may be dirty
54
            // TODO - Remove when mapbox fixes this issue
55
            // https://github.com/mapbox/mapbox-gl-js/issues/7801
56
            depthMask: true,
57
            depthTest: true,
58
            depthRange: [0, 1],
59
            colorMask: [true, true, true, true]
60
          }
61
        });
62
      }
63
    );
64
  }
65

66
  // PRIVATE
67
  shouldDrawLayer(layer, viewport) {
68
    const layerFilter = this.props.layerFilter;
8×
69
    let shouldDrawLayer = !layer.isComposite && layer.props.visible && layer.props.pickable;
8×
70

71
    if (shouldDrawLayer && layerFilter) {
Branches [[3, 0]] missed. 8×
UNCOV
72
      shouldDrawLayer = layerFilter({layer, viewport, isPicking: true});
!
73
    }
74
    return shouldDrawLayer;
8×
75
  }
76

77
  getModuleParameters(layer, effects, effectProps) {
78
    const moduleParameters = Object.assign(Object.create(layer.props), {
7×
79
      viewport: layer.context.viewport,
80
      pickingActive: 1,
81
      devicePixelRatio: this.props.pixelRatio
82
    });
83

84
    Object.assign(moduleParameters, effectProps);
7×
85
    return moduleParameters;
7×
86
  }
87

88
  getLayerParameters(layer, layerIndex, glViewport, parameters) {
89
    // All parameter resolving is done here instead of the layer
90
    // Blend parameters must not be overridden
91
    const layerParameters = Object.assign({}, layer.props.parameters || {}, parameters);
Branches [[5, 1]] missed. 7×
92

93
    Object.assign(layerParameters, {
7×
94
      viewport: glViewport,
95
      blendColor: [0, 0, 0, (layerIndex + 1) / 255]
96
    });
97

98
    return layerParameters;
7×
99
  }
100
}
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