summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/circle_layer_impl.cpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-04-21 09:19:47 -0700
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-04-25 17:23:54 -0700
commit3c175adf30546fe58713b8fed29ac35a85e150be (patch)
tree5666e9bcf311ed1b86a13444e50dc7a030c10da9 /src/mbgl/style/layers/circle_layer_impl.cpp
parentea8ec38df156c6683c886253dbb1f6bc828686ff (diff)
downloadqtlocation-mapboxgl-3c175adf30546fe58713b8fed29ac35a85e150be.tar.gz
[core] split off render layers
Diffstat (limited to 'src/mbgl/style/layers/circle_layer_impl.cpp')
-rw-r--r--src/mbgl/style/layers/circle_layer_impl.cpp47
1 files changed, 3 insertions, 44 deletions
diff --git a/src/mbgl/style/layers/circle_layer_impl.cpp b/src/mbgl/style/layers/circle_layer_impl.cpp
index 2dde632f6e..31b286f273 100644
--- a/src/mbgl/style/layers/circle_layer_impl.cpp
+++ b/src/mbgl/style/layers/circle_layer_impl.cpp
@@ -1,52 +1,11 @@
#include <mbgl/style/layers/circle_layer_impl.hpp>
-#include <mbgl/renderer/circle_bucket.hpp>
-#include <mbgl/geometry/feature_index.hpp>
-#include <mbgl/util/math.hpp>
-#include <mbgl/util/intersection_tests.hpp>
+#include <mbgl/renderer/render_circle_layer.hpp>
namespace mbgl {
namespace style {
-void CircleLayer::Impl::cascade(const CascadeParameters& parameters) {
- paint.cascade(parameters);
-}
-
-bool CircleLayer::Impl::evaluate(const PropertyEvaluationParameters& parameters) {
- paint.evaluate(parameters);
-
- passes = ((paint.evaluated.get<CircleRadius>().constantOr(1) > 0 ||
- paint.evaluated.get<CircleStrokeWidth>().constantOr(1) > 0)
- && (paint.evaluated.get<CircleColor>().constantOr(Color::black()).a > 0 ||
- paint.evaluated.get<CircleStrokeColor>().constantOr(Color::black()).a > 0)
- && (paint.evaluated.get<CircleOpacity>().constantOr(1) > 0 ||
- paint.evaluated.get<CircleStrokeOpacity>().constantOr(1) > 0))
- ? RenderPass::Translucent : RenderPass::None;
-
- return paint.hasTransition();
-}
-
-std::unique_ptr<Bucket> CircleLayer::Impl::createBucket(const BucketParameters& parameters, const std::vector<const Layer*>& layers) const {
- return std::make_unique<CircleBucket>(parameters, layers);
-}
-
-bool CircleLayer::Impl::queryIntersectsFeature(
- const GeometryCoordinates& queryGeometry,
- const GeometryTileFeature& feature,
- const float zoom,
- const float bearing,
- const float pixelsToTileUnits) const {
-
- // Translate query geometry
- auto translatedQueryGeometry = FeatureIndex::translateQueryGeometry(
- queryGeometry, paint.evaluated.get<CircleTranslate>(), paint.evaluated.get<CircleTranslateAnchor>(), bearing, pixelsToTileUnits);
-
- // Evaluate function
- auto circleRadius = paint.evaluated.get<CircleRadius>()
- .evaluate(feature, zoom, CircleRadius::defaultValue())
- * pixelsToTileUnits;
-
- // Test intersection
- return util::polygonIntersectsBufferedMultiPoint(translatedQueryGeometry.value_or(queryGeometry), feature.getGeometries(), circleRadius);
+std::unique_ptr<RenderLayer> CircleLayer::Impl::createRenderLayer() const {
+ return std::make_unique<RenderCircleLayer>(*this);
}
} // namespace style