start porting dash lines from js

- switches to dash units that are scaled by line width
- adds a lineatlas to store patterns line dashed lines
- adds linesdf shader which renders line fill from the lineatlas

js: 8e83d76af3bd877eb9639c02e296363e2c0186f8
This commit is contained in:
Ansis Brammanis
2015-01-14 20:56:18 -05:00
parent c6ca57045f
commit 2643a0efc7
15 changed files with 365 additions and 9 deletions

View File

@@ -20,6 +20,7 @@
#include <mbgl/style/style_bucket.hpp>
#include <mbgl/util/texture_pool.hpp>
#include <mbgl/geometry/sprite_atlas.hpp>
#include <mbgl/geometry/line_atlas.hpp>
#include <mbgl/storage/file_source.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/util/string.hpp>
@@ -98,8 +99,9 @@ Map::Map(View& view_, FileSource& fileSource_)
glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)),
glyphStore(std::make_shared<GlyphStore>(fileSource)),
spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)),
lineAtlas(util::make_unique<LineAtlas>(512, 512)),
texturePool(std::make_shared<TexturePool>()),
painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas))
painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas))
{
view.initialize(this);
// Make sure that we're doing an initial drawing in all cases.