diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-06-13 10:50:16 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-07-18 10:45:12 +0200 |
commit | 3832f8d0d8194b81ea34a045e19b0d5bc7a89e25 (patch) | |
tree | bbb4b277e1e74bde457271b9b9a5b6a9ec3ad5fb /test/api/custom_layer.test.cpp | |
parent | 39a732d7ae3cb1b927d94c4b1154b42d9565356a (diff) | |
download | qtlocation-mapboxgl-3832f8d0d8194b81ea34a045e19b0d5bc7a89e25.tar.gz |
[core] renderer interface
Diffstat (limited to 'test/api/custom_layer.test.cpp')
-rw-r--r-- | test/api/custom_layer.test.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp index b5d94f2786..b3ef0719ce 100644 --- a/test/api/custom_layer.test.cpp +++ b/test/api/custom_layer.test.cpp @@ -7,9 +7,11 @@ #include <mbgl/gl/offscreen_view.hpp> #include <mbgl/util/default_thread_pool.hpp> #include <mbgl/storage/default_file_source.hpp> +#include <mbgl/renderer/renderer.hpp> #include <mbgl/style/style.hpp> #include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/style/layers/fill_layer.hpp> +#include <mbgl/test/stub_renderer_frontend.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/mat4.hpp> #include <mbgl/util/run_loop.hpp> @@ -92,8 +94,10 @@ TEST(CustomLayer, Basic) { OffscreenView view { backend.getContext() }; DefaultFileSource fileSource(":memory:", "test/fixtures/api/assets"); ThreadPool threadPool(4); - - Map map(backend, MapObserver::nullObserver(), view.getSize(), 1, fileSource, threadPool, MapMode::Still); + float pixelRatio { 1 }; + StubRendererFrontend rendererFrontend { std::make_unique<Renderer>(backend, pixelRatio, fileSource, threadPool), view }; + Map map(rendererFrontend, MapObserver::nullObserver(), view.getSize(), pixelRatio, fileSource, + threadPool, MapMode::Still); map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); map.setLatLngZoom({ 37.8, -122.5 }, 10); map.getStyle().addLayer(std::make_unique<CustomLayer>( @@ -114,4 +118,5 @@ TEST(CustomLayer, Basic) { map.getStyle().addLayer(std::move(layer)); test::checkImage("test/fixtures/custom_layer/basic", test::render(map, view), 0.0006, 0.1); + } |