Skip to content

Commit

Permalink
Use explicit 'symbol_text_and_icon' shader name instead of 'symbol'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshalamov committed Nov 15, 2019
1 parent 61c7310 commit a89e072
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/render/draw_symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {evaluateVariableOffset} from '../symbol/symbol_layout';
import {
symbolIconUniformValues,
symbolSDFUniformValues,
symbolUniformValues
symbolTextAndIconUniformValues
} from './program/symbol_program';

import type Painter from './painter';
Expand Down Expand Up @@ -213,7 +213,7 @@ function updateVariableAnchorsForBucket(bucket, rotateWithMap, pitchWithMap, var

function getSymbolProgramName(isSDF: boolean, isText: boolean, bucket: SymbolBucket) {
if (bucket.iconsInText && isText) {
return 'symbol';
return 'symbolTextAndIcon';
} else if (isSDF) {
return 'symbolSDF';
} else {
Expand Down Expand Up @@ -314,7 +314,7 @@ function drawLayerSymbols(painter, sourceCache, layer, coords, isText, translate
size, rotateInShader, pitchWithMap, painter, matrix,
uLabelPlaneMatrix, uglCoordMatrix, isText, texSize, true);
} else {
uniformValues = symbolUniformValues(sizeData.kind,
uniformValues = symbolTextAndIconUniformValues(sizeData.kind,
size, rotateInShader, pitchWithMap, painter, matrix,
uLabelPlaneMatrix, uglCoordMatrix, texSize, texSizeIcon);
}
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 @@ -10,7 +10,7 @@ import {heatmapUniforms, heatmapTextureUniforms} from './heatmap_program';
import {hillshadeUniforms, hillshadePrepareUniforms} from './hillshade_program';
import {lineUniforms, lineGradientUniforms, linePatternUniforms, lineSDFUniforms} from './line_program';
import {rasterUniforms} from './raster_program';
import {symbolIconUniforms, symbolSDFUniforms, symbolUniforms} from './symbol_program';
import {symbolIconUniforms, symbolSDFUniforms, symbolTextAndIconUniforms} from './symbol_program';
import {backgroundUniforms, backgroundPatternUniforms} from './background_program';

export const programUniforms = {
Expand All @@ -36,7 +36,7 @@ export const programUniforms = {
raster: rasterUniforms,
symbolIcon: symbolIconUniforms,
symbolSDF: symbolSDFUniforms,
symbol: symbolUniforms,
symbolTextAndIcon: symbolTextAndIconUniforms,
background: backgroundUniforms,
backgroundPattern: backgroundPatternUniforms
};
8 changes: 4 additions & 4 deletions src/render/program/symbol_program.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type SymbolSDFUniformsType = {|
'u_is_halo': Uniform1f
|};

export type SymbolUniformsType = {|
export type symbolTextAndIconUniformsType = {|
'u_is_size_zoom_constant': Uniform1i,
'u_is_size_feature_constant': Uniform1i,
'u_size_t': Uniform1f,
Expand Down Expand Up @@ -118,7 +118,7 @@ const symbolSDFUniforms = (context: Context, locations: UniformLocations): Symbo
'u_is_halo': new Uniform1f(context, locations.u_is_halo)
});

const symbolUniforms = (context: Context, locations: UniformLocations): SymbolUniformsType => ({
const symbolTextAndIconUniforms = (context: Context, locations: UniformLocations): symbolTextAndIconUniformsType => ({
'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),
'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),
'u_size_t': new Uniform1f(context, locations.u_size_t),
Expand Down Expand Up @@ -199,7 +199,7 @@ const symbolSDFUniformValues = (
});
};

const symbolUniformValues = (
const symbolTextAndIconUniformValues = (
functionType: string,
size: ?{uSizeT: number, uSize: number},
rotateInShader: boolean,
Expand All @@ -221,4 +221,4 @@ const symbolUniformValues = (
return uniforms;
};

export {symbolIconUniforms, symbolSDFUniforms, symbolIconUniformValues, symbolSDFUniformValues, symbolUniformValues, symbolUniforms};
export {symbolIconUniforms, symbolSDFUniforms, symbolIconUniformValues, symbolSDFUniformValues, symbolTextAndIconUniformValues, symbolTextAndIconUniforms};
6 changes: 3 additions & 3 deletions src/shaders/shaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import symbolIconFrag from './symbol_icon.fragment.glsl';
import symbolIconVert from './symbol_icon.vertex.glsl';
import symbolSDFFrag from './symbol_sdf.fragment.glsl';
import symbolSDFVert from './symbol_sdf.vertex.glsl';
import symbolFrag from './symbol.fragment.glsl';
import symbolVert from './symbol.vertex.glsl';
import symbolTextAndIconFrag from './symbol_text_and_icon.fragment.glsl';
import symbolTextAndIconVert from './symbol_text_and_icon.vertex.glsl';

export const prelude = compile(preludeFrag, preludeVert);
export const background = compile(backgroundFrag, backgroundVert);
Expand All @@ -80,7 +80,7 @@ export const lineSDF = compile(lineSDFFrag, lineSDFVert);
export const raster = compile(rasterFrag, rasterVert);
export const symbolIcon = compile(symbolIconFrag, symbolIconVert);
export const symbolSDF = compile(symbolSDFFrag, symbolSDFVert);
export const symbol = compile(symbolFrag, symbolVert);
export const symbolTextAndIcon = compile(symbolTextAndIconFrag, symbolTextAndIconVert);

// Expand #pragmas to #ifdefs.

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a89e072

Please sign in to comment.