diff options
author | Anand Thakker <anandthakker@users.noreply.github.com> | 2017-04-06 15:29:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-06 15:29:59 -0400 |
commit | 693c9f3641b3189b4cd439049904c95a516ae609 (patch) | |
tree | 8341a16f57ff184a2fe9e085c490e8762eb206ce /test | |
parent | f9cc044357d60dd5cf15ba951384529f88802089 (diff) | |
download | qtlocation-mapboxgl-693c9f3641b3189b4cd439049904c95a516ae609.tar.gz |
[core] Add DDS support for {text,icon}-size (#8593)
* Update gl-js and generate style code
* Factor out packUint8Pair() helper function
* Draft implementation of DDS for {text,icon}-size
Ports https://github.com/mapbox/mapbox-gl-js/pull/4455
* Fix text-size/composite-function-line-placement test
* Refactor to PaintPropertyBinders-like strategy
* Dedupe gl::Program construction
* Use exponential function base for interpolation
* Dedupe coveringZoomStops method
* Fixup tests
* Fix CI errors (hidden within #if block)
Diffstat (limited to 'test')
-rw-r--r-- | test/gl/bucket.test.cpp | 2 | ||||
-rw-r--r-- | test/text/quads.test.cpp | 24 | ||||
-rw-r--r-- | test/tile/vector_tile.test.cpp | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp index 1ab6623122..5b66a0987f 100644 --- a/test/gl/bucket.test.cpp +++ b/test/gl/bucket.test.cpp @@ -31,7 +31,7 @@ TEST(Buckets, SymbolBucket) { bool sdfIcons = false; bool iconsNeedLinear = false; - SymbolBucket bucket { layout, {}, 0, sdfIcons, iconsNeedLinear }; + SymbolBucket bucket { layout, {}, 16.0f, 1.0f, 0, sdfIcons, iconsNeedLinear }; ASSERT_FALSE(bucket.hasIconData()); ASSERT_FALSE(bucket.hasTextData()); ASSERT_FALSE(bucket.hasCollisionBoxData()); diff --git a/test/text/quads.test.cpp b/test/text/quads.test.cpp index 42bc0f2048..18fbedc2dd 100644 --- a/test/text/quads.test.cpp +++ b/test/text/quads.test.cpp @@ -23,7 +23,7 @@ TEST(getIconQuads, normal) { Shaping shapedText; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 16.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.anchorPoint.x, 2); ASSERT_EQ(quad.anchorPoint.y, 3); @@ -61,7 +61,7 @@ TEST(getIconQuads, style) { { SymbolLayoutProperties::Evaluated layout; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.anchorPoint.x, 0); ASSERT_EQ(quad.anchorPoint.y, 0); @@ -84,7 +84,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 24.0f; layout.get<IconTextFit>() = IconTextFitType::Width; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 24.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -60); ASSERT_EQ(quad.tl.y, 0); @@ -102,7 +102,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 12.0f; layout.get<IconTextFit>() = IconTextFitType::Width; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -30); ASSERT_EQ(quad.tl.y, -5); @@ -124,7 +124,7 @@ TEST(getIconQuads, style) { layout.get<IconTextFitPadding>()[2] = 5.0f; layout.get<IconTextFitPadding>()[3] = 10.0f; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -40); ASSERT_EQ(quad.tl.y, -10); @@ -142,7 +142,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 24.0f; layout.get<IconTextFit>() = IconTextFitType::Height; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 24.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -30); ASSERT_EQ(quad.tl.y, -10); @@ -160,7 +160,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 12.0f; layout.get<IconTextFit>() = IconTextFitType::Height; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -20); ASSERT_EQ(quad.tl.y, -5); @@ -182,7 +182,7 @@ TEST(getIconQuads, style) { layout.get<IconTextFitPadding>()[2] = 5.0f; layout.get<IconTextFitPadding>()[3] = 10.0f; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -30); ASSERT_EQ(quad.tl.y, -10); @@ -200,7 +200,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 24.0f; layout.get<IconTextFit>() = IconTextFitType::Both; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 24.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -60); ASSERT_EQ(quad.tl.y, -10); @@ -218,7 +218,7 @@ TEST(getIconQuads, style) { layout.get<TextSize>() = 12.0f; layout.get<IconTextFit>() = IconTextFitType::Both; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -30); ASSERT_EQ(quad.tl.y, -5); @@ -240,7 +240,7 @@ TEST(getIconQuads, style) { layout.get<IconTextFitPadding>()[2] = 5.0f; layout.get<IconTextFitPadding>()[3] = 10.0f; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -40); ASSERT_EQ(quad.tl.y, -10); @@ -262,7 +262,7 @@ TEST(getIconQuads, style) { layout.get<IconTextFitPadding>()[2] = 10.0f; layout.get<IconTextFitPadding>()[3] = 15.0f; SymbolQuad quad = - getIconQuad(anchor, shapedIcon, line, layout, SymbolPlacementType::Point, shapedText); + getIconQuad(anchor, shapedIcon, line, layout, 12.0f, SymbolPlacementType::Point, shapedText); ASSERT_EQ(quad.tl.x, -45); ASSERT_EQ(quad.tl.y, -5); diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp index eb2b89d346..95d21418fd 100644 --- a/test/tile/vector_tile.test.cpp +++ b/test/tile/vector_tile.test.cpp @@ -64,7 +64,7 @@ TEST(VectorTile, Issue7615) { std::map< std::string, std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>(), - 0.0f, false, false); + 16.0f, 1.0f, 0.0f, false, false); // Simulate placement of a symbol layer. tile.onPlacement(GeometryTile::PlacementResult { |