From f901e776b3e63aaaa6bc0cc4476624bf84127fe6 Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Tue, 28 Feb 2017 19:54:24 -0800 Subject: [core] Implement data-driven styling for {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939) * Add symbol dds attributes and adapt style code generation * Update to mapbox-gl-js/master * Refactor SymbolFeature as a subclass of GeometryTileFeature Prepares for enabling DDS on symbol paint properties by allowing the SymbolFeatures, which we keep around after constructing SymbolLayout, to be used in evaluating data-driven paint properties later in the layout process. * Draft approach for splitting icon/text paint properties The `Program` types are set up to bind GL attributes to each of the data-driven paint properties specified in the `PaintProperties` type provided. Since `SymbolPaintProperties` specifies both `Text*` and `Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph programs each attempt to bind roughly double the number of attributes that they actually need. This change addresses this by: - Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`. - The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter. - The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type. * check in generated style code * Populate paint buffers for symbol DDS properties * Address first round of review comments * Refactor VectorTile{Layer,Feature} to explicitly share data * Update submodule --- include/mbgl/style/layers/symbol_layer.hpp | 60 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'include/mbgl') diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 8f655d6f77..aeccabb97e 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -169,29 +169,29 @@ public: // Paint properties - static PropertyValue getDefaultIconOpacity(); - PropertyValue getIconOpacity(const optional& klass = {}) const; - void setIconOpacity(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultIconOpacity(); + DataDrivenPropertyValue getIconOpacity(const optional& klass = {}) const; + void setIconOpacity(DataDrivenPropertyValue, const optional& klass = {}); void setIconOpacityTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultIconColor(); - PropertyValue getIconColor(const optional& klass = {}) const; - void setIconColor(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultIconColor(); + DataDrivenPropertyValue getIconColor(const optional& klass = {}) const; + void setIconColor(DataDrivenPropertyValue, const optional& klass = {}); void setIconColorTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultIconHaloColor(); - PropertyValue getIconHaloColor(const optional& klass = {}) const; - void setIconHaloColor(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultIconHaloColor(); + DataDrivenPropertyValue getIconHaloColor(const optional& klass = {}) const; + void setIconHaloColor(DataDrivenPropertyValue, const optional& klass = {}); void setIconHaloColorTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultIconHaloWidth(); - PropertyValue getIconHaloWidth(const optional& klass = {}) const; - void setIconHaloWidth(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultIconHaloWidth(); + DataDrivenPropertyValue getIconHaloWidth(const optional& klass = {}) const; + void setIconHaloWidth(DataDrivenPropertyValue, const optional& klass = {}); void setIconHaloWidthTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultIconHaloBlur(); - PropertyValue getIconHaloBlur(const optional& klass = {}) const; - void setIconHaloBlur(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultIconHaloBlur(); + DataDrivenPropertyValue getIconHaloBlur(const optional& klass = {}) const; + void setIconHaloBlur(DataDrivenPropertyValue, const optional& klass = {}); void setIconHaloBlurTransition(const TransitionOptions&, const optional& klass = {}); static PropertyValue> getDefaultIconTranslate(); @@ -204,29 +204,29 @@ public: void setIconTranslateAnchor(PropertyValue, const optional& klass = {}); void setIconTranslateAnchorTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultTextOpacity(); - PropertyValue getTextOpacity(const optional& klass = {}) const; - void setTextOpacity(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultTextOpacity(); + DataDrivenPropertyValue getTextOpacity(const optional& klass = {}) const; + void setTextOpacity(DataDrivenPropertyValue, const optional& klass = {}); void setTextOpacityTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultTextColor(); - PropertyValue getTextColor(const optional& klass = {}) const; - void setTextColor(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultTextColor(); + DataDrivenPropertyValue getTextColor(const optional& klass = {}) const; + void setTextColor(DataDrivenPropertyValue, const optional& klass = {}); void setTextColorTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultTextHaloColor(); - PropertyValue getTextHaloColor(const optional& klass = {}) const; - void setTextHaloColor(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultTextHaloColor(); + DataDrivenPropertyValue getTextHaloColor(const optional& klass = {}) const; + void setTextHaloColor(DataDrivenPropertyValue, const optional& klass = {}); void setTextHaloColorTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultTextHaloWidth(); - PropertyValue getTextHaloWidth(const optional& klass = {}) const; - void setTextHaloWidth(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultTextHaloWidth(); + DataDrivenPropertyValue getTextHaloWidth(const optional& klass = {}) const; + void setTextHaloWidth(DataDrivenPropertyValue, const optional& klass = {}); void setTextHaloWidthTransition(const TransitionOptions&, const optional& klass = {}); - static PropertyValue getDefaultTextHaloBlur(); - PropertyValue getTextHaloBlur(const optional& klass = {}) const; - void setTextHaloBlur(PropertyValue, const optional& klass = {}); + static DataDrivenPropertyValue getDefaultTextHaloBlur(); + DataDrivenPropertyValue getTextHaloBlur(const optional& klass = {}) const; + void setTextHaloBlur(DataDrivenPropertyValue, const optional& klass = {}); void setTextHaloBlurTransition(const TransitionOptions&, const optional& klass = {}); static PropertyValue> getDefaultTextTranslate(); -- cgit v1.2.1