diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-14 11:07:54 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-14 16:28:12 -0600 |
commit | 0351e9c3702b22ba6cbd74fb8b3c4874c93f61f8 (patch) | |
tree | 6ae31efaf7a7779d21236c3930a1d805bf3d81ad /test/sprite | |
parent | b18a4d6e7804a7f919cd038b50f8a77c748778b1 (diff) | |
download | qtlocation-mapboxgl-0351e9c3702b22ba6cbd74fb8b3c4874c93f61f8.tar.gz |
[core] Eliminate SpritePatternMode
Diffstat (limited to 'test/sprite')
-rw-r--r-- | test/sprite/sprite_atlas.test.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/sprite/sprite_atlas.test.cpp b/test/sprite/sprite_atlas.test.cpp index da8a781585..2c425a95d2 100644 --- a/test/sprite/sprite_atlas.test.cpp +++ b/test/sprite/sprite_atlas.test.cpp @@ -28,7 +28,7 @@ TEST(SpriteAtlas, Basic) { EXPECT_EQ(63u, atlas.getSize().width); EXPECT_EQ(112u, atlas.getSize().height); - auto metro = *atlas.getImage("metro", SpritePatternMode::Single); + auto metro = *atlas.getIcon("metro"); EXPECT_EQ(0, metro.pos.x); EXPECT_EQ(0, metro.pos.y); EXPECT_EQ(20, metro.pos.w); @@ -42,7 +42,7 @@ TEST(SpriteAtlas, Basic) { EXPECT_EQ(63u, atlas.getAtlasImage().size.width); EXPECT_EQ(112u, atlas.getAtlasImage().size.height); - auto pos = *atlas.getImage("metro", SpritePatternMode::Single); + auto pos = *atlas.getIcon("metro"); EXPECT_DOUBLE_EQ(18, pos.size[0]); EXPECT_DOUBLE_EQ(18, pos.size[1]); EXPECT_DOUBLE_EQ(1.0f / 63, pos.tl[0]); @@ -50,7 +50,7 @@ TEST(SpriteAtlas, Basic) { EXPECT_DOUBLE_EQ(19.0f / 63, pos.br[0]); EXPECT_DOUBLE_EQ(19.0f / 112, pos.br[1]); - auto missing = atlas.getImage("doesnotexist", SpritePatternMode::Single); + auto missing = atlas.getIcon("doesnotexist"); EXPECT_FALSE(missing); EXPECT_EQ(1u, log.count({ @@ -61,7 +61,7 @@ TEST(SpriteAtlas, Basic) { })); // Different wrapping mode produces different image. - auto metro2 = *atlas.getImage("metro", SpritePatternMode::Repeating); + auto metro2 = *atlas.getPattern("metro"); EXPECT_EQ(20, metro2.pos.x); EXPECT_EQ(0, metro2.pos.y); EXPECT_EQ(20, metro2.pos.w); @@ -81,7 +81,7 @@ TEST(SpriteAtlas, Size) { EXPECT_EQ(63u, atlas.getSize().width); EXPECT_EQ(112u, atlas.getSize().height); - auto metro = *atlas.getImage("metro", SpritePatternMode::Single); + auto metro = *atlas.getIcon("metro"); EXPECT_EQ(0, metro.pos.x); EXPECT_EQ(0, metro.pos.y); EXPECT_EQ(16, metro.pos.w); @@ -107,7 +107,7 @@ TEST(SpriteAtlas, Updates) { EXPECT_EQ(32u, atlas.getSize().height); atlas.setSprite("one", std::make_shared<SpriteImage>(PremultipliedImage({ 16, 12 }), 1)); - auto one = *atlas.getImage("one", SpritePatternMode::Single); + auto one = *atlas.getIcon("one"); EXPECT_EQ(0, one.pos.x); EXPECT_EQ(0, one.pos.y); EXPECT_EQ(20, one.pos.w); @@ -189,12 +189,12 @@ TEST(SpriteAtlas, RemoveReleasesBinPackRect) { const auto big = std::make_shared<SpriteImage>(PremultipliedImage({ 32, 32 }), 1); atlas.setSprite("big", big); - EXPECT_TRUE(atlas.getImage("big", SpritePatternMode::Single)); + EXPECT_TRUE(atlas.getIcon("big")); atlas.removeSprite("big"); atlas.setSprite("big", big); - EXPECT_TRUE(atlas.getImage("big", SpritePatternMode::Single)); + EXPECT_TRUE(atlas.getIcon("big")); EXPECT_EQ(big, atlas.getSprite("big")); EXPECT_TRUE(log.empty()); |