diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-08 13:58:46 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-13 10:18:43 -0700 |
commit | 3270440f234570f1426c442898c2400e36608ebf (patch) | |
tree | dfc2330d74187a2503b244e632592cd984c0d84f /src/mbgl/renderer/painters/painter_symbol.cpp | |
parent | f610e9bef969dc8d7ec1ea545e93919a03d98882 (diff) | |
download | qtlocation-mapboxgl-3270440f234570f1426c442898c2400e36608ebf.tar.gz |
[core] Per-tile glyph/icon atlases
Diffstat (limited to 'src/mbgl/renderer/painters/painter_symbol.cpp')
-rw-r--r-- | src/mbgl/renderer/painters/painter_symbol.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mbgl/renderer/painters/painter_symbol.cpp b/src/mbgl/renderer/painters/painter_symbol.cpp index 13baa1a514..58700fc4e8 100644 --- a/src/mbgl/renderer/painters/painter_symbol.cpp +++ b/src/mbgl/renderer/painters/painter_symbol.cpp @@ -9,7 +9,7 @@ #include <mbgl/programs/symbol_program.hpp> #include <mbgl/programs/collision_box_program.hpp> #include <mbgl/util/math.hpp> -#include <mbgl/tile/tile.hpp> +#include <mbgl/tile/geometry_tile.hpp> #include <cmath> @@ -62,6 +62,9 @@ void Painter::renderSymbol(PaintParameters& parameters, ); }; + assert(dynamic_cast<GeometryTile*>(&tile.tile)); + GeometryTile& geometryTile = static_cast<GeometryTile&>(tile.tile); + if (bucket.hasIconData()) { auto values = layer.iconPropertyValues(layout); auto paintPropertyValues = layer.iconPaintProperties(); @@ -69,11 +72,11 @@ void Painter::renderSymbol(PaintParameters& parameters, const bool iconScaled = layout.get<IconSize>().constantOr(1.0) != 1.0 || bucket.iconsNeedLinear; const bool iconTransformed = values.rotationAlignment == AlignmentType::Map || state.getPitch() != 0; - context.bindTexture(*bucket.icon.atlasTexture, 0, + context.bindTexture(*geometryTile.iconAtlasTexture, 0, bucket.sdfIcons || state.isChanging() || iconScaled || iconTransformed ? gl::TextureFilter::Linear : gl::TextureFilter::Nearest); - const Size texsize = bucket.icon.atlasTexture->size; + const Size texsize = geometryTile.iconAtlasTexture->size; if (bucket.sdfIcons) { if (values.hasHalo) { @@ -107,12 +110,12 @@ void Painter::renderSymbol(PaintParameters& parameters, } if (bucket.hasTextData()) { - context.bindTexture(*bucket.text.atlasTexture, 0, gl::TextureFilter::Linear); + context.bindTexture(*geometryTile.glyphAtlasTexture, 0, gl::TextureFilter::Linear); auto values = layer.textPropertyValues(layout); auto paintPropertyValues = layer.textPaintProperties(); - const Size texsize = bucket.text.atlasTexture->size; + const Size texsize = geometryTile.glyphAtlasTexture->size; if (values.hasHalo) { draw(parameters.programs.symbolGlyph, |