summaryrefslogtreecommitdiff
path: root/test
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 /test
parentea8ec38df156c6683c886253dbb1f6bc828686ff (diff)
downloadqtlocation-mapboxgl-3c175adf30546fe58713b8fed29ac35a85e150be.tar.gz
[core] split off render layers
Diffstat (limited to 'test')
-rw-r--r--test/gl/bucket.test.cpp2
-rw-r--r--test/renderer/group_by_layout.test.cpp (renamed from test/style/group_by_layout.test.cpp)20
-rw-r--r--test/style/conversion/layer.test.cpp8
-rw-r--r--test/tile/geojson_tile.test.cpp2
-rw-r--r--test/tile/vector_tile.test.cpp2
5 files changed, 22 insertions, 12 deletions
diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp
index 5b66a0987f..e21d82321d 100644
--- a/test/gl/bucket.test.cpp
+++ b/test/gl/bucket.test.cpp
@@ -4,7 +4,7 @@
#include <mbgl/renderer/fill_bucket.hpp>
#include <mbgl/renderer/line_bucket.hpp>
#include <mbgl/renderer/symbol_bucket.hpp>
-#include <mbgl/style/bucket_parameters.hpp>
+#include <mbgl/renderer/bucket_parameters.hpp>
#include <mbgl/style/layers/symbol_layer_properties.hpp>
#include <mbgl/map/mode.hpp>
diff --git a/test/style/group_by_layout.test.cpp b/test/renderer/group_by_layout.test.cpp
index 600ba6a0f1..9c8e09e222 100644
--- a/test/style/group_by_layout.test.cpp
+++ b/test/renderer/group_by_layout.test.cpp
@@ -1,6 +1,7 @@
#include <mbgl/test/util.hpp>
-#include <mbgl/style/group_by_layout.hpp>
+#include <mbgl/renderer/group_by_layout.hpp>
+#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/style/layers/background_layer.hpp>
#include <mbgl/style/layers/circle_layer.hpp>
#include <mbgl/style/layers/line_layer.hpp>
@@ -8,11 +9,20 @@
using namespace mbgl;
using namespace mbgl::style;
+static std::vector<std::unique_ptr<RenderLayer>> toRenderLayers(const std::vector<std::unique_ptr<Layer>>& layers) {
+ std::vector<std::unique_ptr<RenderLayer>> result;
+ result.reserve(layers.size());
+ for (auto& layer : layers) {
+ result.push_back(layer->baseImpl->createRenderLayer());
+ }
+ return result;
+}
+
TEST(GroupByLayout, Related) {
std::vector<std::unique_ptr<Layer>> layers;
layers.push_back(std::make_unique<LineLayer>("a", "source"));
layers.push_back(std::make_unique<LineLayer>("b", "source"));
- auto result = groupByLayout(layers);
+ auto result = groupByLayout(toRenderLayers(layers));
ASSERT_EQ(1u, result.size());
ASSERT_EQ(2u, result[0].size());
}
@@ -21,7 +31,7 @@ TEST(GroupByLayout, UnrelatedType) {
std::vector<std::unique_ptr<Layer>> layers;
layers.push_back(std::make_unique<BackgroundLayer>("background"));
layers.push_back(std::make_unique<CircleLayer>("circle", "source"));
- auto result = groupByLayout(layers);
+ auto result = groupByLayout(toRenderLayers(layers));
ASSERT_EQ(2u, result.size());
}
@@ -30,7 +40,7 @@ TEST(GroupByLayout, UnrelatedFilter) {
layers.push_back(std::make_unique<LineLayer>("a", "source"));
layers.push_back(std::make_unique<LineLayer>("b", "source"));
layers[0]->as<LineLayer>()->setFilter(EqualsFilter());
- auto result = groupByLayout(layers);
+ auto result = groupByLayout(toRenderLayers(layers));
ASSERT_EQ(2u, result.size());
}
@@ -39,6 +49,6 @@ TEST(GroupByLayout, UnrelatedLayout) {
layers.push_back(std::make_unique<LineLayer>("a", "source"));
layers.push_back(std::make_unique<LineLayer>("b", "source"));
layers[0]->as<LineLayer>()->setLineCap(LineCapType::Square);
- auto result = groupByLayout(layers);
+ auto result = groupByLayout(toRenderLayers(layers));
ASSERT_EQ(2u, result.size());
}
diff --git a/test/style/conversion/layer.test.cpp b/test/style/conversion/layer.test.cpp
index cfe2662fb8..ae8d4058ab 100644
--- a/test/style/conversion/layer.test.cpp
+++ b/test/style/conversion/layer.test.cpp
@@ -35,13 +35,13 @@ TEST(StyleConversion, LayerTransition) {
}
})JSON");
- ASSERT_EQ(400ms, *layer->as<BackgroundLayer>()->impl->paint.cascading
+ ASSERT_EQ(400ms, *layer->as<BackgroundLayer>()->impl->cascading
.get<BackgroundColor>().getTransition({}).duration);
- ASSERT_EQ(500ms, *layer->as<BackgroundLayer>()->impl->paint.cascading
+ ASSERT_EQ(500ms, *layer->as<BackgroundLayer>()->impl->cascading
.get<BackgroundColor>().getTransition({}).delay);
- ASSERT_EQ(100ms, *layer->as<BackgroundLayer>()->impl->paint.cascading
+ ASSERT_EQ(100ms, *layer->as<BackgroundLayer>()->impl->cascading
.get<BackgroundColor>().getTransition({"class"}).duration);
- ASSERT_FALSE(bool(layer->as<BackgroundLayer>()->impl->paint.cascading
+ ASSERT_FALSE(bool(layer->as<BackgroundLayer>()->impl->cascading
.get<BackgroundColor>().getTransition({"class"}).delay));
}
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index e2a026b560..46cbe209b6 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -49,7 +49,7 @@ TEST(GeoJSONTile, Issue7648) {
observer.tileChanged = [&] (const Tile&) {
// Once present, the bucket should never "disappear", which would cause
// flickering.
- ASSERT_NE(nullptr, tile.getBucket(*test.style.getLayer("circle")));
+ ASSERT_NE(nullptr, tile.getBucket(*test.style.getRenderLayer("circle")));
};
tile.setObserver(&observer);
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index fc6e9b3a6d..26c5dac8c0 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -89,7 +89,7 @@ TEST(VectorTile, Issue7615) {
0
});
- EXPECT_EQ(symbolBucket.get(), tile.getBucket(symbolLayer));
+ EXPECT_EQ(symbolBucket.get(), tile.getBucket(*symbolLayer.baseImpl->createRenderLayer()));
}
TEST(VectorTile, Issue8542) {