summaryrefslogtreecommitdiff
path: root/src/mbgl/layout/symbol_layout.hpp
Commit message (Collapse)AuthorAgeFilesLines
* [core] Add possibility of overriding paint properties inside format ↵Alexander Shalamov2019-03-131-11/+21
| | | | | | | | | | | | | | | | | | 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
* [core] shader program must always match bucket in render symbol layerMikhail Pozdnyakov2019-01-111-2/+1
| | | | | | | | | Before this change, `RenderSymbolLayer` with updated style was trying to render symbols using the previous bucket (with paint property binders that matched a previous program). Now, symbol bucket caches the latest corresponding paint properties (caching is happening on complete tiles only). As a result, `RenderSymbolLayer` always picks the shader program and its parameters in sync with the obtained bucket.
* [core] Initial implementation of 'format' expressionChris Loer2018-10-151-1/+1
|
* [core] simplify dependency layout process and refactor data structuresMolly Lloyd2018-08-311-6/+10
|
* [core] Only run placement for first layer per SymbolBucketChris Loer2018-05-031-1/+1
| | | | | | | | | Native version of mapbox/mapbox-gl-js#6548. Port of mapbox/mapbox-gl-js#6550. Prevents symbols that share the same layout properties from colliding against each other. Bump GL JS pin to get regression test. Rename "bucketName" -> "bucketLeaderID" to make it clearer what it represents.
* Port global symbol query from GL JS:Chris Loer2018-04-251-5/+2
| | | | | | | - Symbol querying is now global instead of per-tile - Symbols that bleed over tile boundaries no longer missed in queries - Symbol results now sorted based on rendering order (ie overlapping symbols change their sort order when a bearing change causes their render order to change) - Placement::retainedQueryData now responsible for maintaining symbol querying data for buckets that may no longer be in the TilePyramid.
* [core] Switch from background to foreground placementChris Loer2017-11-171-11/+11
| | | | | | | | | | | | - Background placement code now just generates static symbol buffers - Don't render GeometryTiles until their symbols are loaded. This is necessary for the CrossTileSymbolIndex to successfully prevent flicker. - SymbolInstances are transferred to SymbolBucket for use on foreground during collision detection - Symbols are sorted on foreground by sorting their index buffer but leaving vertex buffers intact (only works within one segment) - Vertical glyphs are generated at same time as horizontal glyphs. `reprojectLineLabels` chooses which one to use at render time and hides the other. - Icons are now always represented with a single collision box, even if they're placed along a line (this means their rotation alignment may be wrong, but the approach of representing them with multiple collision boxes wasn't very accurate either). - Generate vertices for new debug collision boxes and collision circles - Only add symbols within tile boundaries (reduces work, avoids double-draw) - Update symbol_projection.cpp to support line label projection calls from CollisionIndex.
* [core] improve legibility of labels that follow linesAnsis Brammanis2017-07-111-5/+4
| | | | | | | | | | port https://github.com/mapbox/mapbox-gl-js/pull/4781 This improves legibility of labels that follow lines in pitched views. The previous approach used the limited information in the shader to calculate put the glyph in approximatelyright place. The new approach does this more accurately by doing it on the cpu where we have access to the entire line geometry.
* [core] Pass pitch-scaling vertex attributes and uniforms to shaders.Chris Loer2017-07-111-1/+2
|
* [core] make{Glyph,Image}Atlas only once for any number of symbol layersJohn Firebaugh2017-07-061-7/+0
|
* [core] retain GeometryTileLayer in SymbolLayoutKonstantin Käfer2017-06-211-2/+4
| | | | We're storing GeometryTileFeature objects in SymbolLayout, but they may reference data in GeometryTileLayer, which could go away if we don't retain it.
* [core] Per-tile glyph/icon atlasesJohn Firebaugh2017-06-131-5/+4
|
* [core] Per-bucket icon atlasesJohn Firebaugh2017-06-131-2/+3
|
* [core] Per-bucket glyph atlasesJohn Firebaugh2017-06-131-3/+4
|
* [core] Simplify and fix sprite atlas coordinate calculationsJohn Firebaugh2017-05-231-0/+1
| | | | | | | | * Always return image metrics exclusive of padding * Work with integer coordinates whenever possible * Eliminate redundant SpriteAtlasElement members * Fix asymmetric re-padding in getIconQuad when pixelRatio != 1 * Add explanatory comments
* [core] Unify {Paint,Layout,Light}PropertiesJohn Firebaugh2017-05-151-1/+1
|
* [core] Tweak handling of annotation special case SpriteAtlasJohn Firebaugh2017-04-261-4/+1
| | | | | * Simplify SymbolLayout; it never needs to care about more than one SpriteAtlas. * Move the reference from SymbolLayer::Impl to SymbolBucket. This is a prerequisite for making layer Impls immutable.
* [core] split off render layersIvo van Dongen2017-04-251-5/+4
|
* [core] Safeguard PositionedIcon usage via optionalBruno de Oliveira Abinader2017-04-141-1/+1
|
* [core] Add DDS support for {text,icon}-size (#8593)Anand Thakker2017-04-061-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | * Update gl-js and generate style code * Factor out packUint8Pair() helper function * Draft implementation of DDS for {text,icon}-size Ports https://github.com/mapbox/mapbox-gl-js/pull/4455 * Fix text-size/composite-function-line-placement test * Refactor to PaintPropertyBinders-like strategy * Dedupe gl::Program construction * Use exponential function base for interpolation * Dedupe coveringZoomStops method * Fixup tests * Fix CI errors (hidden within #if block)
* [core] De-mutex GlyphAtlas and SpriteAtlasChris Loer2017-04-041-11/+6
| | | | | | | | | | | | - Expose glyph and icon information to workers via message interface. - Glyph/SpriteAtlas track which tiles have outstanding requests and send messages to them when glyphs/icons become available. - Remove obsolete "updateSymbolDependentTiles" pathway - Symbol preparation for a tile now depends on all glyphs becoming available before it can start. - Start tracking individual icons needed for a tile, although we don't do anything with the information yet. - Introduce typedef for GlyphID
* [core] Introduce a fully-evaluated tuple type for layout propertiesJohn Firebaugh2017-03-311-1/+1
|
* [core] Prefer std::map to std::unordered_map for smaller binary sizeJohn Firebaugh2017-03-211-1/+1
|
* [core] Fix whitespace; no need for explicit on multi-parameter constructorsJohn Firebaugh2017-03-021-2/+1
|
* [core] Implement data-driven styling for ↵Anand Thakker2017-02-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | {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
* [core] There's only ever one icon quadJohn Firebaugh2017-02-281-1/+1
|
* Upright CJK characters in vertically-oriented labels (#7114)Minh Nguyễn2017-02-101-2/+3
| | | | | CJK characters and adjacent punctuation now remain upright in vertically oriented labels that have line placement. Fixes #1682.
* [core] Add support for data-driven stylingJohn Firebaugh2017-02-021-12/+9
|
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-1/+1
|
* [core] Fix flickering caused by regression in #7586John Firebaugh2017-01-101-2/+2
| | | | It should be safe to invoke GeometryTileWorker::setData multiple times without invoking GeometryTileWorker::setLayers. Therefore GeometryTileWorker::redoLayout() must not consume the layers.
* [core] Get rid of user-specified refsJohn Firebaugh2017-01-041-2/+3
|
* [core] Fix symbol rendering for multipointsJohn Firebaugh2016-12-201-3/+2
| | | | Ports https://github.com/mapbox/mapbox-gl-js/pull/3763 and https://github.com/mapbox/mapbox-gl-js/pull/3806.
* [core] const correctnessJohn Firebaugh2016-12-201-1/+1
|
* [core] Convert style properties to a tuple-based approachJohn Firebaugh2016-11-171-2/+2
| | | | | | | | This converts the style property classes (CirclePaintProperties and so on) to the same tuple-based approach as gl::Attribute and gl::Uniform. The approach is outlined in https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md. The main advantage of this approach is it allows writing algorithms that work on sets of style properties, without resorting to code generation or manually repetitive code. This lets us iterate on approaches to data-driven properties more easily. Another advantage is that the cascading, unevaluated, and evaluated states of a set of properties exist as independent structures, instead of individual properties holding their own state. This is a more functional approach that makes data flow clearer and reduces state.
* [core] Add ICU package for Bidirectional text support and arabic text shaping.Chris Loer2016-11-171-0/+3
| | | | | Apply bidi and shaping in symbol_layout. Add utility functions for converting to and from UTF-16.
* [core] Use UTF-16 instead of UTF-32 for label features to avoid extra ↵Chris Loer2016-11-171-2/+2
| | | | | | | conversions and reduce in-memory size. Continue to use uint32 as glyph ID to maintain Glyph PBF, even though we're only using 16 bits of that uint32. Use std::codecvt instead of boost::unicode_iterator for UTF8->UTF16 conversions.
* [core] Make ElementGroup saferJohn Firebaugh2016-10-051-1/+1
| | | | | | Template on shader types, rather than count. This allows the compiler to enforce using the correct VAO for the shader and PaintMode. This fixes OverdrawMode with circle layers. While here, avoid using unique_ptrs for groups. Instead, ensure ElementGroup is movable.
* [core] Convert uses of std::set to std::unordered_set (#6325)Lucas Wojciechowski2016-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/mbgl/annotation/annotation_manager.hpp * src/mbgl/algorithm/update_renderables.hpp * src/mbgl/geometry/glyph_atlas.hpp * src/mbgl/renderer/painter.cpp and src/mbgl/renderer/render_item.hpp * src/mbgl/renderer/symbol_bucket.hpp and src/mbgl/text/glyph_store.hpp * src/mbgl/sprite/sprite_atlas.hpp * include/mbgl/storage/network_status.hpp * src/mbgl/text/collision_tile.cpp * src/mbgl/style/update_batch.hpp * platform/default/mbgl/storage/offline_download.hpp * Add GlyphRangeSet typedef * Fix whitespace & unused imports
* [core] Merge GlyphStore and GlyphAtlasJohn Firebaugh2016-09-191-4/+2
|
* [core] Merge SpriteStore and SpriteAtlasJohn Firebaugh2016-09-191-2/+1
|
* [core] Move SymbolInstance and SymbolFeature into their own filesJohn Firebaugh2016-09-161-31/+3
|
* [core] Extract SymbolLayout from SymbolBucketJohn Firebaugh2016-09-141-0/+127
SymbolLayout lives on the worker thread and contains the persistent data needed for repeated placement. SymbolBucket contains the data generated during placement, and is transferred to the main thread for rendering. This eliminates the risky sharing of GeometryTile::buckets between the main thread and worker thread during TileWorker::redoPlacement. While here, rationalize the names of states a SymbolLayout may be in: * Pending: Waiting for the necessary glyphs or icons to be available. * Prepared: The potential positions of text and icons have been determined. * Placed: The final positions have been determined, taking into account prior layers. In TileWorker, all SymbolLayouts are stored in a single vector. Each SymbolLayout knows what state it is in, and TileWorker can easily determine how much progress it can make toward a final result.