@mapwhit/tilerenderer 0.52.1 → 1.1.0
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/README.md +7 -0
- package/build/min/package.json +2 -1
- package/build/min/src/shaders/_prelude.fragment.glsl.js +2 -2
- package/build/min/src/shaders/_prelude.vertex.glsl.js +2 -2
- package/build/min/src/shaders/background.fragment.glsl.js +2 -2
- package/build/min/src/shaders/background.vertex.glsl.js +1 -1
- package/build/min/src/shaders/background_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/background_pattern.vertex.glsl.js +1 -1
- package/build/min/src/shaders/circle.fragment.glsl.js +2 -2
- package/build/min/src/shaders/circle.vertex.glsl.js +2 -2
- package/build/min/src/shaders/clipping_mask.fragment.glsl.js +1 -1
- package/build/min/src/shaders/clipping_mask.vertex.glsl.js +1 -1
- package/build/min/src/shaders/collision_box.fragment.glsl.js +1 -1
- package/build/min/src/shaders/collision_box.vertex.glsl.js +1 -1
- package/build/min/src/shaders/collision_circle.fragment.glsl.js +1 -1
- package/build/min/src/shaders/collision_circle.vertex.glsl.js +1 -1
- package/build/min/src/shaders/debug.fragment.glsl.js +1 -1
- package/build/min/src/shaders/debug.vertex.glsl.js +1 -1
- package/build/min/src/shaders/fill.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/heatmap.fragment.glsl.js +2 -2
- package/build/min/src/shaders/heatmap.vertex.glsl.js +2 -2
- package/build/min/src/shaders/heatmap_texture.fragment.glsl.js +2 -2
- package/build/min/src/shaders/heatmap_texture.vertex.glsl.js +1 -1
- package/build/min/src/shaders/hillshade.fragment.glsl.js +2 -2
- package/build/min/src/shaders/hillshade.vertex.glsl.js +1 -1
- package/build/min/src/shaders/hillshade_prepare.fragment.glsl.js +2 -2
- package/build/min/src/shaders/hillshade_prepare.vertex.glsl.js +1 -1
- package/build/min/src/shaders/line.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_gradient.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_gradient.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_sdf.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_sdf.vertex.glsl.js +2 -2
- package/build/min/src/shaders/raster.fragment.glsl.js +2 -2
- package/build/min/src/shaders/raster.vertex.glsl.js +1 -1
- package/build/min/src/shaders/symbol_icon.fragment.glsl.js +2 -2
- package/build/min/src/shaders/symbol_icon.vertex.glsl.js +2 -2
- package/build/min/src/shaders/symbol_sdf.fragment.glsl.js +2 -2
- package/build/min/src/shaders/symbol_sdf.vertex.glsl.js +2 -2
- package/package.json +5 -4
- package/src/data/array_types.js +55 -117
- package/src/data/bucket/circle_attributes.js +2 -4
- package/src/data/bucket/circle_bucket.js +19 -16
- package/src/data/bucket/fill_attributes.js +2 -4
- package/src/data/bucket/fill_bucket.js +38 -27
- package/src/data/bucket/fill_extrusion_attributes.js +2 -4
- package/src/data/bucket/fill_extrusion_bucket.js +56 -37
- package/src/data/bucket/heatmap_bucket.js +2 -11
- package/src/data/bucket/line_attributes.js +2 -4
- package/src/data/bucket/line_bucket.js +208 -163
- package/src/data/bucket/pattern_attributes.js +2 -4
- package/src/data/bucket/pattern_bucket_features.js +7 -9
- package/src/data/bucket/symbol_attributes.js +12 -26
- package/src/data/bucket/symbol_bucket.js +174 -323
- package/src/data/bucket/symbol_buffers.js +62 -0
- package/src/data/bucket/symbol_collision_buffers.js +33 -0
- package/src/data/bucket.js +26 -25
- package/src/data/dem_data.js +11 -10
- package/src/data/extent.js +1 -1
- package/src/data/feature_index.js +38 -28
- package/src/data/index_array_type.js +1 -6
- package/src/data/load_geometry.js +6 -9
- package/src/data/pos_attributes.js +2 -3
- package/src/data/program_configuration.js +47 -38
- package/src/data/raster_bounds_attributes.js +2 -2
- package/src/data/segment.js +4 -7
- package/src/geo/coordinate.js +1 -1
- package/src/geo/lng_lat.js +3 -3
- package/src/geo/lng_lat_bounds.js +8 -4
- package/src/geo/transform.js +69 -30
- package/src/gl/color_mode.js +2 -2
- package/src/gl/context.js +28 -29
- package/src/gl/cull_face_mode.js +1 -1
- package/src/gl/depth_mode.js +1 -1
- package/src/gl/framebuffer.js +8 -4
- package/src/gl/index_buffer.js +2 -2
- package/src/gl/stencil_mode.js +1 -1
- package/src/gl/value.js +33 -68
- package/src/gl/vertex_buffer.js +2 -2
- package/src/index.js +49 -25
- package/src/render/draw_background.js +17 -12
- package/src/render/draw_circle.js +15 -12
- package/src/render/draw_collision_debug.js +11 -8
- package/src/render/draw_debug.js +16 -14
- package/src/render/draw_fill.js +27 -20
- package/src/render/draw_fill_extrusion.js +20 -17
- package/src/render/draw_heatmap.js +21 -16
- package/src/render/draw_hillshade.js +12 -9
- package/src/render/draw_line.js +36 -22
- package/src/render/draw_raster.js +22 -18
- package/src/render/draw_symbol.js +38 -33
- package/src/render/glyph_atlas.js +9 -8
- package/src/render/glyph_manager.js +2 -3
- package/src/render/image_atlas.js +4 -11
- package/src/render/image_manager.js +39 -28
- package/src/render/line_atlas.js +2 -2
- package/src/render/painter.js +78 -61
- package/src/render/program/background_program.js +6 -13
- package/src/render/program/circle_program.js +8 -10
- package/src/render/program/clipping_mask_program.js +3 -5
- package/src/render/program/collision_program.js +4 -6
- package/src/render/program/debug_program.js +3 -5
- package/src/render/program/fill_extrusion_program.js +9 -15
- package/src/render/program/fill_program.js +10 -21
- package/src/render/program/heatmap_program.js +9 -15
- package/src/render/program/hillshade_program.js +16 -22
- package/src/render/program/line_program.js +14 -25
- package/src/render/program/pattern.js +5 -7
- package/src/render/program/program_uniforms.js +13 -20
- package/src/render/program/raster_program.js +9 -11
- package/src/render/program/symbol_program.js +5 -7
- package/src/render/program.js +5 -6
- package/src/render/texture.js +1 -1
- package/src/render/tile_mask.js +6 -4
- package/src/render/uniform_binding.js +9 -20
- package/src/render/vertex_array_object.js +5 -3
- package/src/shaders/encode_attribute.js +2 -6
- package/src/shaders/index.js +103 -51
- package/src/source/geojson_source.js +25 -30
- package/src/source/geojson_worker_source.js +46 -74
- package/src/source/geojson_wrapper.js +13 -5
- package/src/source/image_source.js +17 -28
- package/src/source/load_tilejson.js +3 -3
- package/src/source/pixels_to_tile_units.js +3 -3
- package/src/source/query_features.js +17 -15
- package/src/source/raster_dem_tile_source.js +54 -71
- package/src/source/raster_tile_source.js +14 -15
- package/src/source/resources/glyphs.js +4 -5
- package/src/source/resources/index.js +4 -12
- package/src/source/rtl_text_plugin.js +62 -35
- package/src/source/source.js +14 -22
- package/src/source/source_cache.js +221 -179
- package/src/source/source_state.js +125 -13
- package/src/source/tile.js +67 -66
- package/src/source/tile_bounds.js +36 -29
- package/src/source/tile_cache.js +2 -2
- package/src/source/tile_id.js +30 -26
- package/src/source/vector_tile_source.js +23 -21
- package/src/source/vector_tile_worker_source.js +22 -26
- package/src/source/worker_tile.js +139 -134
- package/src/style/create_style_layer.js +11 -11
- package/src/style/evaluation_parameters.js +4 -6
- package/src/style/light.js +5 -5
- package/src/style/load_sprite.js +6 -6
- package/src/style/parse_glyph_pbf.js +21 -17
- package/src/style/pauseable_placement.js +7 -9
- package/src/style/properties.js +21 -51
- package/src/style/query_utils.js +7 -13
- package/src/style/style.js +314 -221
- package/src/style/style_layer/background_style_layer.js +3 -4
- package/src/style/style_layer/background_style_layer_properties.js +2 -2
- package/src/style/style_layer/circle_style_layer.js +25 -20
- package/src/style/style_layer/circle_style_layer_properties.js +2 -2
- package/src/style/style_layer/fill_extrusion_style_layer.js +55 -37
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +2 -2
- package/src/style/style_layer/fill_style_layer.js +11 -12
- package/src/style/style_layer/fill_style_layer_properties.js +2 -2
- package/src/style/style_layer/heatmap_style_layer.js +6 -7
- package/src/style/style_layer/heatmap_style_layer_properties.js +2 -2
- package/src/style/style_layer/hillshade_style_layer.js +4 -5
- package/src/style/style_layer/hillshade_style_layer_properties.js +2 -2
- package/src/style/style_layer/line_style_layer.js +33 -30
- package/src/style/style_layer/line_style_layer_properties.js +5 -5
- package/src/style/style_layer/raster_style_layer.js +3 -4
- package/src/style/style_layer/raster_style_layer_properties.js +2 -2
- package/src/style/style_layer/symbol_style_layer.js +20 -21
- package/src/style/style_layer/symbol_style_layer_properties.js +2 -2
- package/src/style/style_layer.js +66 -47
- package/src/style/style_layer_index.js +17 -42
- package/src/style/zoom_history.js +1 -1
- package/src/style-spec/error/parsing_error.js +1 -1
- package/src/style-spec/error/validation_error.js +5 -3
- package/src/style-spec/feature_filter/convert.js +17 -9
- package/src/style-spec/feature_filter/index.js +13 -9
- package/src/style-spec/util/eval_support.js +2 -2
- package/src/style-spec/util/ref_properties.js +1 -1
- package/src/symbol/anchor.js +2 -6
- package/src/symbol/check_max_angle.js +13 -5
- package/src/symbol/clip_line.js +2 -3
- package/src/symbol/collision_feature.js +8 -4
- package/src/symbol/collision_index.js +5 -7
- package/src/symbol/cross_tile_symbol_index.js +7 -10
- package/src/symbol/get_anchors.js +15 -8
- package/src/symbol/grid_index.js +5 -3
- package/src/symbol/mergelines.js +2 -2
- package/src/symbol/opacity_state.js +1 -5
- package/src/symbol/placement.js +28 -23
- package/src/symbol/projection.js +29 -28
- package/src/symbol/quads.js +14 -16
- package/src/symbol/shaping.js +27 -19
- package/src/symbol/symbol_layout.js +24 -28
- package/src/symbol/symbol_size.js +13 -12
- package/src/symbol/transform_text.js +4 -4
- package/src/ui/camera.js +34 -18
- package/src/ui/map.js +102 -44
- package/src/util/async.js +11 -5
- package/src/util/browser.js +1 -1
- package/src/util/callback.js +3 -9
- package/src/util/classify_rings.js +13 -8
- package/src/util/color_ramp.js +3 -3
- package/src/util/config.js +4 -4
- package/src/util/dictionary_coder.js +2 -3
- package/src/util/dom.js +7 -3
- package/src/util/find_pole_of_inaccessibility.js +29 -14
- package/src/util/group_layers.js +41 -0
- package/src/util/image.js +3 -13
- package/src/util/interpolate.js +1 -1
- package/src/util/intersection_tests.js +80 -42
- package/src/util/is_char_in_unicode_block.js +1 -1
- package/src/util/key.js +25 -0
- package/src/util/loader/image.js +1 -1
- package/src/util/object.js +33 -76
- package/src/util/script_detection.js +212 -91
- package/src/util/struct_array.js +8 -40
- package/src/util/task_queue.js +11 -7
- package/src/util/throttle.js +2 -2
- package/src/util/tile_cover.js +8 -5
- package/src/util/token.js +1 -1
- package/src/util/unique_id.js +2 -2
- package/src/util/util.js +21 -29
- package/src/util/vectortile_to_geojson.js +4 -2
- package/src/util/verticalize_punctuation.js +3 -7
- package/src/util/warn.js +4 -4
- package/src/util/web_worker.js +3 -3
- package/src/worker.js +1 -4
- package/src/source/resources/images.js +0 -68
- package/src/source/worker.js +0 -110
- package/src/source/worker_source.js +0 -14
- package/src/style-spec/deref.js +0 -51
- package/src/style-spec/group_by_layout.js +0 -46
- package/src/util/actor.js +0 -108
- package/src/util/dispatcher.js +0 -65
- package/src/util/global_worker_pool.js +0 -15
- package/src/util/transfer_registry.js +0 -168
- package/src/util/web_worker_transfer.js +0 -43
- package/src/util/worker_pool.js +0 -41
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const assert = require('assert');
|
|
1
|
+
import assert from 'assert';
|
|
2
|
+
import potpack from 'potpack';
|
|
3
|
+
import { RGBAImage } from '../util/image.js';
|
|
4
|
+
import { ImagePosition } from './image_atlas.js';
|
|
5
|
+
import Texture from './texture.js';
|
|
7
6
|
|
|
8
7
|
// When copied into the atlas texture, image data is padded by one pixel on each side. Icon
|
|
9
8
|
// images are padded with fully transparent pixels, while pattern images are padded with a
|
|
@@ -21,12 +20,13 @@ const padding = 1;
|
|
|
21
20
|
data-driven support for `*-pattern`, we'll likely use per-bucket pattern atlases, and that would be a good time
|
|
22
21
|
to refactor this.
|
|
23
22
|
*/
|
|
24
|
-
class ImageManager {
|
|
23
|
+
export default class ImageManager {
|
|
25
24
|
#loadedState = Promise.withResolvers();
|
|
25
|
+
#imageQueue = new Map();
|
|
26
26
|
constructor() {
|
|
27
|
-
this.images =
|
|
27
|
+
this.images = new Map();
|
|
28
28
|
|
|
29
|
-
this.patterns =
|
|
29
|
+
this.patterns = new Map();
|
|
30
30
|
this.atlasImage = new RGBAImage({ width: 1, height: 1 });
|
|
31
31
|
this.dirty = true;
|
|
32
32
|
}
|
|
@@ -44,22 +44,31 @@ class ImageManager {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
getImage(id) {
|
|
47
|
-
return this.images
|
|
47
|
+
return this.images.get(id);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
addImage(id, image) {
|
|
51
|
-
assert(!this.images
|
|
52
|
-
|
|
51
|
+
assert(!(this.images.has(id) || this.#imageQueue.has(id)));
|
|
52
|
+
if (image.promise) {
|
|
53
|
+
this.#imageQueue.set(id, image.promise);
|
|
54
|
+
image.promise.then(image => {
|
|
55
|
+
this.#imageQueue.delete(id);
|
|
56
|
+
this.images.set(id, image);
|
|
57
|
+
});
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.images.set(id, image);
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
removeImage(id) {
|
|
56
|
-
assert(this.images
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
assert(this.images.has(id) || this.#imageQueue.has(id));
|
|
65
|
+
this.images.delete(id);
|
|
66
|
+
this.#imageQueue.delete(id);
|
|
67
|
+
this.patterns.delete(id);
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
listImages() {
|
|
62
|
-
return
|
|
71
|
+
return Array.from(this.images.keys());
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
async getImages(ids) {
|
|
@@ -67,11 +76,16 @@ class ImageManager {
|
|
|
67
76
|
|
|
68
77
|
const response = {};
|
|
69
78
|
for (const id of ids) {
|
|
70
|
-
|
|
79
|
+
let image = this.images.get(id);
|
|
80
|
+
if (!image) {
|
|
81
|
+
if (!this.#imageQueue.has(id)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
image = await this.#imageQueue.get(id);
|
|
85
|
+
}
|
|
71
86
|
if (image) {
|
|
72
|
-
// Clone the image so that our own copy of its ArrayBuffer doesn't get transferred.
|
|
73
87
|
response[id] = {
|
|
74
|
-
data: image.data
|
|
88
|
+
data: image.data,
|
|
75
89
|
pixelRatio: image.pixelRatio,
|
|
76
90
|
sdf: image.sdf
|
|
77
91
|
};
|
|
@@ -88,7 +102,7 @@ class ImageManager {
|
|
|
88
102
|
}
|
|
89
103
|
|
|
90
104
|
getPattern(id) {
|
|
91
|
-
const pattern = this.patterns
|
|
105
|
+
const pattern = this.patterns.get(id);
|
|
92
106
|
if (pattern) {
|
|
93
107
|
return pattern.position;
|
|
94
108
|
}
|
|
@@ -102,7 +116,7 @@ class ImageManager {
|
|
|
102
116
|
const h = image.data.height + padding * 2;
|
|
103
117
|
const bin = { w, h, x: 0, y: 0 };
|
|
104
118
|
const position = new ImagePosition(bin, image);
|
|
105
|
-
this.patterns
|
|
119
|
+
this.patterns.set(id, { bin, position });
|
|
106
120
|
this._updatePatternAtlas();
|
|
107
121
|
|
|
108
122
|
return position;
|
|
@@ -122,8 +136,8 @@ class ImageManager {
|
|
|
122
136
|
|
|
123
137
|
_updatePatternAtlas() {
|
|
124
138
|
const bins = [];
|
|
125
|
-
for (const
|
|
126
|
-
bins.push(
|
|
139
|
+
for (const { bin } of this.patterns.values()) {
|
|
140
|
+
bins.push(bin);
|
|
127
141
|
}
|
|
128
142
|
|
|
129
143
|
const { w, h } = potpack(bins);
|
|
@@ -131,11 +145,10 @@ class ImageManager {
|
|
|
131
145
|
const dst = this.atlasImage;
|
|
132
146
|
dst.resize({ width: w ?? 1, height: h ?? 1 });
|
|
133
147
|
|
|
134
|
-
for (const id
|
|
135
|
-
const { bin } = this.patterns[id];
|
|
148
|
+
for (const [id, { bin }] of this.patterns) {
|
|
136
149
|
const x = bin.x + padding;
|
|
137
150
|
const y = bin.y + padding;
|
|
138
|
-
const src = this.images
|
|
151
|
+
const src = this.images.get(id).data;
|
|
139
152
|
const w = src.width;
|
|
140
153
|
const h = src.height;
|
|
141
154
|
|
|
@@ -151,5 +164,3 @@ class ImageManager {
|
|
|
151
164
|
this.dirty = true;
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
|
-
|
|
155
|
-
module.exports = ImageManager;
|
package/src/render/line_atlas.js
CHANGED
package/src/render/painter.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import glMatrix from '@mapbox/gl-matrix';
|
|
2
|
+
import { Color } from '@mapwhit/style-expressions';
|
|
3
|
+
import { LineStripIndexArray, PosArray, RasterBoundsArray, TriangleIndexArray } from '../data/array_types.js';
|
|
4
|
+
import EXTENT from '../data/extent.js';
|
|
5
|
+
import posAttributes from '../data/pos_attributes.js';
|
|
6
|
+
import ProgramConfiguration from '../data/program_configuration.js';
|
|
7
|
+
import rasterBoundsAttributes from '../data/raster_bounds_attributes.js';
|
|
8
|
+
import SegmentVector from '../data/segment.js';
|
|
9
|
+
import ColorMode from '../gl/color_mode.js';
|
|
10
|
+
import Context from '../gl/context.js';
|
|
11
|
+
import CullFaceMode from '../gl/cull_face_mode.js';
|
|
12
|
+
import DepthMode from '../gl/depth_mode.js';
|
|
13
|
+
import StencilMode from '../gl/stencil_mode.js';
|
|
14
|
+
import shaders from '../shaders/index.js';
|
|
15
|
+
import pixelsToTileUnits from '../source/pixels_to_tile_units.js';
|
|
16
|
+
import SourceCache from '../source/source_cache.js';
|
|
17
|
+
import CrossTileSymbolIndex from '../symbol/cross_tile_symbol_index.js';
|
|
18
|
+
import browser from '../util/browser.js';
|
|
19
|
+
import background from './draw_background.js';
|
|
20
|
+
import circle from './draw_circle.js';
|
|
21
|
+
import debug from './draw_debug.js';
|
|
22
|
+
import fill from './draw_fill.js';
|
|
23
|
+
import fillExtrusion from './draw_fill_extrusion.js';
|
|
24
|
+
import heatmap from './draw_heatmap.js';
|
|
25
|
+
import hillshade from './draw_hillshade.js';
|
|
26
|
+
import line from './draw_line.js';
|
|
27
|
+
import raster from './draw_raster.js';
|
|
28
|
+
import symbol from './draw_symbol.js';
|
|
29
|
+
import { clippingMaskUniformValues } from './program/clipping_mask_program.js';
|
|
30
|
+
import { programUniforms } from './program/program_uniforms.js';
|
|
31
|
+
import Program from './program.js';
|
|
32
|
+
import updateTileMasks from './tile_mask.js';
|
|
33
|
+
|
|
34
|
+
const { mat4 } = glMatrix;
|
|
35
35
|
const draw = {
|
|
36
36
|
symbol,
|
|
37
37
|
circle,
|
|
@@ -51,7 +51,7 @@ const draw = {
|
|
|
51
51
|
* @param {Canvas} gl an experimental-webgl drawing context
|
|
52
52
|
* @private
|
|
53
53
|
*/
|
|
54
|
-
class Painter {
|
|
54
|
+
export default class Painter {
|
|
55
55
|
constructor(gl, transform) {
|
|
56
56
|
this.context = new Context(gl);
|
|
57
57
|
this.transform = transform;
|
|
@@ -83,8 +83,8 @@ class Painter {
|
|
|
83
83
|
this.context.viewport.set([0, 0, this.width, this.height]);
|
|
84
84
|
|
|
85
85
|
if (this.style) {
|
|
86
|
-
for (const
|
|
87
|
-
|
|
86
|
+
for (const layer of this.style._layers.values()) {
|
|
87
|
+
layer.resize();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -182,7 +182,9 @@ class Painter {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
_renderTileClippingMasks(layer, tileIDs) {
|
|
185
|
-
if (this.currentStencilSource === layer.source || !layer.isTileClipped() || !tileIDs || !tileIDs.length)
|
|
185
|
+
if (this.currentStencilSource === layer.source || !layer.isTileClipped() || !tileIDs || !tileIDs.length) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
186
188
|
|
|
187
189
|
this.currentStencilSource = layer.source;
|
|
188
190
|
|
|
@@ -258,7 +260,9 @@ class Painter {
|
|
|
258
260
|
}
|
|
259
261
|
|
|
260
262
|
depthModeForSublayer(n, mask, func) {
|
|
261
|
-
if (!this.opaquePassEnabledForLayer())
|
|
263
|
+
if (!this.opaquePassEnabledForLayer()) {
|
|
264
|
+
return DepthMode.disabled;
|
|
265
|
+
}
|
|
262
266
|
const depth = 1 - ((1 + this.currentLayer) * this.numSublayers + n) * this.depthEpsilon;
|
|
263
267
|
return new DepthMode(func || this.context.gl.LEQUAL, mask, [depth, depth]);
|
|
264
268
|
}
|
|
@@ -284,8 +288,7 @@ class Painter {
|
|
|
284
288
|
|
|
285
289
|
this.symbolFadeChange = style.placement.symbolFadeChange(browser.now());
|
|
286
290
|
|
|
287
|
-
const
|
|
288
|
-
const sourceCaches = this.style.sourceCaches;
|
|
291
|
+
const sourceCaches = style._sources;
|
|
289
292
|
|
|
290
293
|
for (const id in sourceCaches) {
|
|
291
294
|
const sourceCache = sourceCaches[id];
|
|
@@ -308,16 +311,21 @@ class Painter {
|
|
|
308
311
|
for (const id in sourceCaches) {
|
|
309
312
|
const sourceCache = sourceCaches[id];
|
|
310
313
|
const source = sourceCache.getSource();
|
|
311
|
-
if (source.type !== 'raster' && source.type !== 'raster-dem')
|
|
314
|
+
if (source.type !== 'raster' && source.type !== 'raster-dem') {
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
312
317
|
const visibleTiles = [];
|
|
313
|
-
for (const coord of coordsAscending[id])
|
|
318
|
+
for (const coord of coordsAscending[id]) {
|
|
319
|
+
visibleTiles.push(sourceCache.getTile(coord));
|
|
320
|
+
}
|
|
314
321
|
updateTileMasks(visibleTiles, this.context);
|
|
315
322
|
}
|
|
316
323
|
|
|
324
|
+
const layers = Array.from(style._layers.values());
|
|
325
|
+
|
|
317
326
|
this.opaquePassCutoff = Number.POSITIVE_INFINITY;
|
|
318
|
-
for (let i = 0; i <
|
|
319
|
-
|
|
320
|
-
if (this.style._layers[layerId].is3D()) {
|
|
327
|
+
for (let i = 0; i < layers.length; i++) {
|
|
328
|
+
if (layers[i].is3D()) {
|
|
321
329
|
this.opaquePassCutoff = i;
|
|
322
330
|
break;
|
|
323
331
|
}
|
|
@@ -330,12 +338,15 @@ class Painter {
|
|
|
330
338
|
this.renderPass = 'offscreen';
|
|
331
339
|
this.depthRboNeedsClear = true;
|
|
332
340
|
|
|
333
|
-
for (const
|
|
334
|
-
|
|
335
|
-
|
|
341
|
+
for (const layer of layers) {
|
|
342
|
+
if (!layer.hasOffscreenPass() || layer.isHidden(this.transform.zoom)) {
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
336
345
|
|
|
337
346
|
const coords = coordsDescending[layer.source];
|
|
338
|
-
if (!coords.length)
|
|
347
|
+
if (!coords.length) {
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
339
350
|
|
|
340
351
|
this.renderLayer(this, sourceCaches[layer.source], layer, coords);
|
|
341
352
|
}
|
|
@@ -349,14 +360,14 @@ class Painter {
|
|
|
349
360
|
this.clearStencil();
|
|
350
361
|
|
|
351
362
|
this._showOverdrawInspector = options.showOverdrawInspector;
|
|
352
|
-
this.depthRangeFor3D = [0, 1 - (style.
|
|
363
|
+
this.depthRangeFor3D = [0, 1 - (style._layers.size + 2) * this.numSublayers * this.depthEpsilon];
|
|
353
364
|
|
|
354
365
|
// Opaque pass ===============================================
|
|
355
366
|
// Draw opaque layers top-to-bottom first.
|
|
356
367
|
this.renderPass = 'opaque';
|
|
357
368
|
|
|
358
|
-
for (this.currentLayer =
|
|
359
|
-
const layer =
|
|
369
|
+
for (this.currentLayer = layers.length - 1; this.currentLayer >= 0; this.currentLayer--) {
|
|
370
|
+
const layer = layers[this.currentLayer];
|
|
360
371
|
const sourceCache = sourceCaches[layer.source];
|
|
361
372
|
const coords = coordsAscending[layer.source];
|
|
362
373
|
|
|
@@ -368,8 +379,8 @@ class Painter {
|
|
|
368
379
|
// Draw all other layers bottom-to-top.
|
|
369
380
|
this.renderPass = 'translucent';
|
|
370
381
|
|
|
371
|
-
for (this.currentLayer = 0; this.currentLayer <
|
|
372
|
-
const layer =
|
|
382
|
+
for (this.currentLayer = 0; this.currentLayer < layers.length; this.currentLayer++) {
|
|
383
|
+
const layer = layers[this.currentLayer];
|
|
373
384
|
const sourceCache = sourceCaches[layer.source];
|
|
374
385
|
|
|
375
386
|
// For symbol layers in the translucent pass, we add extra tiles to the renderable set
|
|
@@ -398,8 +409,12 @@ class Painter {
|
|
|
398
409
|
}
|
|
399
410
|
|
|
400
411
|
renderLayer(painter, sourceCache, layer, coords) {
|
|
401
|
-
if (layer.isHidden(this.transform.zoom))
|
|
402
|
-
|
|
412
|
+
if (layer.isHidden(this.transform.zoom)) {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (layer.type !== 'background' && !coords.length) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
403
418
|
this.id = layer.id;
|
|
404
419
|
|
|
405
420
|
draw[layer.type](painter, sourceCache, layer, coords);
|
|
@@ -411,7 +426,9 @@ class Painter {
|
|
|
411
426
|
* @returns {Float32Array} matrix
|
|
412
427
|
*/
|
|
413
428
|
translatePosMatrix(matrix, tile, translate, translateAnchor, inViewportPixelUnitsUnits) {
|
|
414
|
-
if (!translate[0] && !translate[1])
|
|
429
|
+
if (!translate[0] && !translate[1]) {
|
|
430
|
+
return matrix;
|
|
431
|
+
}
|
|
415
432
|
|
|
416
433
|
const angle = inViewportPixelUnitsUnits
|
|
417
434
|
? translateAnchor === 'map'
|
|
@@ -458,7 +475,9 @@ class Painter {
|
|
|
458
475
|
* @returns true if a needed image is missing and rendering needs to be skipped.
|
|
459
476
|
*/
|
|
460
477
|
isPatternMissing(image) {
|
|
461
|
-
if (!image)
|
|
478
|
+
if (!image) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
462
481
|
const imagePosA = this.imageManager.getPattern(image.from);
|
|
463
482
|
const imagePosB = this.imageManager.getPattern(image.to);
|
|
464
483
|
return !imagePosA || !imagePosB;
|
|
@@ -479,5 +498,3 @@ class Painter {
|
|
|
479
498
|
return this.cache[key];
|
|
480
499
|
}
|
|
481
500
|
}
|
|
482
|
-
|
|
483
|
-
module.exports = Painter;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Uniform1f, Uniform1i, Uniform2f, UniformColor, UniformMatrix4f } from '../uniform_binding.js';
|
|
2
|
+
import { bgPatternUniformValues } from './pattern.js';
|
|
3
3
|
|
|
4
|
-
const backgroundUniforms = (context, locations) => ({
|
|
4
|
+
export const backgroundUniforms = (context, locations) => ({
|
|
5
5
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
6
6
|
u_opacity: new Uniform1f(context, locations.u_opacity),
|
|
7
7
|
u_color: new UniformColor(context, locations.u_color)
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
const backgroundPatternUniforms = (context, locations) => ({
|
|
10
|
+
export const backgroundPatternUniforms = (context, locations) => ({
|
|
11
11
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
12
12
|
u_opacity: new Uniform1f(context, locations.u_opacity),
|
|
13
13
|
u_image: new Uniform1i(context, locations.u_image),
|
|
@@ -26,21 +26,14 @@ const backgroundPatternUniforms = (context, locations) => ({
|
|
|
26
26
|
u_tile_units_to_pixels: new Uniform1f(context, locations.u_tile_units_to_pixels)
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const backgroundUniformValues = (matrix, opacity, color) => ({
|
|
29
|
+
export const backgroundUniformValues = (matrix, opacity, color) => ({
|
|
30
30
|
u_matrix: matrix,
|
|
31
31
|
u_opacity: opacity,
|
|
32
32
|
u_color: color
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const backgroundPatternUniformValues = (matrix, opacity, painter, image, tile, crossfade) =>
|
|
35
|
+
export const backgroundPatternUniformValues = (matrix, opacity, painter, image, tile, crossfade) =>
|
|
36
36
|
Object.assign(bgPatternUniformValues(image, crossfade, painter, tile), {
|
|
37
37
|
u_matrix: matrix,
|
|
38
38
|
u_opacity: opacity
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
module.exports = {
|
|
42
|
-
backgroundUniforms,
|
|
43
|
-
backgroundPatternUniforms,
|
|
44
|
-
backgroundUniformValues,
|
|
45
|
-
backgroundPatternUniformValues
|
|
46
|
-
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import pixelsToTileUnits from '../../source/pixels_to_tile_units.js';
|
|
2
|
+
import { Uniform1f, Uniform1i, Uniform2f, UniformMatrix4f } from '../uniform_binding.js';
|
|
3
3
|
|
|
4
|
-
const circleUniforms = (context, locations) => ({
|
|
4
|
+
export const circleUniforms = (context, locations) => ({
|
|
5
5
|
u_camera_to_center_distance: new Uniform1f(context, locations.u_camera_to_center_distance),
|
|
6
6
|
u_scale_with_map: new Uniform1i(context, locations.u_scale_with_map),
|
|
7
7
|
u_pitch_with_map: new Uniform1i(context, locations.u_pitch_with_map),
|
|
@@ -9,12 +9,12 @@ const circleUniforms = (context, locations) => ({
|
|
|
9
9
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix)
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
const circleUniformValues = (painter, coord, tile, layer) => {
|
|
12
|
+
export const circleUniformValues = (painter, coord, tile, layer) => {
|
|
13
13
|
const transform = painter.transform;
|
|
14
14
|
|
|
15
15
|
let pitchWithMap;
|
|
16
16
|
let extrudeScale;
|
|
17
|
-
if (layer.
|
|
17
|
+
if (layer._paint.get('circle-pitch-alignment') === 'map') {
|
|
18
18
|
const pixelRatio = pixelsToTileUnits(tile, 1, transform.zoom);
|
|
19
19
|
pitchWithMap = true;
|
|
20
20
|
extrudeScale = [pixelRatio, pixelRatio];
|
|
@@ -25,16 +25,14 @@ const circleUniformValues = (painter, coord, tile, layer) => {
|
|
|
25
25
|
|
|
26
26
|
return {
|
|
27
27
|
u_camera_to_center_distance: transform.cameraToCenterDistance,
|
|
28
|
-
u_scale_with_map: +(layer.
|
|
28
|
+
u_scale_with_map: +(layer._paint.get('circle-pitch-scale') === 'map'),
|
|
29
29
|
u_matrix: painter.translatePosMatrix(
|
|
30
30
|
coord.posMatrix,
|
|
31
31
|
tile,
|
|
32
|
-
layer.
|
|
33
|
-
layer.
|
|
32
|
+
layer._paint.get('circle-translate'),
|
|
33
|
+
layer._paint.get('circle-translate-anchor')
|
|
34
34
|
),
|
|
35
35
|
u_pitch_with_map: +pitchWithMap,
|
|
36
36
|
u_extrude_scale: extrudeScale
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
module.exports = { circleUniforms, circleUniformValues };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { UniformMatrix4f } from '../uniform_binding.js';
|
|
2
2
|
|
|
3
|
-
const clippingMaskUniforms = (context, locations) => ({
|
|
3
|
+
export const clippingMaskUniforms = (context, locations) => ({
|
|
4
4
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix)
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
const clippingMaskUniformValues = matrix => ({
|
|
7
|
+
export const clippingMaskUniformValues = matrix => ({
|
|
8
8
|
u_matrix: matrix
|
|
9
9
|
});
|
|
10
|
-
|
|
11
|
-
module.exports = { clippingMaskUniforms, clippingMaskUniformValues };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import pixelsToTileUnits from '../../source/pixels_to_tile_units.js';
|
|
2
|
+
import { Uniform1f, Uniform2f, UniformMatrix4f } from '../uniform_binding.js';
|
|
3
3
|
|
|
4
|
-
const collisionUniforms = (context, locations) => ({
|
|
4
|
+
export const collisionUniforms = (context, locations) => ({
|
|
5
5
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
6
6
|
u_camera_to_center_distance: new Uniform1f(context, locations.u_camera_to_center_distance),
|
|
7
7
|
u_pixels_to_tile_units: new Uniform1f(context, locations.u_pixels_to_tile_units),
|
|
@@ -9,7 +9,7 @@ const collisionUniforms = (context, locations) => ({
|
|
|
9
9
|
u_overscale_factor: new Uniform1f(context, locations.u_overscale_factor)
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
const collisionUniformValues = (matrix, transform, tile) => {
|
|
12
|
+
export const collisionUniformValues = (matrix, transform, tile) => {
|
|
13
13
|
const pixelRatio = pixelsToTileUnits(tile, 1, transform.zoom);
|
|
14
14
|
const scale = 2 ** (transform.zoom - tile.tileID.overscaledZ);
|
|
15
15
|
const overscaleFactor = tile.tileID.overscaleFactor();
|
|
@@ -24,5 +24,3 @@ const collisionUniformValues = (matrix, transform, tile) => {
|
|
|
24
24
|
u_overscale_factor: overscaleFactor
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
module.exports = { collisionUniforms, collisionUniformValues };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { UniformColor, UniformMatrix4f } from '../uniform_binding.js';
|
|
2
2
|
|
|
3
|
-
const debugUniforms = (context, locations) => ({
|
|
3
|
+
export const debugUniforms = (context, locations) => ({
|
|
4
4
|
u_color: new UniformColor(context, locations.u_color),
|
|
5
5
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix)
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
const debugUniformValues = (matrix, color) => ({
|
|
8
|
+
export const debugUniformValues = (matrix, color) => ({
|
|
9
9
|
u_matrix: matrix,
|
|
10
10
|
u_color: color
|
|
11
11
|
});
|
|
12
|
-
|
|
13
|
-
module.exports = { debugUniforms, debugUniformValues };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import glMatrix from '@mapbox/gl-matrix';
|
|
2
|
+
import { Uniform1f, Uniform1i, Uniform2f, Uniform3f, Uniform4f, UniformMatrix4f } from '../uniform_binding.js';
|
|
3
|
+
import { patternUniformValues } from './pattern.js';
|
|
3
4
|
|
|
4
|
-
const { mat3, vec3 } =
|
|
5
|
+
const { mat3, vec3 } = glMatrix;
|
|
5
6
|
|
|
6
|
-
const fillExtrusionUniforms = (context, locations) => ({
|
|
7
|
+
export const fillExtrusionUniforms = (context, locations) => ({
|
|
7
8
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
8
9
|
u_lightpos: new Uniform3f(context, locations.u_lightpos),
|
|
9
10
|
u_lightintensity: new Uniform1f(context, locations.u_lightintensity),
|
|
@@ -12,7 +13,7 @@ const fillExtrusionUniforms = (context, locations) => ({
|
|
|
12
13
|
u_opacity: new Uniform1f(context, locations.u_opacity)
|
|
13
14
|
});
|
|
14
15
|
|
|
15
|
-
const fillExtrusionPatternUniforms = (context, locations) => ({
|
|
16
|
+
export const fillExtrusionPatternUniforms = (context, locations) => ({
|
|
16
17
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
17
18
|
u_lightpos: new Uniform3f(context, locations.u_lightpos),
|
|
18
19
|
u_lightintensity: new Uniform1f(context, locations.u_lightintensity),
|
|
@@ -28,8 +29,8 @@ const fillExtrusionPatternUniforms = (context, locations) => ({
|
|
|
28
29
|
u_opacity: new Uniform1f(context, locations.u_opacity)
|
|
29
30
|
});
|
|
30
31
|
|
|
31
|
-
const fillExtrusionUniformValues = (matrix, painter, shouldUseVerticalGradient, opacity) => {
|
|
32
|
-
const light = painter.style.
|
|
32
|
+
export const fillExtrusionUniformValues = (matrix, painter, shouldUseVerticalGradient, opacity) => {
|
|
33
|
+
const light = painter.style._light;
|
|
33
34
|
const _lp = light.properties.get('position');
|
|
34
35
|
const lightPos = [_lp.x, _lp.y, _lp.z];
|
|
35
36
|
const lightMat = mat3.create();
|
|
@@ -50,7 +51,7 @@ const fillExtrusionUniformValues = (matrix, painter, shouldUseVerticalGradient,
|
|
|
50
51
|
};
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
const fillExtrusionPatternUniformValues = (
|
|
54
|
+
export const fillExtrusionPatternUniformValues = (
|
|
54
55
|
matrix,
|
|
55
56
|
painter,
|
|
56
57
|
shouldUseVerticalGradient,
|
|
@@ -67,10 +68,3 @@ const fillExtrusionPatternUniformValues = (
|
|
|
67
68
|
}
|
|
68
69
|
);
|
|
69
70
|
};
|
|
70
|
-
|
|
71
|
-
module.exports = {
|
|
72
|
-
fillExtrusionUniforms,
|
|
73
|
-
fillExtrusionPatternUniforms,
|
|
74
|
-
fillExtrusionUniformValues,
|
|
75
|
-
fillExtrusionPatternUniformValues
|
|
76
|
-
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Uniform1f, Uniform1i, Uniform2f, Uniform4f, UniformMatrix4f } from '../uniform_binding.js';
|
|
2
|
+
import { patternUniformValues } from './pattern.js';
|
|
3
3
|
|
|
4
|
-
const fillUniforms = (context, locations) => ({
|
|
4
|
+
export const fillUniforms = (context, locations) => ({
|
|
5
5
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix)
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
const fillPatternUniforms = (context, locations) => ({
|
|
8
|
+
export const fillPatternUniforms = (context, locations) => ({
|
|
9
9
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
10
10
|
u_image: new Uniform1i(context, locations.u_image),
|
|
11
11
|
u_texsize: new Uniform2f(context, locations.u_texsize),
|
|
@@ -15,12 +15,12 @@ const fillPatternUniforms = (context, locations) => ({
|
|
|
15
15
|
u_fade: new Uniform1f(context, locations.u_fade)
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const fillOutlineUniforms = (context, locations) => ({
|
|
18
|
+
export const fillOutlineUniforms = (context, locations) => ({
|
|
19
19
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
20
20
|
u_world: new Uniform2f(context, locations.u_world)
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const fillOutlinePatternUniforms = (context, locations) => ({
|
|
23
|
+
export const fillOutlinePatternUniforms = (context, locations) => ({
|
|
24
24
|
u_matrix: new UniformMatrix4f(context, locations.u_matrix),
|
|
25
25
|
u_world: new Uniform2f(context, locations.u_world),
|
|
26
26
|
u_image: new Uniform1i(context, locations.u_image),
|
|
@@ -31,30 +31,19 @@ const fillOutlinePatternUniforms = (context, locations) => ({
|
|
|
31
31
|
u_fade: new Uniform1f(context, locations.u_fade)
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
const fillUniformValues = matrix => ({
|
|
34
|
+
export const fillUniformValues = matrix => ({
|
|
35
35
|
u_matrix: matrix
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
const fillPatternUniformValues = (matrix, painter, crossfade, tile) =>
|
|
38
|
+
export const fillPatternUniformValues = (matrix, painter, crossfade, tile) =>
|
|
39
39
|
Object.assign(fillUniformValues(matrix), patternUniformValues(crossfade, painter, tile));
|
|
40
40
|
|
|
41
|
-
const fillOutlineUniformValues = (matrix, drawingBufferSize) => ({
|
|
41
|
+
export const fillOutlineUniformValues = (matrix, drawingBufferSize) => ({
|
|
42
42
|
u_matrix: matrix,
|
|
43
43
|
u_world: drawingBufferSize
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const fillOutlinePatternUniformValues = (matrix, painter, crossfade, tile, drawingBufferSize) =>
|
|
46
|
+
export const fillOutlinePatternUniformValues = (matrix, painter, crossfade, tile, drawingBufferSize) =>
|
|
47
47
|
Object.assign(fillPatternUniformValues(matrix, painter, crossfade, tile), {
|
|
48
48
|
u_world: drawingBufferSize
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
module.exports = {
|
|
52
|
-
fillUniforms,
|
|
53
|
-
fillPatternUniforms,
|
|
54
|
-
fillOutlineUniforms,
|
|
55
|
-
fillOutlinePatternUniforms,
|
|
56
|
-
fillUniformValues,
|
|
57
|
-
fillPatternUniformValues,
|
|
58
|
-
fillOutlineUniformValues,
|
|
59
|
-
fillOutlinePatternUniformValues
|
|
60
|
-
};
|