diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-22 15:37:09 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-27 18:10:21 +0200 |
commit | 361982fef83a145769da5c04d1c19731df89921c (patch) | |
tree | e6212cb782cf9df83ecc3e32cb52beaebeb73ab8 /test | |
parent | cca37e765bf9b853262783a6f7cc3d1a4c72957d (diff) | |
download | qtlocation-mapboxgl-361982fef83a145769da5c04d1c19731df89921c.tar.gz |
[core][Android][Darwin] LayerManager creates RenderLayer instances
`LayerManager` is now responsible for `RenderLayer` instances creation,
so that there is a single entry point for creating of objects, which
correspond to a certain layer type.
The `LayerType type` field is dropped from `Layer::Impl`.
Diffstat (limited to 'test')
-rw-r--r-- | test/gl/context.test.cpp | 2 | ||||
-rw-r--r-- | test/renderer/group_by_layout.test.cpp | 2 | ||||
-rw-r--r-- | test/style/conversion/layer.test.cpp | 2 | ||||
-rw-r--r-- | test/style/style_layer.test.cpp | 10 |
4 files changed, 8 insertions, 8 deletions
diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp index 2561c84591..3818544021 100644 --- a/test/gl/context.test.cpp +++ b/test/gl/context.test.cpp @@ -95,7 +95,7 @@ TEST(GLContextMode, Shared) { // Set transparent background layer. auto layer = map.getStyle().getLayer("background"); - ASSERT_EQ(LayerType::Background, layer->getType()); + ASSERT_STREQ("background", layer->getTypeInfo()->type); static_cast<BackgroundLayer*>(layer)->setBackgroundColor( { { 1.0f, 0.0f, 0.0f, 0.5f } } ); { diff --git a/test/renderer/group_by_layout.test.cpp b/test/renderer/group_by_layout.test.cpp index a72ec43cb9..deaa30b9f4 100644 --- a/test/renderer/group_by_layout.test.cpp +++ b/test/renderer/group_by_layout.test.cpp @@ -15,7 +15,7 @@ static std::vector<std::unique_ptr<RenderLayer>> toRenderLayers(const std::vecto std::vector<std::unique_ptr<RenderLayer>> result; result.reserve(layers.size()); for (auto& layer : layers) { - result.push_back(RenderLayer::create(layer->baseImpl)); + result.push_back(LayerManager::get()->createRenderLayer(layer->baseImpl)); } return result; } diff --git a/test/style/conversion/layer.test.cpp b/test/style/conversion/layer.test.cpp index 18754a09fb..d65644b91b 100644 --- a/test/style/conversion/layer.test.cpp +++ b/test/style/conversion/layer.test.cpp @@ -25,7 +25,7 @@ TEST(StyleConversion, LayerTransition) { } } })JSON"); - ASSERT_EQ(LayerType::Background, layer->getType()); + ASSERT_STREQ("background", layer->getTypeInfo()->type); ASSERT_EQ(400ms, *static_cast<BackgroundLayer*>(layer.get())->impl().paint .get<BackgroundColor>().options.duration); ASSERT_EQ(500ms, *static_cast<BackgroundLayer*>(layer.get())->impl().paint diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 5ea16b7422..50aa643b50 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -54,7 +54,7 @@ const auto duration = 1.0f; TEST(Layer, BackgroundProperties) { auto layer = std::make_unique<BackgroundLayer>("background"); - ASSERT_EQ(LayerType::Background, layer->getType()); + ASSERT_STREQ("background", layer->getTypeInfo()->type); // Paint properties @@ -70,7 +70,7 @@ TEST(Layer, BackgroundProperties) { TEST(Layer, CircleProperties) { auto layer = std::make_unique<CircleLayer>("circle", "source"); - ASSERT_EQ(LayerType::Circle, layer->getType()); + ASSERT_STREQ("circle", layer->getTypeInfo()->type); // Paint properties @@ -95,7 +95,7 @@ TEST(Layer, CircleProperties) { TEST(Layer, FillProperties) { auto layer = std::make_unique<FillLayer>("fill", "source"); - ASSERT_EQ(LayerType::Fill, layer->getType()); + ASSERT_STREQ("fill", layer->getTypeInfo()->type); // Paint properties @@ -123,7 +123,7 @@ TEST(Layer, FillProperties) { TEST(Layer, LineProperties) { auto layer = std::make_unique<LineLayer>("line", "source"); - ASSERT_EQ(LayerType::Line, layer->getType()); + ASSERT_STREQ("line", layer->getTypeInfo()->type); // Layout properties @@ -174,7 +174,7 @@ TEST(Layer, LineProperties) { TEST(Layer, RasterProperties) { auto layer = std::make_unique<RasterLayer>("raster", "source"); - ASSERT_EQ(LayerType::Raster, layer->getType()); + ASSERT_STREQ("raster", layer->getTypeInfo()->type); // Paint properties |