diff --git a/include/mbgl/annotation/sprite_image.hpp b/include/mbgl/sprite/sprite_image.hpp similarity index 92% rename from include/mbgl/annotation/sprite_image.hpp rename to include/mbgl/sprite/sprite_image.hpp index 7d8ea0501..f36ec5e28 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 #include diff --git a/platform/android/jni.cpp b/platform/android/jni.cpp index 707b0ac9e..1e4c4c05f 100644 --- a/platform/android/jni.cpp +++ b/platform/android/jni.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 6a5524d2c..71c808ddb 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index a097e4932..750f3fabb 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 75f195a3f..dedfff02d 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include @@ -12,10 +11,11 @@ #include #include -#include - #include +#include +#include + #include #include #include diff --git a/src/mbgl/map/tile_worker.cpp b/src/mbgl/map/tile_worker.cpp index 8c1115170..effb90a73 100644 --- a/src/mbgl/map/tile_worker.cpp +++ b/src/mbgl/map/tile_worker.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index 140ab2991..284bed370 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include diff --git a/src/mbgl/renderer/painter_circle.cpp b/src/mbgl/renderer/painter_circle.cpp index 708064bf8..67c23f861 100644 --- a/src/mbgl/renderer/painter_circle.cpp +++ b/src/mbgl/renderer/painter_circle.cpp @@ -3,7 +3,6 @@ #include -#include #include #include diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp index d9e069d4e..4bee5b6d1 100644 --- a/src/mbgl/renderer/painter_fill.cpp +++ b/src/mbgl/renderer/painter_fill.cpp @@ -1,9 +1,8 @@ #include #include #include -#include #include -#include +#include #include #include #include diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index cfc85fcb4..e33864622 100644 --- a/src/mbgl/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp @@ -1,13 +1,12 @@ #include #include #include -#include #include #include #include #include #include -#include +#include #include #include diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp index 343c9d523..f46a9c845 100644 --- a/src/mbgl/renderer/painter_symbol.cpp +++ b/src/mbgl/renderer/painter_symbol.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index ee42d7f47..1071fdcce 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -1,11 +1,12 @@ #include #include #include -#include +#include +#include +#include #include #include #include -#include #include #include #include @@ -16,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/sprite/sprite.cpp similarity index 99% rename from src/mbgl/map/sprite.cpp rename to src/mbgl/sprite/sprite.cpp index 518979c5f..881a6ff8e 100644 --- a/src/mbgl/map/sprite.cpp +++ b/src/mbgl/sprite/sprite.cpp @@ -1,5 +1,4 @@ -#include - +#include #include #include #include diff --git a/src/mbgl/map/sprite.hpp b/src/mbgl/sprite/sprite.hpp similarity index 91% rename from src/mbgl/map/sprite.hpp rename to src/mbgl/sprite/sprite.hpp index cd82460a1..d204b42e8 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 +#include #include #include #include diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/sprite/sprite_atlas.cpp similarity index 98% rename from src/mbgl/geometry/sprite_atlas.cpp rename to src/mbgl/sprite/sprite_atlas.cpp index 743848d5f..22c2ba8b9 100644 --- a/src/mbgl/geometry/sprite_atlas.cpp +++ b/src/mbgl/sprite/sprite_atlas.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include #include @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/src/mbgl/geometry/sprite_atlas.hpp b/src/mbgl/sprite/sprite_atlas.hpp similarity index 97% rename from src/mbgl/geometry/sprite_atlas.hpp rename to src/mbgl/sprite/sprite_atlas.hpp index 2e794f651..0d86279e2 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 #include diff --git a/src/mbgl/annotation/sprite_image.cpp b/src/mbgl/sprite/sprite_image.cpp similarity index 94% rename from src/mbgl/annotation/sprite_image.cpp rename to src/mbgl/sprite/sprite_image.cpp index e482d8f13..d5e4a7828 100644 --- a/src/mbgl/annotation/sprite_image.cpp +++ b/src/mbgl/sprite/sprite_image.cpp @@ -1,4 +1,4 @@ -#include +#include #include diff --git a/src/mbgl/annotation/sprite_parser.cpp b/src/mbgl/sprite/sprite_parser.cpp similarity index 98% rename from src/mbgl/annotation/sprite_parser.cpp rename to src/mbgl/sprite/sprite_parser.cpp index acd93b47c..a8ed4f0e1 100644 --- a/src/mbgl/annotation/sprite_parser.cpp +++ b/src/mbgl/sprite/sprite_parser.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include diff --git a/src/mbgl/annotation/sprite_parser.hpp b/src/mbgl/sprite/sprite_parser.hpp similarity index 93% rename from src/mbgl/annotation/sprite_parser.hpp rename to src/mbgl/sprite/sprite_parser.hpp index c5856ebbc..d385d77ae 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 diff --git a/src/mbgl/annotation/sprite_store.cpp b/src/mbgl/sprite/sprite_store.cpp similarity index 97% rename from src/mbgl/annotation/sprite_store.cpp rename to src/mbgl/sprite/sprite_store.cpp index 8d2231a2b..fb6833114 100644 --- a/src/mbgl/annotation/sprite_store.cpp +++ b/src/mbgl/sprite/sprite_store.cpp @@ -1,4 +1,4 @@ -#include +#include #include diff --git a/src/mbgl/annotation/sprite_store.hpp b/src/mbgl/sprite/sprite_store.hpp similarity index 91% rename from src/mbgl/annotation/sprite_store.hpp rename to src/mbgl/sprite/sprite_store.hpp index 78e02ac69..ed903f074 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 +#include #include #include diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 550944727..acf4752e0 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include -#include +#include +#include +#include #include #include #include @@ -11,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index 412107b73..837703e26 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/test/miscellaneous/custom_sprites.cpp b/test/sprite/custom_sprites.cpp similarity index 95% rename from test/miscellaneous/custom_sprites.cpp rename to test/sprite/custom_sprites.cpp index a72119ea6..98d173ea2 100644 --- a/test/miscellaneous/custom_sprites.cpp +++ b/test/sprite/custom_sprites.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include @@ -16,7 +16,7 @@ using namespace mbgl; -TEST(Headless, CustomSpriteImages) { +TEST(Sprite, CustomSpriteImages) { FixtureLog log; auto display = std::make_shared(); diff --git a/test/style/sprite.cpp b/test/sprite/sprite.cpp similarity index 99% rename from test/style/sprite.cpp rename to test/sprite/sprite.cpp index 1c3f9b227..7575cb3c9 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 +#include #include #include diff --git a/test/annotations/sprite_atlas.cpp b/test/sprite/sprite_atlas.cpp similarity index 96% rename from test/annotations/sprite_atlas.cpp rename to test/sprite/sprite_atlas.cpp index 0eece6c47..554ef16da 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 -#include -#include +#include +#include +#include #include #include 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 similarity index 84% rename from test/annotations/sprite_image.cpp rename to test/sprite/sprite_image.cpp index 9c5ca79ac..8bc88fcc8 100644 --- a/test/annotations/sprite_image.cpp +++ b/test/sprite/sprite_image.cpp @@ -1,11 +1,11 @@ #include "../fixtures/util.hpp" -#include +#include #include 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 similarity index 95% rename from test/annotations/sprite_parser.cpp rename to test/sprite/sprite_parser.cpp index d4c3f96d6..c2e4df3c5 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 -#include +#include +#include #include #include @@ -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 similarity index 94% rename from test/annotations/sprite_store.cpp rename to test/sprite/sprite_store.cpp index 16eaad249..17fce62a2 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 +#include using namespace mbgl; -TEST(Annotations, SpriteStore) { +TEST(Sprite, SpriteStore) { FixtureLog log; const auto sprite1 = std::make_shared(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(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(8, 8, 2, std::string(16 * 16 * 4, '\0')); const auto sprite2 = std::make_shared(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(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(8, 8, 2, std::string(16 * 16 * 4, '\0')); diff --git a/test/test.gypi b/test/test.gypi index 7c0b0d6c2..e9678b075 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)',