Merge branch 'master' into linebreak

Conflicts:
	src/map/tile_parser.cpp
	src/text/glyph_store.cpp
This commit is contained in:
Young Hahn
2014-05-30 09:00:29 -04:00
31 changed files with 128 additions and 272 deletions

View File

@@ -12,8 +12,6 @@
namespace llmr {
class VectorTileGlyph;
class GlyphAtlas {
public:

View File

@@ -62,7 +62,7 @@ private:
BinPack<dimension> bin;
std::map<std::string, Rect<dimension>> images;
std::set<std::string> uninitialized;
char *data = nullptr;
uint32_t *data = nullptr;
std::atomic<bool> dirty;
uint32_t texture = 0;
uint32_t filter = 0;

View File

@@ -42,7 +42,6 @@ private:
GlyphAtlas& glyphAtlas;
GlyphStore &glyphStore;
SpriteAtlas &spriteAtlas;
Faces faces;
Placement placement;
};

View File

@@ -83,38 +83,9 @@ public:
uint32_t extent = 4096;
std::vector<std::string> keys;
std::vector<Value> values;
std::vector<std::string> faces;
std::map<std::string, std::map<Value, Shaping>> shaping;
};
class VectorTileGlyph {
public:
VectorTileGlyph();
VectorTileGlyph(pbf data);
uint32_t id = 0;
// A signed distance field of the glyph with a border of 3 pixels.
std::string bitmap;
// Glyph metrics
GlyphMetrics metrics;
};
std::ostream& operator<<(std::ostream&, const VectorTileGlyph& glyph);
class VectorTileFace {
public:
VectorTileFace(pbf data);
std::string name;
std::string family;
std::string style;
std::vector<VectorTileGlyph> glyphs;
};
std::ostream& operator<<(std::ostream&, const VectorTileFace& face);
class VectorTile {
public:
VectorTile();
@@ -122,7 +93,6 @@ public:
VectorTile& operator=(VectorTile&& other);
std::map<std::string, const VectorTileLayer> layers;
std::map<std::string, const VectorTileFace> faces;
};

View File

@@ -36,9 +36,9 @@ public:
void addGlyphs(const PlacedGlyphs &glyphs, float placementZoom,
PlacementRange placementRange, float zoom);
void addFeature(const VectorTileFeature &feature,
void addFeature(const pbf &geometry,
const GlyphPositions &face,
const std::map<Value, Shaping> &shapings);
const Shaping &shaping);
void drawGlyphs(TextShader &shader);

View File

@@ -128,6 +128,7 @@ struct IconClass : public GenericClass {
};
struct IconProperties : public GenericProperties {
inline IconProperties() : GenericProperties() {}
float size = 0;
Color color = {{ 1, 1, 1, 1 }};
std::string image;
@@ -147,6 +148,7 @@ struct LineClass : public GenericClass {
};
struct LineProperties : public GenericProperties {
inline LineProperties() : GenericProperties() {}
float width = 0;
float offset = 0;
Color color = {{ 0, 0, 0, 1 }};
@@ -164,6 +166,7 @@ struct FillClass : public GenericClass {
};
struct FillProperties : public GenericProperties {
inline FillProperties() : GenericProperties() {}
Winding winding = Winding::NonZero;
bool antialias = true;
Color fill_color = {{ 0, 0, 0, 1 }};
@@ -187,6 +190,7 @@ struct TextClass : public GenericClass {
};
struct TextProperties : public GenericProperties {
inline TextProperties() : GenericProperties() {}
Color color = {{ 0, 0, 0, 1 }};
Color halo = {{ 1, 1, 1, 0.75 }};
float halo_radius = 0.25f;
@@ -202,6 +206,7 @@ struct BackgroundClass : public GenericClass {
};
struct BackgroundProperties : public GenericProperties {
inline BackgroundProperties() : GenericProperties() {}
Color color = {{ 1, 1, 1, 1 }};
};
@@ -209,6 +214,7 @@ struct RasterClass : public GenericClass {
};
struct RasterProperties : public GenericProperties {
inline RasterProperties() : GenericProperties() {}
};
struct CompositeClass : public GenericClass {
@@ -219,6 +225,12 @@ struct CompositeProperties : public GenericProperties {
};
const IconProperties defaultIconProperties;
const LineProperties defaultLineProperties;
const FillProperties defaultFillProperties;
const TextProperties defaultTextProperties;
const BackgroundProperties defaultBackgroundProperties;
const RasterProperties defaultRasterProperties;
const CompositeProperties defaultCompositeProperties;
}

View File

@@ -43,8 +43,6 @@ struct Glyph {
};
typedef std::map<uint32_t, Glyph> GlyphPositions;
typedef std::map<std::string, GlyphPositions> Faces;
typedef std::vector<const GlyphPositions *> IndexedFaces;
class GlyphPlacement {
public: