diff options
author | Mikko Pulkki <mikko.pulkki@mapbox.com> | 2019-10-15 12:03:04 +0300 |
---|---|---|
committer | Mikko Pulkki <55925868+mpulkki-mapbox@users.noreply.github.com> | 2019-10-30 14:32:27 +0200 |
commit | a7a7e8cbe29e672d020db1d150e887f33d584a2d (patch) | |
tree | 1c686fb6b2a91e0ef70d62b129545c1077e15a7f /test | |
parent | fb062bb23e66af3d5a889b767aae380884b259e5 (diff) | |
download | qtlocation-mapboxgl-a7a7e8cbe29e672d020db1d150e887f33d584a2d.tar.gz |
[render-test] Implement gfx probe for tracking gpu resources
Diffstat (limited to 'test')
-rw-r--r-- | test/api/annotations.test.cpp | 3 | ||||
-rw-r--r-- | test/api/custom_geometry_source.test.cpp | 2 | ||||
-rw-r--r-- | test/api/custom_layer.test.cpp | 2 | ||||
-rw-r--r-- | test/api/recycle_map.cpp | 4 | ||||
-rw-r--r-- | test/gl/context.test.cpp | 2 | ||||
-rw-r--r-- | test/map/map.test.cpp | 20 | ||||
-rw-r--r-- | test/text/local_glyph_rasterizer.test.cpp | 4 |
7 files changed, 16 insertions, 21 deletions
diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp index 03330dc4c6..4886d90a93 100644 --- a/test/api/annotations.test.cpp +++ b/test/api/annotations.test.cpp @@ -33,8 +33,7 @@ public: MapOptions().withMapMode(MapMode::Static).withSize(frontend.getSize())}; void checkRendering(const char * name) { - test::checkImage(std::string("test/fixtures/annotations/") + name, - frontend.render(map), 0.0002, 0.1); + test::checkImage(std::string("test/fixtures/annotations/") + name, frontend.render(map).image, 0.0002, 0.1); } }; diff --git a/test/api/custom_geometry_source.test.cpp b/test/api/custom_geometry_source.test.cpp index f35b4d335c..93cf6ba56e 100644 --- a/test/api/custom_geometry_source.test.cpp +++ b/test/api/custom_geometry_source.test.cpp @@ -64,5 +64,5 @@ TEST(CustomGeometrySource, Grid) { layer->setLineColor(Color{ 1.0, 1.0, 1.0, 1.0 }); map.getStyle().addLayer(std::move(layer)); - test::checkImage("test/fixtures/custom_geometry_source/grid", frontend.render(map), 0.0006, 0.1); + test::checkImage("test/fixtures/custom_geometry_source/grid", frontend.render(map).image, 0.0006, 0.1); } diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp index 175d053f93..2222645147 100644 --- a/test/api/custom_layer.test.cpp +++ b/test/api/custom_layer.test.cpp @@ -108,5 +108,5 @@ TEST(CustomLayer, Basic) { layer->setFillColor(Color{ 1.0, 1.0, 0.0, 1.0 }); map.getStyle().addLayer(std::move(layer)); - test::checkImage("test/fixtures/custom_layer/basic", frontend.render(map), 0.0006, 0.1); + test::checkImage("test/fixtures/custom_layer/basic", frontend.render(map).image, 0.0006, 0.1); } diff --git a/test/api/recycle_map.cpp b/test/api/recycle_map.cpp index b3c573b1a2..be7bb77b4c 100644 --- a/test/api/recycle_map.cpp +++ b/test/api/recycle_map.cpp @@ -45,10 +45,10 @@ TEST(API, RecycleMapUpdateImages) { // default marker loadStyle("default_marker", "test/fixtures/sprites/default_marker.png"); - test::checkImage("test/fixtures/recycle_map/default_marker", frontend.render(*map), 0.0006, 0.1); + test::checkImage("test/fixtures/recycle_map/default_marker", frontend.render(*map).image, 0.0006, 0.1); // flipped marker loadStyle("flipped_marker", "test/fixtures/sprites/flipped_marker.png"); - test::checkImage("test/fixtures/recycle_map/flipped_marker", frontend.render(*map), 0.0006, 0.1); + test::checkImage("test/fixtures/recycle_map/flipped_marker", frontend.render(*map).image, 0.0006, 0.1); } diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp index 5c42eb9344..9c709b7597 100644 --- a/test/gl/context.test.cpp +++ b/test/gl/context.test.cpp @@ -119,5 +119,5 @@ TEST(GLContextMode, Shared) { MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, 3)); } - test::checkImage("test/fixtures/shared_context", frontend.render(map), 0.5, 0.1); + test::checkImage("test/fixtures/shared_context", frontend.render(map).image, 0.5, 0.1); } diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 6f4b14a681..0eebc93f32 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -259,10 +259,7 @@ TEST(Map, Offline) { test.map.getStyle().loadURL(prefix + "style.json"); - test::checkImage("test/fixtures/map/offline", - test.frontend.render(test.map), - 0.0015, - 0.1); + test::checkImage("test/fixtures/map/offline", test.frontend.render(test.map).image, 0.0015, 0.1); NetworkStatus::Set(NetworkStatus::Status::Online); } @@ -608,7 +605,7 @@ TEST(Map, AddLayer) { layer->setBackgroundColor({ { 1, 0, 0, 1 } }); test.map.getStyle().addLayer(std::move(layer)); - test::checkImage("test/fixtures/map/add_layer", test.frontend.render(test.map)); + test::checkImage("test/fixtures/map/add_layer", test.frontend.render(test.map).image); } TEST(Map, WithoutVAOExtension) { @@ -623,7 +620,7 @@ TEST(Map, WithoutVAOExtension) { test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/water.json")); - test::checkImage("test/fixtures/map/no_vao", test.frontend.render(test.map), 0.002); + test::checkImage("test/fixtures/map/no_vao", test.frontend.render(test.map).image, 0.002); } TEST(Map, RemoveLayer) { @@ -636,7 +633,7 @@ TEST(Map, RemoveLayer) { test.map.getStyle().addLayer(std::move(layer)); test.map.getStyle().removeLayer("background"); - test::checkImage("test/fixtures/map/remove_layer", test.frontend.render(test.map)); + test::checkImage("test/fixtures/map/remove_layer", test.frontend.render(test.map).image); } TEST(Map, DisabledSources) { @@ -694,9 +691,9 @@ TEST(Map, DisabledSources) { } )STYLE"); - test::checkImage("test/fixtures/map/disabled_layers/first", test.frontend.render(test.map)); + test::checkImage("test/fixtures/map/disabled_layers/first", test.frontend.render(test.map).image); test.map.jumpTo(CameraOptions().withZoom(0.5)); - test::checkImage("test/fixtures/map/disabled_layers/second", test.frontend.render(test.map)); + test::checkImage("test/fixtures/map/disabled_layers/second", test.frontend.render(test.map).image); } TEST(Map, DontLoadUnneededTiles) { @@ -815,10 +812,7 @@ TEST(Map, NoContentTiles) { }] })STYLE"); - test::checkImage("test/fixtures/map/nocontent", - test.frontend.render(test.map), - 0.0015, - 0.1); + test::checkImage("test/fixtures/map/nocontent", test.frontend.render(test.map).image, 0.0015, 0.1); } // https://github.com/mapbox/mapbox-gl-native/issues/12432 diff --git a/test/text/local_glyph_rasterizer.test.cpp b/test/text/local_glyph_rasterizer.test.cpp index 94c37b170b..d109b28f32 100644 --- a/test/text/local_glyph_rasterizer.test.cpp +++ b/test/text/local_glyph_rasterizer.test.cpp @@ -43,7 +43,9 @@ public: void checkRendering(const char * name, double imageMatchPixelsThreshold = 0.015, double pixelMatchThreshold = 0.1) { test::checkImage(std::string("test/fixtures/local_glyphs/") + name, - frontend.render(map), imageMatchPixelsThreshold, pixelMatchThreshold); + frontend.render(map).image, + imageMatchPixelsThreshold, + pixelMatchThreshold); } }; |