summaryrefslogtreecommitdiff
path: root/test/tile
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-30 13:40:36 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-05 19:38:08 -0700
commit591af0021bfb8b9fdfd803b55fb6c18a24c46943 (patch)
treeb0952184aca90ddda6ce170c4e2cc287824fbf54 /test/tile
parent32589c271c6f4885dadb6291c4bf637b72659a9f (diff)
downloadqtlocation-mapboxgl-591af0021bfb8b9fdfd803b55fb6c18a24c46943.tar.gz
[core] Refactor RenderSource updates
* Eliminate updateBatch in favor of diffing layers and detecting changes to properties upon which layout depends. * Replace RenderSource::{update,remove,invalidate,reload}Tiles with a single update method * Replace TilePyramid::{update,remove,invalidate,reload}Tiles with a single update method * Remove Style& dependency TODO from GeometryTile and TileParameters
Diffstat (limited to 'test/tile')
-rw-r--r--test/tile/annotation_tile.test.cpp7
-rw-r--r--test/tile/geojson_tile.test.cpp14
-rw-r--r--test/tile/raster_tile.test.cpp9
-rw-r--r--test/tile/vector_tile.test.cpp9
4 files changed, 27 insertions, 12 deletions
diff --git a/test/tile/annotation_tile.test.cpp b/test/tile/annotation_tile.test.cpp
index 205a315db7..bfd991c504 100644
--- a/test/tile/annotation_tile.test.cpp
+++ b/test/tile/annotation_tile.test.cpp
@@ -12,6 +12,8 @@
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/annotation/annotation_tile.hpp>
+#include <mbgl/sprite/sprite_atlas.hpp>
+#include <mbgl/text/glyph_atlas.hpp>
#include <memory>
@@ -25,6 +27,8 @@ public:
ThreadPool threadPool { 1 };
AnnotationManager annotationManager;
style::Style style { threadPool, fileSource, 1.0 };
+ SpriteAtlas spriteAtlas;
+ GlyphAtlas glyphAtlas { { 512, 512, }, fileSource };
TileParameters tileParameters {
1.0,
@@ -34,7 +38,8 @@ public:
fileSource,
MapMode::Continuous,
annotationManager,
- style
+ spriteAtlas,
+ glyphAtlas
};
};
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index dad4aef2ee..92068d5e43 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -7,10 +7,11 @@
#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/map/transform.hpp>
-#include <mbgl/style/style.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/style/layers/circle_layer.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
+#include <mbgl/sprite/sprite_atlas.hpp>
+#include <mbgl/text/glyph_atlas.hpp>
#include <memory>
@@ -24,7 +25,8 @@ public:
util::RunLoop loop;
ThreadPool threadPool { 1 };
AnnotationManager annotationManager;
- style::Style style { threadPool, fileSource, 1.0 };
+ SpriteAtlas spriteAtlas;
+ GlyphAtlas glyphAtlas { { 512, 512, }, fileSource };
Tileset tileset { { "https://example.com" }, { 0, 22 }, "none" };
TileParameters tileParameters {
@@ -35,14 +37,15 @@ public:
fileSource,
MapMode::Continuous,
annotationManager,
- style
+ spriteAtlas,
+ glyphAtlas
};
};
TEST(GeoJSONTile, Issue7648) {
GeoJSONTileTest test;
- test.style.addLayer(std::make_unique<CircleLayer>("circle", "source"));
+ CircleLayer layer("circle", "source");
mapbox::geometry::feature_collection<int16_t> features;
features.push_back(mapbox::geometry::feature<int16_t> {
@@ -55,9 +58,10 @@ 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")->baseImpl));
+ ASSERT_NE(nullptr, tile.getBucket(*layer.baseImpl));
};
+ tile.setLayers({{ layer.baseImpl }});
tile.setObserver(&observer);
tile.setPlacementConfig({});
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp
index ee6e31d845..1bd35700b3 100644
--- a/test/tile/raster_tile.test.cpp
+++ b/test/tile/raster_tile.test.cpp
@@ -6,10 +6,11 @@
#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/map/transform.hpp>
-#include <mbgl/style/style.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/renderer/buckets/raster_bucket.hpp>
+#include <mbgl/sprite/sprite_atlas.hpp>
+#include <mbgl/text/glyph_atlas.hpp>
using namespace mbgl;
@@ -20,7 +21,8 @@ public:
util::RunLoop loop;
ThreadPool threadPool { 1 };
AnnotationManager annotationManager;
- style::Style style { threadPool, fileSource, 1.0 };
+ SpriteAtlas spriteAtlas;
+ GlyphAtlas glyphAtlas { { 512, 512, }, fileSource };
Tileset tileset { { "https://example.com" }, { 0, 22 }, "none" };
TileParameters tileParameters {
@@ -31,7 +33,8 @@ public:
fileSource,
MapMode::Continuous,
annotationManager,
- style
+ spriteAtlas,
+ glyphAtlas
};
};
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp
index 205d001f72..a44eeb9001 100644
--- a/test/tile/vector_tile.test.cpp
+++ b/test/tile/vector_tile.test.cpp
@@ -7,13 +7,14 @@
#include <mbgl/util/run_loop.hpp>
#include <mbgl/map/transform.hpp>
#include <mbgl/map/query.hpp>
-#include <mbgl/style/style.hpp>
#include <mbgl/style/layers/symbol_layer.hpp>
#include <mbgl/renderer/tile_parameters.hpp>
#include <mbgl/renderer/buckets/symbol_bucket.hpp>
#include <mbgl/text/collision_tile.hpp>
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/annotation/annotation_manager.hpp>
+#include <mbgl/sprite/sprite_atlas.hpp>
+#include <mbgl/text/glyph_atlas.hpp>
#include <memory>
@@ -26,7 +27,8 @@ public:
util::RunLoop loop;
ThreadPool threadPool { 1 };
AnnotationManager annotationManager;
- style::Style style { threadPool, fileSource, 1.0 };
+ SpriteAtlas spriteAtlas;
+ GlyphAtlas glyphAtlas { { 512, 512, }, fileSource };
Tileset tileset { { "https://example.com" }, { 0, 22 }, "none" };
TileParameters tileParameters {
@@ -37,7 +39,8 @@ public:
fileSource,
MapMode::Continuous,
annotationManager,
- style
+ spriteAtlas,
+ glyphAtlas
};
};