diff options
Diffstat (limited to 'src/mbgl/style/layers/fill_layer_impl.cpp')
-rw-r--r-- | src/mbgl/style/layers/fill_layer_impl.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mbgl/style/layers/fill_layer_impl.cpp b/src/mbgl/style/layers/fill_layer_impl.cpp index 51636820f0..c7c89f8c20 100644 --- a/src/mbgl/style/layers/fill_layer_impl.cpp +++ b/src/mbgl/style/layers/fill_layer_impl.cpp @@ -1,5 +1,4 @@ #include <mbgl/style/layers/fill_layer_impl.hpp> -#include <mbgl/style/bucket_parameters.hpp> #include <mbgl/renderer/fill_bucket.hpp> #include <mbgl/geometry/feature_index.hpp> #include <mbgl/util/math.hpp> @@ -15,13 +14,19 @@ void FillLayer::Impl::cascade(const CascadeParameters& parameters) { bool FillLayer::Impl::evaluate(const PropertyEvaluationParameters& parameters) { paint.evaluate(parameters); + if (paint.unevaluated.get<FillOutlineColor>().isUndefined()) { + paint.evaluated.get<FillOutlineColor>() = paint.evaluated.get<FillColor>(); + } + passes = RenderPass::None; if (paint.evaluated.get<FillAntialias>()) { passes |= RenderPass::Translucent; } - if (!paint.evaluated.get<FillPattern>().from.empty() || (paint.evaluated.get<FillColor>().a * paint.evaluated.get<FillOpacity>()) < 1.0f) { + if (!paint.unevaluated.get<FillPattern>().isUndefined() + || paint.evaluated.get<FillColor>().constantOr(Color()).a < 1.0f + || paint.evaluated.get<FillOpacity>().constantOr(0) < 1.0f) { passes |= RenderPass::Translucent; } else { passes |= RenderPass::Opaque; @@ -30,16 +35,8 @@ bool FillLayer::Impl::evaluate(const PropertyEvaluationParameters& parameters) { return paint.hasTransition(); } -std::unique_ptr<Bucket> FillLayer::Impl::createBucket(BucketParameters& parameters, const GeometryTileLayer& layer) const { - auto bucket = std::make_unique<FillBucket>(); - - parameters.eachFilteredFeature(filter, layer, [&] (const auto& feature, std::size_t index, const std::string& layerName) { - auto geometries = feature.getGeometries(); - bucket->addGeometry(geometries); - parameters.featureIndex.insert(geometries, index, layerName, id); - }); - - return std::move(bucket); +std::unique_ptr<Bucket> FillLayer::Impl::createBucket(const BucketParameters& parameters, const std::vector<const Layer*>& layers) const { + return std::make_unique<FillBucket>(parameters, layers); } float FillLayer::Impl::getQueryRadius() const { |