summaryrefslogtreecommitdiff
path: root/test/sprite
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-09-06 12:35:31 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-09-07 17:56:38 +0200
commitff0c895eaa9e8b0bbe5739550e54230b0286a757 (patch)
tree95292bbbfe49335eea14f9c0766077bf834d706a /test/sprite
parent426242fe412057e2a6572e100e652e31917da419 (diff)
downloadqtlocation-mapboxgl-ff0c895eaa9e8b0bbe5739550e54230b0286a757.tar.gz
[core] change bool wrap/repeating to enum class SpritePatternMode
Diffstat (limited to 'test/sprite')
-rw-r--r--test/sprite/sprite_atlas.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/sprite/sprite_atlas.cpp b/test/sprite/sprite_atlas.cpp
index d9f96d57d1..10bfbfa67f 100644
--- a/test/sprite/sprite_atlas.cpp
+++ b/test/sprite/sprite_atlas.cpp
@@ -45,7 +45,7 @@ TEST(Sprite, SpriteAtlas) {
// Image hasn't been created yet.
EXPECT_FALSE(atlas.getData());
- auto metro = *atlas.getImage("metro", false);
+ auto metro = *atlas.getImage("metro", SpritePatternMode::Single);
EXPECT_EQ(0, metro.pos.x);
EXPECT_EQ(0, metro.pos.y);
EXPECT_EQ(20, metro.pos.w);
@@ -58,7 +58,7 @@ TEST(Sprite, SpriteAtlas) {
EXPECT_TRUE(atlas.getData());
- auto pos = *atlas.getPosition("metro", false);
+ auto pos = *atlas.getPosition("metro", SpritePatternMode::Single);
EXPECT_DOUBLE_EQ(18, pos.size[0]);
EXPECT_DOUBLE_EQ(18, pos.size[1]);
EXPECT_DOUBLE_EQ(1.0f / 63, pos.tl[0]);
@@ -66,7 +66,7 @@ TEST(Sprite, SpriteAtlas) {
EXPECT_DOUBLE_EQ(19.0f / 63, pos.br[0]);
EXPECT_DOUBLE_EQ(19.0f / 112, pos.br[1]);
- auto missing = atlas.getImage("doesnotexist", false);
+ auto missing = atlas.getImage("doesnotexist", SpritePatternMode::Single);
EXPECT_FALSE(missing);
EXPECT_EQ(1u, log.count({
@@ -77,7 +77,7 @@ TEST(Sprite, SpriteAtlas) {
}));
// Different wrapping mode produces different image.
- auto metro2 = *atlas.getImage("metro", true);
+ auto metro2 = *atlas.getImage("metro", SpritePatternMode::Repeating);
EXPECT_EQ(20, metro2.pos.x);
EXPECT_EQ(0, metro2.pos.y);
EXPECT_EQ(20, metro2.pos.w);
@@ -101,7 +101,7 @@ TEST(Sprite, SpriteAtlasSize) {
EXPECT_EQ(89, atlas.getTextureWidth());
EXPECT_EQ(157, atlas.getTextureHeight());
- auto metro = *atlas.getImage("metro", false);
+ auto metro = *atlas.getImage("metro", SpritePatternMode::Single);
EXPECT_EQ(0, metro.pos.x);
EXPECT_EQ(0, metro.pos.y);
EXPECT_EQ(16, metro.pos.w);
@@ -128,7 +128,7 @@ TEST(Sprite, SpriteAtlasUpdates) {
EXPECT_EQ(32, atlas.getTextureHeight());
store.setSprite("one", std::make_shared<SpriteImage>(PremultipliedImage(16, 12), 1));
- auto one = *atlas.getImage("one", false);
+ auto one = *atlas.getImage("one", SpritePatternMode::Single);
EXPECT_EQ(0, one.pos.x);
EXPECT_EQ(0, one.pos.y);
EXPECT_EQ(20, one.pos.w);