diff options
author | Molly Lloyd <molly@mapbox.com> | 2018-06-14 14:35:39 -0700 |
---|---|---|
committer | Molly Lloyd <mollymerp@users.noreply.github.com> | 2018-08-31 13:08:47 -0700 |
commit | 4a5dc37245d23805d13865f5ef9c5f26e539a9ca (patch) | |
tree | de77bfeff6f7afbe02210c9189bf72da59293083 /src/mbgl/renderer/buckets/fill_bucket.cpp | |
parent | ec62e321531b1a836074056e86de8e20018280fb (diff) | |
download | qtlocation-mapboxgl-4a5dc37245d23805d13865f5ef9c5f26e539a9ca.tar.gz |
[core] Implement CrossFadedDataDrivenProperty to add support for feature expressions in `*-pattern` properties
Diffstat (limited to 'src/mbgl/renderer/buckets/fill_bucket.cpp')
-rw-r--r-- | src/mbgl/renderer/buckets/fill_bucket.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/mbgl/renderer/buckets/fill_bucket.cpp b/src/mbgl/renderer/buckets/fill_bucket.cpp index 14be98c3af..3b1b7ec00f 100644 --- a/src/mbgl/renderer/buckets/fill_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_bucket.cpp @@ -27,20 +27,26 @@ using namespace style; struct GeometryTooLongException : std::exception {}; -FillBucket::FillBucket(const BucketParameters& parameters, const std::vector<const RenderLayer*>& layers) +FillBucket::FillBucket(const FillBucket::PossiblyEvaluatedLayoutProperties, + std::map<std::string, FillBucket::PossiblyEvaluatedPaintProperties> layerPaintProperties, + const float zoom, + const uint32_t) : Bucket(LayerType::Fill) { - for (const auto& layer : layers) { + + for (const auto& pair : layerPaintProperties) { paintPropertyBinders.emplace( std::piecewise_construct, - std::forward_as_tuple(layer->getID()), + std::forward_as_tuple(pair.first), std::forward_as_tuple( - layer->as<RenderFillLayer>()->evaluated, - parameters.tileID.overscaledZ)); + pair.second, + zoom)); } } void FillBucket::addFeature(const GeometryTileFeature& feature, - const GeometryCollection& geometry) { + const GeometryCollection& geometry, + const ImagePositions& patternPositions, + const PatternLayerMap& patternDependencies) { for (auto& polygon : classifyRings(geometry)) { // Optimize polygons with many interior rings for earcut tesselation. limitHoles(polygon, 500); @@ -105,7 +111,12 @@ void FillBucket::addFeature(const GeometryTileFeature& feature, } for (auto& pair : paintPropertyBinders) { - pair.second.populateVertexVectors(feature, vertices.vertexSize()); + const auto it = patternDependencies.find(pair.first); + if (it != patternDependencies.end()){ + pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, it->second); + } else { + pair.second.populateVertexVectors(feature, vertices.vertexSize(), patternPositions, {}); + } } } |