summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2018-10-30 17:41:53 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2018-11-19 14:06:21 +0200
commiteb170b250a96689a815e4e72830ee28edbc73216 (patch)
tree634c7b36c80200f4a7b12eac89cca87bcc1cc753 /src/mbgl
parent05d5edfa74ebc74d5e74560b597be5aec6f4e9e8 (diff)
downloadqtlocation-mapboxgl-eb170b250a96689a815e4e72830ee28edbc73216.tar.gz
[core] Add use LayerTypeInfo::Layout for the layers that require Layout
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp4
-rw-r--r--src/mbgl/renderer/layers/render_fill_layer.cpp3
-rw-r--r--src/mbgl/renderer/layers/render_line_layer.cpp3
-rw-r--r--src/mbgl/renderer/layers/render_line_layer.hpp1
-rw-r--r--src/mbgl/renderer/layers/render_symbol_layer.cpp3
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp2
6 files changed, 10 insertions, 6 deletions
diff --git a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
index 717408fbd1..8f1b961d1a 100644
--- a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
+++ b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
@@ -28,11 +28,11 @@ const style::FillExtrusionLayer::Impl& RenderFillExtrusionLayer::impl() const {
}
std::unique_ptr<Bucket> RenderFillExtrusionLayer::createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const {
- assert(false); // Should be calling createLayout() instead.
+ // Should be calling createLayout() instead.
+ assert(baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::NotRequired);
return nullptr;
}
-
std::unique_ptr<Layout> RenderFillExtrusionLayer::createLayout(const BucketParameters& parameters,
const std::vector<const RenderLayer*>& group,
std::unique_ptr<GeometryTileLayer> layer,
diff --git a/src/mbgl/renderer/layers/render_fill_layer.cpp b/src/mbgl/renderer/layers/render_fill_layer.cpp
index a0453121a8..83be3ccd57 100644
--- a/src/mbgl/renderer/layers/render_fill_layer.cpp
+++ b/src/mbgl/renderer/layers/render_fill_layer.cpp
@@ -26,7 +26,8 @@ const style::FillLayer::Impl& RenderFillLayer::impl() const {
}
std::unique_ptr<Bucket> RenderFillLayer::createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const {
- assert(false); // Should be calling createLayout() instead.
+ // Should be calling createLayout() instead.
+ assert(baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::NotRequired);
return nullptr;
}
diff --git a/src/mbgl/renderer/layers/render_line_layer.cpp b/src/mbgl/renderer/layers/render_line_layer.cpp
index 1edd69237e..94081b5f09 100644
--- a/src/mbgl/renderer/layers/render_line_layer.cpp
+++ b/src/mbgl/renderer/layers/render_line_layer.cpp
@@ -28,7 +28,8 @@ const style::LineLayer::Impl& RenderLineLayer::impl() const {
}
std::unique_ptr<Bucket> RenderLineLayer::createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const {
- assert(false); // Should be calling createLayout() instead.
+ // Should be calling createLayout() instead.
+ assert(baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::NotRequired);
return nullptr;
}
diff --git a/src/mbgl/renderer/layers/render_line_layer.hpp b/src/mbgl/renderer/layers/render_line_layer.hpp
index cd657dfe16..1b26419238 100644
--- a/src/mbgl/renderer/layers/render_line_layer.hpp
+++ b/src/mbgl/renderer/layers/render_line_layer.hpp
@@ -51,6 +51,7 @@ public:
std::unique_ptr<GeometryTileLayer>,
GlyphDependencies&,
ImageDependencies&) const override;
+
// Paint properties
style::LinePaintProperties::Unevaluated unevaluated;
RenderLinePaintProperties::PossiblyEvaluated evaluated;
diff --git a/src/mbgl/renderer/layers/render_symbol_layer.cpp b/src/mbgl/renderer/layers/render_symbol_layer.cpp
index cc084c5e1a..6d2c090aef 100644
--- a/src/mbgl/renderer/layers/render_symbol_layer.cpp
+++ b/src/mbgl/renderer/layers/render_symbol_layer.cpp
@@ -32,7 +32,8 @@ const style::SymbolLayer::Impl& RenderSymbolLayer::impl() const {
}
std::unique_ptr<Bucket> RenderSymbolLayer::createBucket(const BucketParameters&, const std::vector<const RenderLayer*>&) const {
- assert(false); // Should be calling createLayout() instead.
+ // Should be calling createLayout() instead.
+ assert(baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::NotRequired);
return nullptr;
}
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index e16b805f6b..89592e12be 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -375,7 +375,7 @@ void GeometryTileWorker::parse() {
// are needed to render the layer. They use the intermediate Layout data structure to accomplish this,
// and either immediately create a bucket if no images/glyphs are used, or the Layout is stored until
// the images/glyphs are available to add the features to the buckets.
- if (leader.as<RenderSymbolLayer>() ||leader.as<RenderLineLayer>() || leader.as<RenderFillLayer>() || leader.as<RenderFillExtrusionLayer>()) {
+ if (leader.baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::Required) {
auto layout = leader.createLayout(parameters, group, std::move(geometryLayer), glyphDependencies, imageDependencies);
if (layout->hasDependencies()) {
layouts.push_back(std::move(layout));