diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-09-05 14:43:52 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-09-08 15:12:32 -0700 |
commit | eb4f53cbed1953d4016975d14424fb2bc6bbf3d3 (patch) | |
tree | 7fb5a502641ed762a7579165408678bf8a51c0a2 /include/mbgl/renderer | |
parent | 2033eb94941496ac12fa3af21fb75764af17e4b9 (diff) | |
download | qtlocation-mapboxgl-eb4f53cbed1953d4016975d14424fb2bc6bbf3d3.tar.gz |
SDF icon support (fixes #404)
Diffstat (limited to 'include/mbgl/renderer')
-rw-r--r-- | include/mbgl/renderer/painter.hpp | 15 | ||||
-rw-r--r-- | include/mbgl/renderer/symbol_bucket.hpp | 6 |
2 files changed, 18 insertions, 3 deletions
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp index af50a6b52a..75529d1136 100644 --- a/include/mbgl/renderer/painter.hpp +++ b/include/mbgl/renderer/painter.hpp @@ -120,12 +120,24 @@ public: void discardFramebuffers(); bool needsAnimation() const; + private: void setupShaders(); mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor); void prepareTile(const Tile& tile); + template <typename BucketProperties, typename StyleProperties> + void renderSDF(SymbolBucket &bucket, + const Tile::ID &id, + const mat4 &matrixSymbol, + const BucketProperties& bucketProperties, + const StyleProperties& styleProperties, + float scaleDivisor, + std::array<float, 2> texsize, + SDFShader& sdfShader, + void (SymbolBucket::*drawSDF)(SDFShader&)); + public: void useProgram(uint32_t program); void lineWidth(float lineWidth); @@ -176,7 +188,8 @@ public: std::unique_ptr<PatternShader> patternShader; std::unique_ptr<IconShader> iconShader; std::unique_ptr<RasterShader> rasterShader; - std::unique_ptr<SDFShader> sdfShader; + std::unique_ptr<SDFGlyphShader> sdfGlyphShader; + std::unique_ptr<SDFIconShader> sdfIconShader; std::unique_ptr<DotShader> dotShader; std::unique_ptr<GaussianShader> gaussianShader; diff --git a/include/mbgl/renderer/symbol_bucket.hpp b/include/mbgl/renderer/symbol_bucket.hpp index 23de5e6e5a..c71d276456 100644 --- a/include/mbgl/renderer/symbol_bucket.hpp +++ b/include/mbgl/renderer/symbol_bucket.hpp @@ -51,7 +51,7 @@ typedef std::vector<Symbol> Symbols; class SymbolBucket : public Bucket { typedef ElementGroup<1> TextElementGroup; - typedef ElementGroup<1> IconElementGroup; + typedef ElementGroup<2> IconElementGroup; public: SymbolBucket(const StyleBucketSymbol &properties, Collision &collision); @@ -68,7 +68,8 @@ public: void addGlyphs(const PlacedGlyphs &glyphs, float placementZoom, PlacementRange placementRange, float zoom); - void drawGlyphs(SDFShader &shader); + void drawGlyphs(SDFShader& shader); + void drawIcons(SDFShader& shader); void drawIcons(IconShader& shader); private: @@ -90,6 +91,7 @@ private: public: const StyleBucketSymbol &properties; + bool sdfIcons = false; private: Collision &collision; |