diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-12 17:07:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-12 17:07:48 -0700 |
commit | 84e39611a096058826dbdb89dccbd1affad05f76 (patch) | |
tree | 97ac706e6a1300ad8d2e2293328e693cff10fbb9 /src/mbgl/renderer/buckets/symbol_bucket.hpp | |
parent | 83d9226e4f23c630cb0a78bd54783e35ed11fa81 (diff) | |
download | qtlocation-mapboxgl-84e39611a096058826dbdb89dccbd1affad05f76.tar.gz |
[core] Move renderer/* files into sub-folders (#8983)
Move renderer/* files into sub-folders
Diffstat (limited to 'src/mbgl/renderer/buckets/symbol_bucket.hpp')
-rw-r--r-- | src/mbgl/renderer/buckets/symbol_bucket.hpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/mbgl/renderer/buckets/symbol_bucket.hpp b/src/mbgl/renderer/buckets/symbol_bucket.hpp new file mode 100644 index 0000000000..f7e4bcfa20 --- /dev/null +++ b/src/mbgl/renderer/buckets/symbol_bucket.hpp @@ -0,0 +1,77 @@ +#pragma once + +#include <mbgl/renderer/bucket.hpp> +#include <mbgl/map/mode.hpp> +#include <mbgl/gl/vertex_buffer.hpp> +#include <mbgl/gl/index_buffer.hpp> +#include <mbgl/gl/segment.hpp> +#include <mbgl/programs/symbol_program.hpp> +#include <mbgl/programs/collision_box_program.hpp> +#include <mbgl/text/glyph_range.hpp> +#include <mbgl/style/layers/symbol_layer_properties.hpp> +#include <mbgl/layout/symbol_feature.hpp> + +#include <vector> + +namespace mbgl { + +class SymbolBucket : public Bucket { +public: + SymbolBucket(style::SymbolLayoutProperties::PossiblyEvaluated, + const std::map<std::string, std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>&, + const style::DataDrivenPropertyValue<float>& textSize, + const style::DataDrivenPropertyValue<float>& iconSize, + float zoom, + bool sdfIcons, + bool iconsNeedLinear); + + void upload(gl::Context&) override; + void render(Painter&, PaintParameters&, const RenderLayer&, const RenderTile&) override; + bool hasData() const override; + bool hasTextData() const; + bool hasIconData() const; + bool hasCollisionBoxData() const; + + const style::SymbolLayoutProperties::PossiblyEvaluated layout; + const bool sdfIcons; + const bool iconsNeedLinear; + + std::map<std::string, std::pair< + SymbolIconProgram::PaintPropertyBinders, + SymbolSDFTextProgram::PaintPropertyBinders>> paintPropertyBinders; + + std::unique_ptr<SymbolSizeBinder> textSizeBinder; + + struct TextBuffer { + gl::VertexVector<SymbolLayoutVertex> vertices; + gl::IndexVector<gl::Triangles> triangles; + gl::SegmentVector<SymbolTextAttributes> segments; + + optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer; + optional<gl::IndexBuffer<gl::Triangles>> indexBuffer; + } text; + + std::unique_ptr<SymbolSizeBinder> iconSizeBinder; + + struct IconBuffer { + gl::VertexVector<SymbolLayoutVertex> vertices; + gl::IndexVector<gl::Triangles> triangles; + gl::SegmentVector<SymbolIconAttributes> segments; + + optional<gl::VertexBuffer<SymbolLayoutVertex>> vertexBuffer; + optional<gl::IndexBuffer<gl::Triangles>> indexBuffer; + } icon; + + struct CollisionBoxBuffer { + gl::VertexVector<CollisionBoxVertex> vertices; + gl::IndexVector<gl::Lines> lines; + gl::SegmentVector<CollisionBoxAttributes> segments; + + optional<gl::VertexBuffer<CollisionBoxVertex>> vertexBuffer; + optional<gl::IndexBuffer<gl::Lines>> indexBuffer; + } collisionBox; + + SpriteAtlas* spriteAtlas = nullptr; +}; + +} // namespace mbgl |