summaryrefslogtreecommitdiff
path: root/src/mbgl/layout/symbol_layout.hpp
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-11 10:26:19 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2019-03-13 17:14:53 +0200
commit8be135231d9efe41a3b12037518d02b36104e8cf (patch)
treeefecd5380232f899aed2cd5824dc16f057f0469a /src/mbgl/layout/symbol_layout.hpp
parent8a51362bccbd6487dd1ed8518443b16ba6114fd8 (diff)
downloadqtlocation-mapboxgl-8be135231d9efe41a3b12037518d02b36104e8cf.tar.gz
[core] Add possibility of overriding paint properties inside format expression #14062
* [core] Add format override expression and formatted section to evaluation context * [core] Add textColor to TaggedString's formatted section * [core] Add FormatSectionOverrides and introduce overridable properties * [core] Populate symbol layer paint properties for text sections * [core] Add benchmark for style that uses text-color override * [core] Add unit test for FormatOverrideExpression * [core] Add unit test for FormatSectionOverrides
Diffstat (limited to 'src/mbgl/layout/symbol_layout.hpp')
-rw-r--r--src/mbgl/layout/symbol_layout.hpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/mbgl/layout/symbol_layout.hpp b/src/mbgl/layout/symbol_layout.hpp
index ab6dc049a2..53c66d31fe 100644
--- a/src/mbgl/layout/symbol_layout.hpp
+++ b/src/mbgl/layout/symbol_layout.hpp
@@ -6,18 +6,15 @@
#include <mbgl/layout/symbol_feature.hpp>
#include <mbgl/layout/symbol_instance.hpp>
#include <mbgl/text/bidi.hpp>
-#include <mbgl/style/layers/symbol_layer_impl.hpp>
-#include <mbgl/programs/symbol_program.hpp>
+#include <mbgl/renderer/buckets/symbol_bucket.hpp>
#include <memory>
#include <map>
-#include <unordered_set>
#include <vector>
namespace mbgl {
class BucketParameters;
-class SymbolBucket;
class Anchor;
class RenderLayer;
class PlacedSymbol;
@@ -26,7 +23,7 @@ namespace style {
class Filter;
} // namespace style
-class SymbolLayout : public Layout {
+class SymbolLayout final : public Layout {
public:
SymbolLayout(const BucketParameters&,
const std::vector<const RenderLayer*>&,
@@ -62,12 +59,25 @@ private:
void addToDebugBuffers(SymbolBucket&);
// Adds placed items to the buffer.
- template <typename Buffer>
- size_t addSymbol(Buffer&,
- const Range<float> sizeData,
- const SymbolQuad&,
- const Anchor& labelAnchor,
- PlacedSymbol& placedSymbol);
+ size_t addSymbol(SymbolBucket::Buffer&,
+ const Range<float> sizeData,
+ const SymbolQuad&,
+ const Anchor& labelAnchor,
+ PlacedSymbol& placedSymbol);
+
+ // Adds symbol quads to bucket and returns formatted section index of last
+ // added quad.
+ std::size_t addSymbolGlyphQuads(SymbolBucket&,
+ SymbolInstance&,
+ const SymbolFeature&,
+ WritingModeType,
+ optional<size_t>& placedIndex,
+ const SymbolQuads&,
+ optional<std::size_t> lastAddedSection = nullopt);
+
+ void updatePaintPropertiesForSection(SymbolBucket&,
+ const SymbolFeature&,
+ std::size_t sectionIndex);
// Stores the layer so that we can hold on to GeometryTileFeature instances in SymbolFeature,
// which may reference data from this object.