[core] Use linear filtering for icons in text for zoom dependent text-size

This commit is contained in:
Alexander Shalamov
2019-11-18 15:34:16 +02:00
parent 26bf566f53
commit 33ba4052b6

View File

@@ -198,13 +198,6 @@ void drawText(const DrawFn& draw,
const gfx::TextureBinding glyphTextureBinding{tile.getGlyphAtlasTexture().getResource(),
gfx::TextureFilterType::Linear};
const bool transformed = values.rotationAlignment == AlignmentType::Map || parameters.state.getPitch() != 0;
const Size& iconTexSize = tile.getIconAtlasTexture().size;
const gfx::TextureBinding iconTextureBinding{tile.getIconAtlasTexture().getResource(),
parameters.state.isChanging() || transformed
? gfx::TextureFilterType::Linear
: gfx::TextureFilterType::Nearest};
const auto drawGlyphs = [&](auto& program, const auto& uniforms, const auto& textures, SymbolSDFPart part) {
draw(program,
uniforms,
@@ -218,6 +211,15 @@ void drawText(const DrawFn& draw,
};
if (bucket.iconsInText) {
const ZoomEvaluatedSize partiallyEvaluatedTextSize =
bucket.textSizeBinder->evaluateForZoom(parameters.state.getZoom());
const bool transformed = values.rotationAlignment == AlignmentType::Map || parameters.state.getPitch() != 0;
const Size& iconTexSize = tile.getIconAtlasTexture().size;
const gfx::TextureBinding iconTextureBinding{
tile.getIconAtlasTexture().getResource(),
parameters.state.isChanging() || transformed || !partiallyEvaluatedTextSize.isZoomConstant
? gfx::TextureFilterType::Linear
: gfx::TextureFilterType::Nearest};
if (values.hasHalo) {
drawGlyphs(parameters.programs.getSymbolLayerPrograms().symbolTextAndIcon,
SymbolTextAndIconProgram::layoutUniformValues(bucket.hasVariablePlacement,