diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-11-05 15:05:43 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-11-12 13:03:14 -0800 |
commit | 1e350b7ea485117cadc413d4d41062cf3c3c43a1 (patch) | |
tree | 8dde92582eda347a7c88c0e655270cef82e44744 | |
parent | 0dc1519a1891dac6272f69dd1d1768f15908003c (diff) | |
download | qtlocation-mapboxgl-1e350b7ea485117cadc413d4d41062cf3c3c43a1.tar.gz |
[core] Reorganize sprite related files
-rw-r--r-- | include/mbgl/sprite/sprite_image.hpp (renamed from include/mbgl/annotation/sprite_image.hpp) | 4 | ||||
-rw-r--r-- | platform/android/jni.cpp | 2 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 2 | ||||
-rw-r--r-- | platform/ios/MGLMapView.mm | 2 | ||||
-rw-r--r-- | src/mbgl/map/map_context.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/map/tile_worker.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_circle.cpp | 1 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_fill.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_line.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_symbol.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/symbol_bucket.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite.cpp (renamed from src/mbgl/map/sprite.cpp) | 3 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite.hpp (renamed from src/mbgl/map/sprite.hpp) | 6 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.cpp (renamed from src/mbgl/geometry/sprite_atlas.cpp) | 6 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.hpp (renamed from src/mbgl/geometry/sprite_atlas.hpp) | 4 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_image.cpp (renamed from src/mbgl/annotation/sprite_image.cpp) | 2 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_parser.cpp (renamed from src/mbgl/annotation/sprite_parser.cpp) | 4 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_parser.hpp (renamed from src/mbgl/annotation/sprite_parser.hpp) | 4 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_store.cpp (renamed from src/mbgl/annotation/sprite_store.cpp) | 2 | ||||
-rw-r--r-- | src/mbgl/sprite/sprite_store.hpp (renamed from src/mbgl/annotation/sprite_store.hpp) | 6 | ||||
-rw-r--r-- | src/mbgl/style/style.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/style.hpp | 2 | ||||
-rw-r--r-- | test/sprite/custom_sprites.cpp (renamed from test/miscellaneous/custom_sprites.cpp) | 4 | ||||
-rw-r--r-- | test/sprite/sprite.cpp (renamed from test/style/sprite.cpp) | 2 | ||||
-rw-r--r-- | test/sprite/sprite_atlas.cpp (renamed from test/annotations/sprite_atlas.cpp) | 12 | ||||
-rw-r--r-- | test/sprite/sprite_image.cpp (renamed from test/annotations/sprite_image.cpp) | 14 | ||||
-rw-r--r-- | test/sprite/sprite_parser.cpp (renamed from test/annotations/sprite_parser.cpp) | 26 | ||||
-rw-r--r-- | test/sprite/sprite_store.cpp (renamed from test/annotations/sprite_store.cpp) | 12 | ||||
-rw-r--r-- | test/test.gypi | 14 |
30 files changed, 80 insertions, 84 deletions
diff --git a/include/mbgl/annotation/sprite_image.hpp b/include/mbgl/sprite/sprite_image.hpp index 7d8ea0501c..f36ec5e286 100644 --- a/include/mbgl/annotation/sprite_image.hpp +++ b/include/mbgl/sprite/sprite_image.hpp @@ -1,5 +1,5 @@ -#ifndef MBGL_ANNOTATIONS_SPRITE_IMAGE -#define MBGL_ANNOTATIONS_SPRITE_IMAGE +#ifndef MBGL_SPRITE_IMAGE +#define MBGL_SPRITE_IMAGE #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/geo.hpp> diff --git a/platform/android/jni.cpp b/platform/android/jni.cpp index 707b0ac9e2..1e4c4c05f3 100644 --- a/platform/android/jni.cpp +++ b/platform/android/jni.cpp @@ -19,7 +19,7 @@ #include <mbgl/map/camera.hpp> #include <mbgl/annotation/point_annotation.hpp> #include <mbgl/annotation/shape_annotation.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/platform/event.hpp> #include <mbgl/platform/log.hpp> #include <mbgl/storage/network_status.hpp> diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 6a5524d2c9..71c808ddb1 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -1,6 +1,6 @@ #include <mbgl/annotation/point_annotation.hpp> #include <mbgl/annotation/shape_annotation.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/platform/default/glfw_view.hpp> #include <mbgl/platform/gl.hpp> #include <mbgl/platform/log.hpp> diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index a097e4932e..750f3fabbb 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -10,7 +10,7 @@ #include <mbgl/mbgl.hpp> #include <mbgl/annotation/point_annotation.hpp> #include <mbgl/annotation/shape_annotation.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/platform/platform.hpp> #include <mbgl/platform/darwin/reachability.h> diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 75f195a3f9..dedfff02d8 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -2,7 +2,6 @@ #include <mbgl/map/map_data.hpp> #include <mbgl/map/view.hpp> #include <mbgl/map/still_image.hpp> -#include <mbgl/annotation/sprite_store.hpp> #include <mbgl/platform/log.hpp> @@ -12,10 +11,11 @@ #include <mbgl/storage/resource.hpp> #include <mbgl/storage/response.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> - #include <mbgl/style/style.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_store.hpp> + #include <mbgl/util/gl_object_store.hpp> #include <mbgl/util/uv_detail.hpp> #include <mbgl/util/worker.hpp> diff --git a/src/mbgl/map/tile_worker.cpp b/src/mbgl/map/tile_worker.cpp index 8c1115170d..effb90a73d 100644 --- a/src/mbgl/map/tile_worker.cpp +++ b/src/mbgl/map/tile_worker.cpp @@ -4,7 +4,7 @@ #include <mbgl/style/style.hpp> #include <mbgl/style/style_layer.hpp> #include <mbgl/style/style_bucket_parameters.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/geometry/glyph_atlas.hpp> #include <mbgl/renderer/symbol_bucket.hpp> #include <mbgl/platform/log.hpp> diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index 140ab2991c..284bed3705 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -13,7 +13,7 @@ #include <mbgl/layer/background_layer.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/geometry/line_atlas.hpp> #include <mbgl/geometry/glyph_atlas.hpp> diff --git a/src/mbgl/renderer/painter_circle.cpp b/src/mbgl/renderer/painter_circle.cpp index 708064bf89..67c23f8615 100644 --- a/src/mbgl/renderer/painter_circle.cpp +++ b/src/mbgl/renderer/painter_circle.cpp @@ -3,7 +3,6 @@ #include <mbgl/layer/circle_layer.hpp> -#include <mbgl/map/sprite.hpp> #include <mbgl/map/tile_id.hpp> #include <mbgl/map/map_data.hpp> diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp index d9e069d4e8..4bee5b6d1e 100644 --- a/src/mbgl/renderer/painter_fill.cpp +++ b/src/mbgl/renderer/painter_fill.cpp @@ -1,9 +1,8 @@ #include <mbgl/renderer/painter.hpp> #include <mbgl/renderer/fill_bucket.hpp> #include <mbgl/layer/fill_layer.hpp> -#include <mbgl/map/sprite.hpp> #include <mbgl/map/tile_id.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/shader/outline_shader.hpp> #include <mbgl/shader/pattern_shader.hpp> #include <mbgl/shader/plain_shader.hpp> diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index cfc85fcb48..e33864622e 100644 --- a/src/mbgl/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp @@ -1,13 +1,12 @@ #include <mbgl/renderer/painter.hpp> #include <mbgl/renderer/line_bucket.hpp> #include <mbgl/layer/line_layer.hpp> -#include <mbgl/map/sprite.hpp> #include <mbgl/map/tile_id.hpp> #include <mbgl/map/map_data.hpp> #include <mbgl/shader/line_shader.hpp> #include <mbgl/shader/linesdf_shader.hpp> #include <mbgl/shader/linepattern_shader.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/geometry/line_atlas.hpp> #include <mbgl/util/mat2.hpp> diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp index 343c9d5233..f46a9c8454 100644 --- a/src/mbgl/renderer/painter_symbol.cpp +++ b/src/mbgl/renderer/painter_symbol.cpp @@ -2,7 +2,7 @@ #include <mbgl/renderer/symbol_bucket.hpp> #include <mbgl/layer/symbol_layer.hpp> #include <mbgl/geometry/glyph_atlas.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/shader/sdf_shader.hpp> #include <mbgl/shader/icon_shader.hpp> #include <mbgl/shader/box_shader.hpp> diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index ee42d7f47e..1071fdcce9 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -1,11 +1,12 @@ #include <mbgl/renderer/symbol_bucket.hpp> #include <mbgl/layer/symbol_layer.hpp> #include <mbgl/map/geometry_tile.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite.hpp> +#include <mbgl/sprite/sprite_image.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/geometry/text_buffer.hpp> #include <mbgl/geometry/icon_buffer.hpp> #include <mbgl/geometry/glyph_atlas.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> #include <mbgl/geometry/anchor.hpp> #include <mbgl/text/get_anchors.hpp> #include <mbgl/renderer/painter.hpp> @@ -16,7 +17,6 @@ #include <mbgl/shader/sdf_shader.hpp> #include <mbgl/shader/icon_shader.hpp> #include <mbgl/shader/box_shader.hpp> -#include <mbgl/map/sprite.hpp> #include <mbgl/util/utf.hpp> #include <mbgl/util/token.hpp> diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/sprite/sprite.cpp index 518979c5f0..881a6ff8ed 100644 --- a/src/mbgl/map/sprite.cpp +++ b/src/mbgl/sprite/sprite.cpp @@ -1,5 +1,4 @@ -#include <mbgl/map/sprite.hpp> - +#include <mbgl/sprite/sprite.hpp> #include <mbgl/platform/log.hpp> #include <mbgl/platform/platform.hpp> #include <mbgl/storage/file_source.hpp> diff --git a/src/mbgl/map/sprite.hpp b/src/mbgl/sprite/sprite.hpp index cd82460a12..d204b42e85 100644 --- a/src/mbgl/map/sprite.hpp +++ b/src/mbgl/sprite/sprite.hpp @@ -1,7 +1,7 @@ -#ifndef MBGL_STYLE_SPRITE -#define MBGL_STYLE_SPRITE +#ifndef MBGL_SPRITE +#define MBGL_SPRITE -#include <mbgl/annotation/sprite_parser.hpp> +#include <mbgl/sprite/sprite_parser.hpp> #include <mbgl/util/image.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/ptr.hpp> diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp index 743848d5f2..22c2ba8b95 100644 --- a/src/mbgl/geometry/sprite_atlas.cpp +++ b/src/mbgl/sprite/sprite_atlas.cpp @@ -1,5 +1,5 @@ -#include <mbgl/geometry/sprite_atlas.hpp> -#include <mbgl/annotation/sprite_store.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_store.hpp> #include <mbgl/platform/gl.hpp> #include <mbgl/platform/log.hpp> #include <mbgl/platform/platform.hpp> @@ -10,7 +10,7 @@ #include <mbgl/util/scaling.hpp> #include <mbgl/util/thread_context.hpp> -#include <mbgl/map/sprite.hpp> +#include <mbgl/sprite/sprite.hpp> #include <cassert> #include <cmath> diff --git a/src/mbgl/geometry/sprite_atlas.hpp b/src/mbgl/sprite/sprite_atlas.hpp index 2e794f651b..0d86279e2d 100644 --- a/src/mbgl/geometry/sprite_atlas.hpp +++ b/src/mbgl/sprite/sprite_atlas.hpp @@ -1,5 +1,5 @@ -#ifndef MBGL_GEOMETRY_SPRITE_ATLAS -#define MBGL_GEOMETRY_SPRITE_ATLAS +#ifndef MBGL_SPRITE_ATLAS +#define MBGL_SPRITE_ATLAS #include <mbgl/geometry/binpack.hpp> #include <mbgl/platform/gl.hpp> diff --git a/src/mbgl/annotation/sprite_image.cpp b/src/mbgl/sprite/sprite_image.cpp index e482d8f13f..d5e4a7828e 100644 --- a/src/mbgl/annotation/sprite_image.cpp +++ b/src/mbgl/sprite/sprite_image.cpp @@ -1,4 +1,4 @@ -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/util/exception.hpp> diff --git a/src/mbgl/annotation/sprite_parser.cpp b/src/mbgl/sprite/sprite_parser.cpp index acd93b47ce..a8ed4f0e12 100644 --- a/src/mbgl/annotation/sprite_parser.cpp +++ b/src/mbgl/sprite/sprite_parser.cpp @@ -1,5 +1,5 @@ -#include <mbgl/annotation/sprite_parser.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_parser.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/platform/log.hpp> diff --git a/src/mbgl/annotation/sprite_parser.hpp b/src/mbgl/sprite/sprite_parser.hpp index c5856ebbc7..d385d77aea 100644 --- a/src/mbgl/annotation/sprite_parser.hpp +++ b/src/mbgl/sprite/sprite_parser.hpp @@ -1,5 +1,5 @@ -#ifndef MBGL_ANNOTATIONS_SPRITE_PARSER -#define MBGL_ANNOTATIONS_SPRITE_PARSER +#ifndef MBGL_SPRITE_PARSER +#define MBGL_SPRITE_PARSER #include <mapbox/variant.hpp> diff --git a/src/mbgl/annotation/sprite_store.cpp b/src/mbgl/sprite/sprite_store.cpp index 8d2231a2b7..fb6833114e 100644 --- a/src/mbgl/annotation/sprite_store.cpp +++ b/src/mbgl/sprite/sprite_store.cpp @@ -1,4 +1,4 @@ -#include <mbgl/annotation/sprite_store.hpp> +#include <mbgl/sprite/sprite_store.hpp> #include <mbgl/platform/log.hpp> diff --git a/src/mbgl/annotation/sprite_store.hpp b/src/mbgl/sprite/sprite_store.hpp index 78e02ac695..ed903f074b 100644 --- a/src/mbgl/annotation/sprite_store.hpp +++ b/src/mbgl/sprite/sprite_store.hpp @@ -1,7 +1,7 @@ -#ifndef MBGL_ANNOTATION_SPRITE_STORE -#define MBGL_ANNOTATION_SPRITE_STORE +#ifndef MBGL_SPRITE_STORE +#define MBGL_SPRITE_STORE -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/util/noncopyable.hpp> #include <mbgl/util/geo.hpp> diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 5509447275..acf4752e07 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -1,9 +1,10 @@ #include <mbgl/style/style.hpp> -#include <mbgl/map/sprite.hpp> #include <mbgl/map/map_data.hpp> #include <mbgl/map/source.hpp> #include <mbgl/map/transform_state.hpp> -#include <mbgl/annotation/sprite_store.hpp> +#include <mbgl/sprite/sprite.hpp> +#include <mbgl/sprite/sprite_store.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> #include <mbgl/style/style_layer.hpp> #include <mbgl/style/style_parser.hpp> #include <mbgl/style/property_transition.hpp> @@ -11,7 +12,6 @@ #include <mbgl/style/style_cascade_parameters.hpp> #include <mbgl/style/style_calculation_parameters.hpp> #include <mbgl/geometry/glyph_atlas.hpp> -#include <mbgl/geometry/sprite_atlas.hpp> #include <mbgl/geometry/line_atlas.hpp> #include <mbgl/util/constants.hpp> #include <mbgl/platform/log.hpp> diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 412107b737..837703e264 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -5,7 +5,7 @@ #include <mbgl/style/zoom_history.hpp> #include <mbgl/map/source.hpp> -#include <mbgl/map/sprite.hpp> +#include <mbgl/sprite/sprite.hpp> #include <mbgl/text/glyph_store.hpp> #include <mbgl/util/ptr.hpp> diff --git a/test/miscellaneous/custom_sprites.cpp b/test/sprite/custom_sprites.cpp index a72119ea61..98d173ea2d 100644 --- a/test/miscellaneous/custom_sprites.cpp +++ b/test/sprite/custom_sprites.cpp @@ -4,7 +4,7 @@ #include <mbgl/map/map.hpp> #include <mbgl/map/still_image.hpp> #include <mbgl/util/image.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/util/io.hpp> @@ -16,7 +16,7 @@ using namespace mbgl; -TEST(Headless, CustomSpriteImages) { +TEST(Sprite, CustomSpriteImages) { FixtureLog log; auto display = std::make_shared<mbgl::HeadlessDisplay>(); diff --git a/test/style/sprite.cpp b/test/sprite/sprite.cpp index 1c3f9b2271..7575cb3c9a 100644 --- a/test/style/sprite.cpp +++ b/test/sprite/sprite.cpp @@ -2,7 +2,7 @@ #include "../fixtures/mock_file_source.hpp" #include "../fixtures/util.hpp" -#include <mbgl/map/sprite.hpp> +#include <mbgl/sprite/sprite.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/thread.hpp> diff --git a/test/annotations/sprite_atlas.cpp b/test/sprite/sprite_atlas.cpp index 0eece6c47c..554ef16da9 100644 --- a/test/annotations/sprite_atlas.cpp +++ b/test/sprite/sprite_atlas.cpp @@ -1,15 +1,15 @@ #include "../fixtures/util.hpp" #include "../fixtures/fixture_log_observer.hpp" -#include <mbgl/geometry/sprite_atlas.hpp> -#include <mbgl/annotation/sprite_store.hpp> -#include <mbgl/annotation/sprite_parser.hpp> +#include <mbgl/sprite/sprite_atlas.hpp> +#include <mbgl/sprite/sprite_store.hpp> +#include <mbgl/sprite/sprite_parser.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/image.hpp> using namespace mbgl; -TEST(Annotations, SpriteAtlas) { +TEST(Sprite, SpriteAtlas) { FixtureLog log; auto spriteParseResult = parseSprite(util::read_file("test/fixtures/annotations/emerald.png"), @@ -86,7 +86,7 @@ TEST(Annotations, SpriteAtlas) { // util::compress_png(atlas.getTextureWidth(), atlas.getTextureHeight(), atlas.getData())); } -TEST(Annotations, SpriteAtlasSize) { +TEST(Sprite, SpriteAtlasSize) { auto spriteParseResult = parseSprite(util::read_file("test/fixtures/annotations/emerald.png"), util::read_file("test/fixtures/annotations/emerald.json")); @@ -123,7 +123,7 @@ TEST(Annotations, SpriteAtlasSize) { // util::compress_png(atlas.getTextureWidth(), atlas.getTextureHeight(), atlas.getData())); } -TEST(Annotations, SpriteAtlasUpdates) { +TEST(Sprite, SpriteAtlasUpdates) { SpriteStore store; SpriteAtlas atlas(32, 32, 1, store); diff --git a/test/annotations/sprite_image.cpp b/test/sprite/sprite_image.cpp index 9c5ca79ac9..8bc88fcc84 100644 --- a/test/annotations/sprite_image.cpp +++ b/test/sprite/sprite_image.cpp @@ -1,11 +1,11 @@ #include "../fixtures/util.hpp" -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/util/exception.hpp> using namespace mbgl; -TEST(Annotations, SpriteImageZeroWidth) { +TEST(Sprite, SpriteImageZeroWidth) { try { SpriteImage(0, 16, 2, ""); FAIL() << "Expected exception"; @@ -14,7 +14,7 @@ TEST(Annotations, SpriteImageZeroWidth) { } } -TEST(Annotations, SpriteImageZeroHeight) { +TEST(Sprite, SpriteImageZeroHeight) { try { SpriteImage(16, 0, 2, ""); FAIL() << "Expected exception"; @@ -23,7 +23,7 @@ TEST(Annotations, SpriteImageZeroHeight) { } } -TEST(Annotations, SpriteImageZeroRatio) { +TEST(Sprite, SpriteImageZeroRatio) { try { SpriteImage(16, 16, 0, ""); FAIL() << "Expected exception"; @@ -32,7 +32,7 @@ TEST(Annotations, SpriteImageZeroRatio) { } } -TEST(Annotations, SpriteImageMismatchedData) { +TEST(Sprite, SpriteImageMismatchedData) { try { SpriteImage(16, 16, 2, ""); FAIL() << "Expected exception"; @@ -41,7 +41,7 @@ TEST(Annotations, SpriteImageMismatchedData) { } } -TEST(Annotations, SpriteImage) { +TEST(Sprite, SpriteImage) { std::string pixels(32 * 24 * 4, '\0'); SpriteImage sprite(16, 12, 2, std::move(pixels)); EXPECT_EQ(16, sprite.width); @@ -52,7 +52,7 @@ TEST(Annotations, SpriteImage) { EXPECT_EQ(32u * 24 * 4, sprite.data.size()); } -TEST(Annotations, SpriteImageFractionalRatio) { +TEST(Sprite, SpriteImageFractionalRatio) { std::string pixels(20 * 12 * 4, '\0'); SpriteImage sprite(13, 8, 1.5, std::move(pixels)); EXPECT_EQ(13, sprite.width); diff --git a/test/annotations/sprite_parser.cpp b/test/sprite/sprite_parser.cpp index d4c3f96d6a..c2e4df3c58 100644 --- a/test/annotations/sprite_parser.cpp +++ b/test/sprite/sprite_parser.cpp @@ -1,8 +1,8 @@ #include "../fixtures/util.hpp" #include "../fixtures/fixture_log_observer.hpp" -#include <mbgl/annotation/sprite_parser.hpp> -#include <mbgl/annotation/sprite_image.hpp> +#include <mbgl/sprite/sprite_parser.hpp> +#include <mbgl/sprite/sprite_image.hpp> #include <mbgl/util/image.hpp> #include <mbgl/util/io.hpp> @@ -10,7 +10,7 @@ using namespace mbgl; -TEST(Annotations, SpriteImageCreationInvalid) { +TEST(Sprite, SpriteImageCreationInvalid) { FixtureLog log; const util::Image image_1x(util::read_file("test/fixtures/annotations/emerald.png")); @@ -33,7 +33,7 @@ TEST(Annotations, SpriteImageCreationInvalid) { })); } -TEST(Annotations, SpriteImageCreation1x) { +TEST(Sprite, SpriteImageCreation1x) { const util::Image image_1x(util::read_file("test/fixtures/annotations/emerald.png")); ASSERT_TRUE(image_1x); ASSERT_EQ(200u, image_1x.getWidth()); @@ -73,7 +73,7 @@ TEST(Annotations, SpriteImageCreation1x) { } } -TEST(Annotations, SpriteImageCreation2x) { +TEST(Sprite, SpriteImageCreation2x) { const util::Image image_2x(util::read_file("test/fixtures/annotations/emerald@2x.png")); ASSERT_TRUE(image_2x); @@ -88,7 +88,7 @@ TEST(Annotations, SpriteImageCreation2x) { EXPECT_EQ(0x85F345098DD4F9E3u, test::crc64(sprite->data)); } -TEST(Annotations, SpriteImageCreation1_5x) { +TEST(Sprite, SpriteImageCreation1_5x) { const util::Image image_2x(util::read_file("test/fixtures/annotations/emerald@2x.png")); ASSERT_TRUE(image_2x); @@ -113,7 +113,7 @@ TEST(Annotations, SpriteImageCreation1_5x) { EXPECT_EQ(0x134A530C742DD141u, test::crc64(sprite2->data)); } -TEST(Annotations, SpriteParsing) { +TEST(Sprite, SpriteParsing) { const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); const auto json_1x = util::read_file("test/fixtures/annotations/emerald.json"); @@ -209,7 +209,7 @@ TEST(Annotations, SpriteParsing) { } } -TEST(Annotations, SpriteParsingInvalidJSON) { +TEST(Sprite, SpriteParsingInvalidJSON) { const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); const auto json_1x = R"JSON({ "image": " })JSON"; @@ -219,7 +219,7 @@ TEST(Annotations, SpriteParsingInvalidJSON) { std::string("Failed to parse JSON: Missing a closing quotation mark in string. at offset 13")); } -TEST(Annotations, SpriteParsingEmptyImage) { +TEST(Sprite, SpriteParsingEmptyImage) { FixtureLog log; const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); @@ -236,7 +236,7 @@ TEST(Annotations, SpriteParsingEmptyImage) { })); } -TEST(Annotations, SpriteParsingSimpleWidthHeight) { +TEST(Sprite, SpriteParsingSimpleWidthHeight) { FixtureLog log; const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); @@ -246,7 +246,7 @@ TEST(Annotations, SpriteParsingSimpleWidthHeight) { EXPECT_EQ(1u, images.size()); } -TEST(Annotations, SpriteParsingWidthTooBig) { +TEST(Sprite, SpriteParsingWidthTooBig) { FixtureLog log; const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); @@ -269,7 +269,7 @@ TEST(Annotations, SpriteParsingWidthTooBig) { })); } -TEST(Annotations, SpriteParsingNegativeWidth) { +TEST(Sprite, SpriteParsingNegativeWidth) { FixtureLog log; const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); @@ -292,7 +292,7 @@ TEST(Annotations, SpriteParsingNegativeWidth) { })); } -TEST(Annotations, SpriteParsingNullRatio) { +TEST(Sprite, SpriteParsingNullRatio) { FixtureLog log; const auto image_1x = util::read_file("test/fixtures/annotations/emerald.png"); diff --git a/test/annotations/sprite_store.cpp b/test/sprite/sprite_store.cpp index 16eaad2499..17fce62a2b 100644 --- a/test/annotations/sprite_store.cpp +++ b/test/sprite/sprite_store.cpp @@ -1,11 +1,11 @@ #include "../fixtures/util.hpp" #include "../fixtures/fixture_log_observer.hpp" -#include <mbgl/annotation/sprite_store.hpp> +#include <mbgl/sprite/sprite_store.hpp> using namespace mbgl; -TEST(Annotations, SpriteStore) { +TEST(Sprite, SpriteStore) { FixtureLog log; const auto sprite1 = std::make_shared<SpriteImage>(8, 8, 2, std::string(16 * 16 * 4, '\0')); @@ -71,7 +71,7 @@ TEST(Annotations, SpriteStore) { EXPECT_EQ(Sprites(), store.getDirty()); } -TEST(Annotations, SpriteStoreOtherPixelRatio) { +TEST(Sprite, SpriteStoreOtherPixelRatio) { FixtureLog log; const auto sprite1 = std::make_shared<SpriteImage>(8, 8, 1, std::string(8 * 8 * 4, '\0')); @@ -84,7 +84,7 @@ TEST(Annotations, SpriteStoreOtherPixelRatio) { EXPECT_EQ(Sprites({ { "one", sprite1 } }), store.getDirty()); } -TEST(Annotations, SpriteStoreMultiple) { +TEST(Sprite, SpriteStoreMultiple) { const auto sprite1 = std::make_shared<SpriteImage>(8, 8, 2, std::string(16 * 16 * 4, '\0')); const auto sprite2 = std::make_shared<SpriteImage>(8, 8, 2, std::string(16 * 16 * 4, '\0')); @@ -101,7 +101,7 @@ TEST(Annotations, SpriteStoreMultiple) { EXPECT_EQ(Sprites(), store.getDirty()); } -TEST(Annotations, SpriteStoreReplace) { +TEST(Sprite, SpriteStoreReplace) { FixtureLog log; const auto sprite1 = std::make_shared<SpriteImage>(8, 8, 2, std::string(16 * 16 * 4, '\0')); @@ -118,7 +118,7 @@ TEST(Annotations, SpriteStoreReplace) { EXPECT_EQ(Sprites({ { "sprite", sprite2 } }), store.getDirty()); } -TEST(Annotations, SpriteStoreReplaceWithDifferentDimensions) { +TEST(Sprite, SpriteStoreReplaceWithDifferentDimensions) { FixtureLog log; const auto sprite1 = std::make_shared<SpriteImage>(8, 8, 2, std::string(16 * 16 * 4, '\0')); diff --git a/test/test.gypi b/test/test.gypi index 7c0b0d6c23..e9678b0754 100644 --- a/test/test.gypi +++ b/test/test.gypi @@ -39,11 +39,6 @@ 'miscellaneous/assert.cpp', - 'annotations/sprite_atlas.cpp', - 'annotations/sprite_image.cpp', - 'annotations/sprite_store.cpp', - 'annotations/sprite_parser.cpp', - 'api/annotations.cpp', 'api/api_misuse.cpp', 'api/repeated_render.cpp', @@ -54,7 +49,6 @@ 'miscellaneous/binpack.cpp', 'miscellaneous/bilinear.cpp', 'miscellaneous/comparisons.cpp', - 'miscellaneous/custom_sprites.cpp', 'miscellaneous/enums.cpp', 'miscellaneous/functions.cpp', 'miscellaneous/geo.cpp', @@ -91,7 +85,13 @@ 'style/glyph_store.cpp', 'style/pending_resources.cpp', 'style/resource_loading.cpp', - 'style/sprite.cpp', + + 'sprite/sprite.cpp', + 'sprite/sprite_atlas.cpp', + 'sprite/sprite_image.cpp', + 'sprite/sprite_parser.cpp', + 'sprite/sprite_store.cpp', + 'sprite/custom_sprites.cpp', ], 'libraries': [ '<@(gtest_static_libs)', |