Skip to content

Commit

Permalink
Fix type usage
Browse files Browse the repository at this point in the history
  • Loading branch information
endanke committed Jul 27, 2021
1 parent c2ee6d1 commit 3a90a46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/render/draw_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type SourceCache from '../source/source_cache.js';
import type LineStyleLayer from '../style/style_layer/line_style_layer.js';
import type LineBucket from '../data/bucket/line_bucket.js';
import type {OverscaledTileID} from '../source/tile_id.js';
import type {DynamicDefinesType} from './program/program_uniforms.js';
import {clamp, nextPowerOfTwo} from '../util/util.js';
import {renderColorRamp} from '../util/color_ramp.js';
import EXTENT from '../data/extent.js';
Expand Down
6 changes: 4 additions & 2 deletions src/render/program/line_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export type LinePatternUniformsType = {|
'u_fade': Uniform1f
|};

export type LineDefinesType = 'RENDER_LINE_GRADIENT' | 'RENDER_LINE_DASH';

const lineUniforms = (context: Context, locations: UniformLocations): LineUniformsType => ({
'u_matrix': new UniformMatrix4f(context, locations.u_matrix),
'u_ratio': new Uniform1f(context, locations.u_ratio),
Expand Down Expand Up @@ -86,8 +88,8 @@ const lineUniformValues = (
'u_dash_image': 0,
'u_gradient_image': 1,
'u_image_height': imageHeight,
'u_texsize': 0,
'u_scale': [],
'u_texsize': [0, 0],
'u_scale': [0, 0, 0],
'u_mix': 0
};
if (layer.paint.get('line-dasharray').value.value) {
Expand Down
4 changes: 2 additions & 2 deletions src/render/program/program_uniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type {CircleDefinesType} from './circle_program.js';
import type {SymbolDefinesType} from './symbol_program.js';
import type {LineDefineTypes} from './line_program.js';
import type {LineDefinesType} from './line_program.js';
import {fillExtrusionUniforms, fillExtrusionPatternUniforms} from './fill_extrusion_program.js';
import {fillUniforms, fillPatternUniforms, fillOutlineUniforms, fillOutlinePatternUniforms} from './fill_program.js';
import {circleUniforms} from './circle_program.js';
Expand All @@ -19,7 +19,7 @@ import {terrainRasterUniforms} from '../../terrain/terrain_raster_program.js';
import {skyboxUniforms, skyboxGradientUniforms} from './skybox_program.js';
import {skyboxCaptureUniforms} from './skybox_capture_program.js';

export type DynamicDefinesType = CircleDefinesType | SymbolDefinesType | LineDefineTypes;
export type DynamicDefinesType = CircleDefinesType | SymbolDefinesType | LineDefinesType;

export const programUniforms = {
fillExtrusion: fillExtrusionUniforms,
Expand Down

0 comments on commit 3a90a46

Please sign in to comment.