16 {
19
20 static const struct PosTestDesc {
21 size_t offseta;
22 std::vector<SkSVGLength> xa, ya;
23
24 size_t offsetb;
25 std::vector<SkSVGLength> xb, yb;
26
27 std::vector<SkPoint> expected;
29 {
30 0, {}, {},
31 0, {}, {},
32
34 },
35
36 {
38 0, { }, {},
39
41 },
42 {
43 0, { }, {},
45
47 },
48 {
51
53 },
54 {
55 0, {
L( 1),
L(2) }, {},
57
58 { {10,
N}, {2,
N}, {
N,
N} }
59 },
60 {
61 0, {
L(1),
L( 2) }, {},
63
64 { {1,
N}, {20,
N}, {
N,
N} }
65 },
66 {
67 0, {
L(1),
L( 2),
L(3) }, {},
69
70 { {1,
N}, {20,
N}, {3,
N}, {
N,
N} }
71 },
72 {
73 0, {
L(1),
L(2),
L( 3) }, {},
75
76 { {1,
N}, {2,
N}, {30,
N}, {
N,
N} }
77 },
78 {
81
82 { {1,
N}, {
N,
N}, {30,
N}, {
N,
N} }
83 },
84
85
86 {
88 0, {}, { },
89
91 },
92 {
93 0, {}, { },
95
97 },
98 {
101
103 },
104 {
105 0, {}, {
L( 4),
L(5) },
107
108 { {
N,40}, {
N,5}, {
N,
N} }
109 },
110 {
111 0, {}, {
L(4),
L( 5) },
113
114 { {
N,4}, {
N,50}, {
N,
N} }
115 },
116 {
117 0, {}, {
L(4),
L( 5),
L(6) },
119
120 { {
N,4}, {
N,50}, {
N,6}, {
N,
N} }
121 },
122 {
123 0, {}, {
L(4),
L(5),
L( 6) },
125
126 { {
N,4}, {
N,5}, {
N,60}, {
N,
N} }
127 },
128 {
131
132 { {
N,4}, {
N,
N}, {
N,60}, {
N,
N} }
133 },
134
135 {
136 0, {
L( 1),
L(2)}, {
L( 4) },
137 0, {
L(10) }, {
L(40),
L(50) },
138
139 { {10,40}, {2,50}, {
N,
N} }
140 },
141 {
142 0, {
L(1),
L( 2),
L(3) }, {
L(4),
L( 5) },
143 1, {
L(20) }, {
L(50),
L(60) },
144
145 { {1,4}, {20,50}, {3,60}, {
N,
N} }
146 },
147 };
148
151
152 auto test = [&](
const PosTestDesc& tst) {
156
161
170 fmgr,
171 rp,
172 mapper,
173 lctx,
174 pctx,
175 {nullptr, nullptr},
176 shaping);
177
181
182 for (
size_t i = 0;
i < tst.expected.size(); ++
i) {
183 const auto& exp = tst.expected[
i];
184 auto pos =
i >= tst.offsetb ? pb.resolve(
i) : pa.resolve(
i);
185
188 }
189 };
190
191 for (
const auto& tst :
gTests) {
193 }
194}
static const TestCase gTests[]
#define REPORTER_ASSERT(r, cond,...)
static sk_sp< SkSVGTSpan > Make()
std::function< void(const SkSVGRenderContext &, const sk_sp< SkTextBlob > &, const SkPaint *, const SkPaint *)> ShapedTextCallback
static sk_sp< SkSVGText > Make()
sk_sp< Factory > BestAvailable()