Lines Matching refs:reporter

204 UNIX_ONLY_TEST(SkParagraph_SimpleParagraph, reporter) {
223 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
226 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
227 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
228 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
233 [&index, reporter]
235 REPORTER_ASSERT(reporter, index == 0);
236 REPORTER_ASSERT(reporter, style.getColor() == SK_ColorBLACK);
242 UNIX_ONLY_TEST(SkParagraph_Rounding_Off_LineBreaks, reporter) {
267 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
272 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
276 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(metrics.fWidth, fontSize * len, EPSILON2));
280 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderParagraph, reporter) {
344 REPORTER_ASSERT(reporter, boxes.size() == 1);
348 REPORTER_ASSERT(reporter, boxes.size() == 1);
356 REPORTER_ASSERT(reporter, boxes.size() == 7);
358 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 90.921f, EPSILON2));
359 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.top(), 50, EPSILON100));
360 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 90.921f + 50, EPSILON2));
361 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.bottom(), 100, EPSILON100));
363 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.left(), 231.343f, EPSILON2));
364 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.top(), 50, EPSILON100));
365 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.right(), 231.343f + 50, EPSILON2));
366 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.bottom(), 100, EPSILON100));
368 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[4].rect.left(), 281.343f, EPSILON2));
369 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[4].rect.top(), 0, EPSILON100));
370 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[4].rect.right(), 281.343f + 5, EPSILON2));
371 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[4].rect.bottom(), 50, EPSILON100));
373 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[6].rect.left(), 336.343f, EPSILON2));
374 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[6].rect.top(), 0, EPSILON100));
375 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[6].rect.right(), 336.343f + 5, EPSILON2));
376 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[6].rect.bottom(), 50, EPSILON100));
379 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBaselineParagraph, reporter) {
416 REPORTER_ASSERT(reporter, boxes.size() == 1);
417 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON2));
418 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
419 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON2));
420 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
428 REPORTER_ASSERT(reporter, boxes.size() == 1);
429 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 75.324f, EPSILON2));
430 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 14.226f, EPSILON100));
431 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f, EPSILON2));
432 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44.694f, EPSILON100));
435 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderAboveBaselineParagraph, reporter) {
472 REPORTER_ASSERT(reporter, boxes.size() == 1);
473 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON2));
474 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), -0.347f, EPSILON100));
475 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON2));
476 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 49.652f, EPSILON100));
484 REPORTER_ASSERT(reporter, boxes.size() == 1);
485 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 75.324f, EPSILON2));
486 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 25.531f, EPSILON100));
487 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f, EPSILON2));
488 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 56, EPSILON100));
491 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBelowBaselineParagraph, reporter) {
528 REPORTER_ASSERT(reporter, boxes.size() == 1);
529 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON2));
530 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 24, EPSILON100));
531 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON2));
532 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 74, EPSILON100));
540 REPORTER_ASSERT(reporter, boxes.size() == 1);
541 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 75.324f, EPSILON2));
542 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), -0.121f, EPSILON100));
543 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f, EPSILON2));
544 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 30.347f, EPSILON100));
547 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBottomParagraph, reporter) {
586 REPORTER_ASSERT(reporter, boxes.size() == 1);
587 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON50));
588 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
589 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON50));
590 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
594 REPORTER_ASSERT(reporter, boxes.size() == 1);
595 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0.5f, EPSILON50));
596 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 19.531f, EPSILON100));
597 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 16.097f, EPSILON50));
598 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
601 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderTopParagraph, reporter) {
640 REPORTER_ASSERT(reporter, boxes.size() == 1);
641 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON50));
642 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
643 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON50));
644 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
648 REPORTER_ASSERT(reporter, boxes.size() == 1);
649 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0.5f, EPSILON50));
650 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
651 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 16.097f, EPSILON50));
652 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 30.468f, EPSILON100));
655 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderMiddleParagraph, reporter) {
694 REPORTER_ASSERT(reporter, boxes.size() == 1);
695 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON50));
696 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
697 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f + 55, EPSILON50));
698 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
702 REPORTER_ASSERT(reporter, boxes.size() == 1);
703 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 75.324f, EPSILON50));
704 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 9.765f, EPSILON100));
705 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f, EPSILON50));
706 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 40.234f, EPSILON100));
709 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderIdeographicBaselineParagraph, reporter) {
747 REPORTER_ASSERT(reporter, boxes.size() == 1);
748 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 162.5f, EPSILON50));
749 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
750 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 162.5f + 55, EPSILON50));
751 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
755 REPORTER_ASSERT(reporter, boxes.size() == 1);
756 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 135.5f, EPSILON50));
757 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 4.703f, EPSILON100));
758 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 162.5f, EPSILON50));
759 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 42.065f, EPSILON100));
762 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderBreakParagraph, reporter) {
865 REPORTER_ASSERT(reporter, boxes.size() == 1);
869 REPORTER_ASSERT(reporter, boxes.size() == 1);
870 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 31.695f, EPSILON50));
871 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 218.531f, EPSILON100));
872 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 47.292f, EPSILON50));
873 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 249, EPSILON100));
880 REPORTER_ASSERT(reporter, boxes.size() == 30);
881 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 59.726f, EPSILON50));
882 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 26.378f, EPSILON100));
883 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 90.921f, EPSILON50));
884 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 56.847f, EPSILON100));
886 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[11].rect.left(), 606.343f, EPSILON20));
887 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[11].rect.top(), 38, EPSILON100));
888 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[11].rect.right(), 631.343f, EPSILON20));
889 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[11].rect.bottom(), 63, EPSILON100));
891 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[17].rect.left(), 0.5f, EPSILON50));
892 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[17].rect.top(), 63.5f, EPSILON100));
893 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[17].rect.right(), 50.5f, EPSILON50));
894 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[17].rect.bottom(), 113.5f, EPSILON100));
897 UNIX_ONLY_TEST(SkParagraph_InlinePlaceholderGetRectsParagraph, reporter) {
989 REPORTER_ASSERT(reporter, boxes.size() == 34);
990 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 90.921f, EPSILON50));
991 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
992 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 140.921f, EPSILON50));
993 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 50, EPSILON100));
995 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[16].rect.left(), 800.921f, EPSILON20));
996 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[16].rect.top(), 0, EPSILON100));
997 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[16].rect.right(), 850.921f, EPSILON20));
998 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[16].rect.bottom(), 50, EPSILON100));
1000 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[33].rect.left(), 503.382f, EPSILON10));
1001 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[33].rect.top(), 160, EPSILON100));
1002 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[33].rect.right(), 508.382f, EPSILON10));
1003 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[33].rect.bottom(), 180, EPSILON100));
1008 REPORTER_ASSERT(reporter, boxes.size() == 8);
1009 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 216.097f, EPSILON50));
1010 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 60, EPSILON100));
1011 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 290.921f, EPSILON50));
1012 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 120, EPSILON100));
1014 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 290.921f, EPSILON20));
1015 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.top(), 60, EPSILON100));
1016 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 340.921f, EPSILON20));
1017 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.bottom(), 120, EPSILON100));
1019 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.left(), 340.921f, EPSILON50));
1020 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.top(), 60, EPSILON100));
1021 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.right(), 345.921f, EPSILON50));
1022 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.bottom(), 120, EPSILON100));
1025 UNIX_ONLY_TEST(SkParagraph_SimpleRedParagraph, reporter) {
1044 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
1047 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1048 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
1049 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1054 [reporter, &index](TextRange textRange, const TextStyle& style, const TextLine::ClipContext& context) {
1055 REPORTER_ASSERT(reporter, index == 0);
1056 REPORTER_ASSERT(reporter, style.getColor() == SK_ColorRED);
1064 UNIX_ONLY_TEST(SkParagraph_RainbowParagraph, reporter) {
1131 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
1134 REPORTER_ASSERT(reporter, impl->runs().size() == 4);
1135 REPORTER_ASSERT(reporter, impl->styles().size() == 4);
1136 REPORTER_ASSERT(reporter, impl->lines().size() == 2);
1147 REPORTER_ASSERT(reporter, style.equals(text_style1));
1148 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text1));
1151 REPORTER_ASSERT(reporter, style.equals(text_style2));
1152 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text2));
1155 REPORTER_ASSERT(reporter, style.equals(text_style3));
1156 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text3));
1159 REPORTER_ASSERT(reporter, style.equals(text_style4));
1160 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text41));
1163 REPORTER_ASSERT(reporter, false);
1174 REPORTER_ASSERT(reporter, style.equals(text_style4));
1175 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text42));
1178 REPORTER_ASSERT(reporter, false);
1184 REPORTER_ASSERT(reporter, index == 5);
1187 UNIX_ONLY_TEST(SkParagraph_DefaultStyleParagraph, reporter) {
1207 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
1211 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1212 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1213 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
1219 REPORTER_ASSERT(reporter, style.equals(paragraph_style.getTextStyle()));
1220 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text));
1224 REPORTER_ASSERT(reporter, index == 1);
1227 UNIX_ONLY_TEST(SkParagraph_BoldParagraph, reporter) {
1253 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
1257 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1258 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1259 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
1265 REPORTER_ASSERT(reporter, style.equals(text_style));
1266 REPORTER_ASSERT(reporter, equal(impl->text().begin(), textRange, text));
1270 REPORTER_ASSERT(reporter, index == 1);
1273 UNIX_ONLY_TEST(SkParagraph_HeightOverrideParagraph, reporter) {
1299 REPORTER_ASSERT(reporter, impl->runs().size() == 5);
1300 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
1301 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1316 REPORTER_ASSERT(reporter, boxes.size() == 0ull);
1320 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1322 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 0, EPSILON100));
1323 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.top(), 92.805f, EPSILON5));
1324 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 43.843f, EPSILON100));
1325 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.bottom(), 165.495f, EPSILON5));
1328 UNIX_ONLY_TEST(SkParagraph_BasicHalfLeading, reporter) {
1360 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
1361 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1370 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1371 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1377 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(line_spacing1, line_spacing2));
1380 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[0].rect.bottom() - boxes[0].rect.bottom(), boxes[0].rect.top() - lineBoxes[0].rect.top()));
1381 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[1].rect.bottom() - boxes[1].rect.bottom(), boxes[1].rect.top() - lineBoxes[1].rect.top()));
1382 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[2].rect.bottom() - boxes[2].rect.bottom(), boxes[2].rect.top() - lineBoxes[2].rect.top()));
1385 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 0, EPSILON100));
1386 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 43.843f, EPSILON100));
1389 UNIX_ONLY_TEST(SkParagraph_NearZeroHeightMixedDistribution, reporter) {
1429 REPORTER_ASSERT(reporter, impl->runs().size() == 2);
1430 REPORTER_ASSERT(reporter, impl->styles().size() == 2); // paragraph style does not count
1431 REPORTER_ASSERT(reporter, impl->lines().size() == 1ull);
1439 REPORTER_ASSERT(reporter, boxes.size() == 1ull);
1440 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1472 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(glyphs_top, actual_glyphs_top, EPSILON20));
1473 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(glyphs_bottom, actual_glyphs_bottom, EPSILON20));
1475 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[0].rect.height(), line_bottom - line_top, EPSILON2));
1476 REPORTER_ASSERT(reporter, lineBoxes[0].rect.height() > 1);
1479 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
1482 UNIX_ONLY_TEST(SkParagraph_StrutHalfLeading, reporter) {
1522 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
1531 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1532 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1538 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(line_spacing1, line_spacing2));
1541 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[0].rect.bottom() - boxes[0].rect.bottom(), boxes[0].rect.top() - lineBoxes[0].rect.top()));
1542 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[1].rect.bottom() - boxes[1].rect.bottom(), boxes[1].rect.top() - lineBoxes[1].rect.top()));
1543 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[2].rect.bottom() - boxes[2].rect.bottom(), boxes[2].rect.top() - lineBoxes[2].rect.top()));
1546 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 0, EPSILON100));
1549 UNIX_ONLY_TEST(SkParagraph_TrimLeadingDistribution, reporter) {
1588 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1589 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1595 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(line_spacing1, line_spacing2, 1));
1598 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[0].rect.top(), boxes[0].rect.top()));
1600 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[2].rect.bottom(), boxes[2].rect.bottom()));
1606 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.top() - lineBoxes[1].rect.top(), halfLeading, epsilon));
1607 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(lineBoxes[1].rect.bottom() - boxes[1].rect.bottom(), halfLeading));
1608 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.top() - lineBoxes[2].rect.top(), halfLeading, epsilon));
1611 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.left(), 0, EPSILON100));
1612 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.right(), 43.843f, EPSILON100));
1615 UNIX_ONLY_TEST(SkParagraph_LeftAlignParagraph, reporter) {
1664 REPORTER_ASSERT(reporter, impl->text().size() == std::string{text}.length());
1665 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1666 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1667 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1668 REPORTER_ASSERT(reporter, impl->lines().size() == paragraph_style.getMaxLines());
1672 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].baseline(), 24.121f, epsilon));
1673 REPORTER_ASSERT(reporter,
1676 REPORTER_ASSERT(reporter,
1679 REPORTER_ASSERT(reporter,
1682 REPORTER_ASSERT(reporter,
1685 REPORTER_ASSERT(reporter,
1688 REPORTER_ASSERT(reporter,
1692 REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(0, 0).position == 0);
1693 REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(1, 1).position == 0);
1694 REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(1, 35).position == 68);
1695 REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(1, 70).position == 134);
1696 REPORTER_ASSERT(reporter, impl->getGlyphPositionAtCoordinate(2000, 35).position == 134);
1699 UNIX_ONLY_TEST(SkParagraph_RightAlignParagraph, reporter) {
1749 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1750 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1751 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1752 REPORTER_ASSERT(reporter, impl->lines().size() == paragraph_style.getMaxLines());
1756 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].baseline(), 24.121f, epsilon));
1757 REPORTER_ASSERT(reporter,
1760 REPORTER_ASSERT(reporter,
1763 REPORTER_ASSERT(reporter,
1766 REPORTER_ASSERT(reporter,
1769 REPORTER_ASSERT(reporter,
1776 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[0]), 0, epsilon));
1777 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[1]), 0, epsilon));
1778 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[2]), 0, epsilon));
1779 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[3]), 0, epsilon));
1780 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[13]), 0, epsilon));
1782 REPORTER_ASSERT(reporter,
1786 UNIX_ONLY_TEST(SkParagraph_CenterAlignParagraph, reporter) {
1835 REPORTER_ASSERT(reporter, impl->text().size() == std::string{text}.length());
1836 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1837 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1838 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1839 REPORTER_ASSERT(reporter, impl->lines().size() == paragraph_style.getMaxLines());
1843 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].baseline(), 24.121f, epsilon));
1844 REPORTER_ASSERT(reporter,
1847 REPORTER_ASSERT(reporter,
1850 REPORTER_ASSERT(reporter,
1853 REPORTER_ASSERT(reporter,
1856 REPORTER_ASSERT(reporter,
1863 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[0]), 0, epsilon));
1864 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[1]), 0, epsilon));
1865 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[2]), 0, epsilon));
1866 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[3]), 0, epsilon));
1867 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[13]), 0, epsilon));
1869 REPORTER_ASSERT(reporter,
1873 UNIX_ONLY_TEST(SkParagraph_JustifyAlignParagraph, reporter) {
1925 REPORTER_ASSERT(reporter, impl->text().size() == std::string{text}.length());
1926 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
1927 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
1928 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
1931 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].baseline(), 24.121f, EPSILON100));
1932 REPORTER_ASSERT(reporter,
1935 REPORTER_ASSERT(reporter,
1938 REPORTER_ASSERT(reporter,
1941 REPORTER_ASSERT(reporter,
1944 REPORTER_ASSERT(reporter,
1951 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[0]), 0, EPSILON100));
1952 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[1]), 0, EPSILON100));
1953 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[2]), 0, EPSILON100));
1954 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(impl->lines()[3]), 0, EPSILON100));
1956 REPORTER_ASSERT(reporter,
1961 UNIX_ONLY_TEST(SkParagraph_JustifyRTL, reporter) {
1997 REPORTER_ASSERT(reporter, calculate(line) > EPSILON100);
1999 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(calculate(line), 0, EPSILON100));
2005 REPORTER_ASSERT(reporter, !run.leftToRight());
2013 REPORTER_ASSERT(reporter, boxes.size() == 3);
2017 REPORTER_ASSERT(reporter, boxes.size() == 1);
2019 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 588, EPSILON100));
2020 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 130, EPSILON100));
2021 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 640, EPSILON100));
2022 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 156, EPSILON100));
2025 UNIX_ONLY_TEST(SkParagraph_JustifyRTLNewLine, reporter) {
2069 REPORTER_ASSERT(reporter, boxes.size() == 2ull);
2070 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 562, EPSILON100));
2071 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
2072 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 900, EPSILON100));
2073 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 26, EPSILON100));
2080 REPORTER_ASSERT(reporter, boxes.size() == 1ull);
2081 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 68, EPSILON100));
2082 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 130, EPSILON100));
2083 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 120, EPSILON100));
2084 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 156, EPSILON100));
2091 REPORTER_ASSERT(reporter, line.width() < TestCanvasWidth - 100);
2093 REPORTER_ASSERT(reporter,
2100 UNIX_ONLY_TEST(SkParagraph_LeadingSpaceRTL, reporter) {
2140 REPORTER_ASSERT(reporter, boxes.size() == 2ull);
2143 UNIX_ONLY_TEST(SkParagraph_DecorationsParagraph, reporter) {
2214 REPORTER_ASSERT(reporter, style.getDecorationType() == decoration);
2217 REPORTER_ASSERT(reporter, style.getDecorationStyle() ==
2219 REPORTER_ASSERT(reporter, style.getDecorationColor() == SK_ColorBLACK);
2220 REPORTER_ASSERT(reporter,
2224 REPORTER_ASSERT(reporter, style.getDecorationStyle() ==
2226 REPORTER_ASSERT(reporter, style.getDecorationColor() == SK_ColorBLUE);
2227 REPORTER_ASSERT(reporter,
2231 REPORTER_ASSERT(reporter, style.getDecorationStyle() ==
2233 REPORTER_ASSERT(reporter, style.getDecorationColor() == SK_ColorBLACK);
2234 REPORTER_ASSERT(reporter,
2239 REPORTER_ASSERT(reporter, style.getDecorationStyle() ==
2241 REPORTER_ASSERT(reporter, style.getDecorationColor() == SK_ColorBLACK);
2242 REPORTER_ASSERT(reporter,
2246 REPORTER_ASSERT(reporter, style.getDecorationStyle() ==
2248 REPORTER_ASSERT(reporter, style.getDecorationColor() == SK_ColorRED);
2249 REPORTER_ASSERT(reporter,
2253 REPORTER_ASSERT(reporter, false);
2264 UNIX_ONLY_TEST(SkParagraph_ItalicsParagraph, reporter) {
2296 REPORTER_ASSERT(reporter, impl->runs().size() == 3);
2297 REPORTER_ASSERT(reporter, impl->styles().size() == 3);
2298 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
2307 reporter,
2311 REPORTER_ASSERT(reporter,
2316 reporter,
2320 REPORTER_ASSERT(reporter, false);
2328 UNIX_ONLY_TEST(SkParagraph_ChineseParagraph, reporter) {
2366 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
2370 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
2371 REPORTER_ASSERT(reporter, impl->lines().size() == 7);
2372 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
2373 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
2377 UNIX_ONLY_TEST(SkParagraph_ArabicParagraph, reporter) {
2411 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
2415 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
2416 REPORTER_ASSERT(reporter, impl->lines().size() == 2);
2417 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
2418 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
2422 UNIX_ONLY_TEST(SkParagraph_ArabicRectsParagraph, reporter) {
2452 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
2461 REPORTER_ASSERT(reporter, boxes.size() == 1ull);
2463 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 538.548f, EPSILON100)); // DIFF: 510.09375
2464 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), -0.268f, EPSILON100));
2465 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 900, EPSILON100));
2466 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44, EPSILON100));
2473 UNIX_ONLY_TEST(SkParagraph_ArabicRectsLTRLeftAlignParagraph, reporter) {
2503 REPORTER_ASSERT(reporter, impl->runs().size() == 3);
2513 REPORTER_ASSERT(reporter, boxes.size() == 2ull);
2514 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 83.92f, EPSILON100)); // DIFF: 89.40625
2515 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), -0.27f, EPSILON100));
2516 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 105.16f, EPSILON100)); // DIFF: 121.87891
2517 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44, EPSILON100));
2521 UNIX_ONLY_TEST(SkParagraph_ArabicRectsLTRRightAlignParagraph, reporter) {
2551 REPORTER_ASSERT(reporter, impl->runs().size() == 3);
2561 REPORTER_ASSERT(reporter, boxes.size() == 2ull); // DIFF
2562 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 561.5f, EPSILON100)); // DIFF
2563 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), -0.27f, EPSILON100));
2564 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 582.74f, EPSILON100)); // DIFF
2565 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 44, EPSILON100));
2568 UNIX_ONLY_TEST(SkParagraph_GetGlyphPositionAtCoordinateParagraph, reporter) {
2605 REPORTER_ASSERT(reporter,
2607 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(-1, -1).position == 0);
2608 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(0, 0).position == 0);
2609 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(3, 3).position == 0);
2610 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(35, 1).position == 1);
2611 REPORTER_ASSERT(reporter,
2613 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(301, 2.2f).position == 11);
2614 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(302, 2.6f).position == 11);
2615 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(301, 2.1f).position == 11);
2616 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(100000, 20).position == 18);
2617 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(450, 20).position == 16);
2618 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(100000, 90).position == 36);
2619 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(-100000, 90).position == 18);
2620 REPORTER_ASSERT(reporter,
2622 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(1, 90).position == 18);
2623 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(1, 170).position == 36);
2624 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(10000, 180).position == 72);
2625 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(70, 180).position == 56);
2626 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(1, 270).position == 72);
2627 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(35, 90).position == 19);
2628 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(10000, 10000).position == 77);
2629 REPORTER_ASSERT(reporter, paragraph->getGlyphPositionAtCoordinate(85, 10000).position == 75);
2632 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeParagraph, reporter) {
2671 REPORTER_ASSERT(reporter, result.empty());
2676 REPORTER_ASSERT(reporter, result.size() == 1);
2677 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
2678 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
2679 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 28.417f, EPSILON100));
2680 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
2685 REPORTER_ASSERT(reporter, result.size() == 1);
2686 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 56.835f, EPSILON100));
2687 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
2688 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 177.97f, EPSILON100));
2689 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
2694 REPORTER_ASSERT(reporter, result.size() == 1);
2695 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 177.97f, EPSILON100));
2696 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
2697 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 507.031f, EPSILON100));
2698 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
2703 REPORTER_ASSERT(reporter, result.size() == 4);
2704 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 211.375f, EPSILON100));
2705 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 59.40625f, EPSILON100));
2706 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 463.623f, EPSILON100));
2707 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 118, EPSILON100));
2708 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.left(), 0, EPSILON100));
2709 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.top(), 236.406f, EPSILON100));
2710 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.right(), 142.089f, EPSILON100));
2711 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.bottom(), 295, EPSILON100));
2716 REPORTER_ASSERT(reporter, result.size() == 1);
2717 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 450.1875f, EPSILON20));
2718 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
2719 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 519.47266f, EPSILON20));
2720 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
2724 REPORTER_ASSERT(reporter, result.empty());
2728 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeTight, reporter) {
2768 REPORTER_ASSERT(reporter, result.empty());
2773 REPORTER_ASSERT(reporter, result.size() == 1);
2774 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
2775 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0, EPSILON100));
2776 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 16.898f, EPSILON100));
2777 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 74, EPSILON100));
2782 REPORTER_ASSERT(reporter, result.size() == 1);
2783 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 66.899f, EPSILON100));
2784 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0, EPSILON100));
2785 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 264.099f, EPSILON100));
2786 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 74, EPSILON100));
2791 REPORTER_ASSERT(reporter, result.size() == 2);
2792 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 264.099f, EPSILON100));
2793 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0, EPSILON100));
2794 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 595.085f, EPSILON50));
2795 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 74, EPSILON100));
2800 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingMiddle, reporter) {
2836 REPORTER_ASSERT(reporter, result.empty());
2842 REPORTER_ASSERT(reporter, result.size() == 1);
2843 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
2844 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2845 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 17.4296889f, EPSILON100));
2846 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 88.473305f, EPSILON100));
2851 REPORTER_ASSERT(reporter, result.size() == 1);
2852 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 67.429688f, EPSILON100));
2853 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2854 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 190.00781f, EPSILON100));
2855 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 88.473305f, EPSILON100));
2860 REPORTER_ASSERT(reporter, result.size() == 1);
2861 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.00781f, EPSILON20));
2862 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2863 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 508.0625f, EPSILON20));
2864 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 88.473305f, EPSILON100));
2869 REPORTER_ASSERT(reporter, result.size() == 8);
2871 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.00781f, EPSILON20));
2872 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 88.473305f, EPSILON100));
2873 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 525.687f, EPSILON20));
2874 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 168.47331f, EPSILON100));
2876 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 525.687f, EPSILON20));
2877 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 88.473305f, EPSILON100));
2878 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.02344f, EPSILON20));
2879 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 168.47331f, EPSILON100));
2881 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.left(), 0, EPSILON100));
2882 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.top(), 168.47331f, EPSILON100));
2883 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.right(), 531.574f, EPSILON20));
2884 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.bottom(), 248.47331f, EPSILON100));
2886 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.left(), 531.574f, EPSILON20));
2887 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.top(), 168.47331f, EPSILON100));
2888 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.right(), 570.02344f, EPSILON20));
2889 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.bottom(), 248.47331f, EPSILON100));
2891 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.left(), 0, EPSILON100));
2892 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.top(), 248.47331f, EPSILON100));
2893 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.right(), 570.02344f, EPSILON20));
2894 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.bottom(), 328.47333f, EPSILON100));
2896 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.left(), 0, EPSILON100));
2897 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.top(), 328.47333f, EPSILON100));
2898 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.right(), 570.02344f, EPSILON20));
2899 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.bottom(), 408.4733f, EPSILON100));
2904 REPORTER_ASSERT(reporter, result.size() == 2); // DIFF
2905 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 463.72656f, EPSILON20));
2906 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2907 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 530.23047f, EPSILON20));
2908 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 88.473305f, EPSILON100));
2910 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 530.23047f, EPSILON20));
2911 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 16.946615f, EPSILON100));
2912 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.02344f, EPSILON20));
2913 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 88.473305f, EPSILON100));
2917 REPORTER_ASSERT(reporter, result.empty());
2922 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingTop, reporter) {
2958 REPORTER_ASSERT(reporter, result.empty());
2964 REPORTER_ASSERT(reporter, result.size() == 1);
2965 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
2966 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2967 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 17.4296889f, EPSILON100));
2968 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 80, EPSILON100));
2973 REPORTER_ASSERT(reporter, result.size() == 1);
2974 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 67.429688f, EPSILON100));
2975 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2976 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 190.00781f, EPSILON100));
2977 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 80, EPSILON100));
2982 REPORTER_ASSERT(reporter, result.size() == 1);
2983 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.00781f, EPSILON100));
2984 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
2985 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 508.0625f, EPSILON50));
2986 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 80, EPSILON100));
2991 REPORTER_ASSERT(reporter, result.size() == 8);
2993 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.00781f, EPSILON100));
2994 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 80, EPSILON100));
2995 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 525.687f, EPSILON20));
2996 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 160, EPSILON100));
2998 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 525.687f, EPSILON20));
2999 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 80, EPSILON100));
3000 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.02344f, EPSILON20));
3001 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 160, EPSILON100));
3003 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.left(), 0, EPSILON100));
3004 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.top(), 160, EPSILON100));
3005 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.right(), 531.574f, EPSILON20));
3006 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.bottom(), 240, EPSILON100));
3008 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.left(), 531.574f, EPSILON20));
3009 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.top(), 160, EPSILON100));
3010 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.right(), 570.02344f, EPSILON20));
3011 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.bottom(), 240, EPSILON100));
3013 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.left(), 0, EPSILON100));
3014 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.top(), 240, EPSILON100));
3015 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.right(), 570.02344f, EPSILON20));
3016 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.bottom(), 320, EPSILON100));
3018 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.left(), 0, EPSILON100));
3019 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.top(), 320, EPSILON100));
3020 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.right(), 570.02344f, EPSILON20));
3021 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.bottom(), 400, EPSILON100));
3026 REPORTER_ASSERT(reporter, result.size() == 2); // DIFF
3027 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 463.72656f, EPSILON20));
3028 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946615f, EPSILON100));
3029 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 530.23047f, EPSILON20));
3030 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 80, EPSILON100));
3032 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 530.23047f, EPSILON50));
3033 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 16.946615f, EPSILON100));
3034 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.02344f, EPSILON20));
3035 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 80, EPSILON100));
3039 REPORTER_ASSERT(reporter, result.empty());
3044 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeIncludeLineSpacingBottom, reporter) {
3080 REPORTER_ASSERT(reporter, result.empty());
3086 REPORTER_ASSERT(reporter, result.size() == 1);
3087 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
3088 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946f, EPSILON100));
3089 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 17.429f, EPSILON100));
3090 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 96.946f, EPSILON100));
3095 REPORTER_ASSERT(reporter, result.size() == 1);
3096 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 67.4298f, EPSILON100));
3097 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946f, EPSILON100));
3098 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 190.007f, EPSILON100));
3099 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 96.946f, EPSILON100));
3104 REPORTER_ASSERT(reporter, result.size() == 1);
3105 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.007f, EPSILON100));
3106 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946f, EPSILON100));
3107 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 508.062f, EPSILON50));
3108 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 96.946f, EPSILON100));
3113 REPORTER_ASSERT(reporter, result.size() == 8);
3115 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 190.007f, EPSILON20));
3116 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 96.946f, EPSILON100));
3117 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 525.687f, EPSILON20));
3118 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 176.946f, EPSILON100));
3120 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 525.687f, EPSILON20));
3121 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 96.946f, EPSILON100));
3122 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.023f, EPSILON20));
3123 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 176.946f, EPSILON100));
3125 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.left(), 0, EPSILON20));
3126 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.top(), 176.946f, EPSILON100));
3127 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.right(), 531.574f, EPSILON20));
3128 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[2].rect.bottom(), 256.946f, EPSILON100));
3130 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.left(), 531.574f, EPSILON20));
3131 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.top(), 176.946f, EPSILON100));
3132 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.right(), 570.023f, EPSILON20));
3133 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[3].rect.bottom(), 256.946f, EPSILON100));
3135 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.left(), 0, EPSILON20));
3136 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.top(), 256.946f, EPSILON100));
3137 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.right(), 570.023f, EPSILON20));
3138 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[4].rect.bottom(), 336.946f, EPSILON100));
3140 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.left(), 0, EPSILON20));
3141 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.top(), 336.946f, EPSILON100));
3142 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.right(), 570.023f, EPSILON20));
3143 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[5].rect.bottom(), 416.946f, EPSILON100));
3148 REPORTER_ASSERT(reporter, result.size() == 2); // DIFF
3149 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 463.726f, EPSILON20));
3150 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 16.946f, EPSILON100));
3151 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 530.230f, EPSILON20));
3152 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 96.946f, EPSILON100));
3154 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.left(), 530.230f, EPSILON20));
3155 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.top(), 16.946f, EPSILON100));
3156 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.right(), 570.023f, EPSILON20));
3157 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[1].rect.bottom(), 96.946f, EPSILON100));
3161 REPORTER_ASSERT(reporter, result.empty());
3167 DEF_TEST_DISABLED(SkParagraph_GetRectsForRangeIncludeCombiningCharacter, reporter) {
3197 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
3203 REPORTER_ASSERT(reporter, result.empty());
3209 REPORTER_ASSERT(reporter, first.size() == 0 && second.size() == 1 && last.size() == 1);
3210 REPORTER_ASSERT(reporter, second[0].rect == last[0].rect);
3216 REPORTER_ASSERT(reporter, first.size() == 0 && second.size() == 1 && last.size() == 1);
3217 REPORTER_ASSERT(reporter, second[0].rect == last[0].rect);
3224 REPORTER_ASSERT(reporter, first.size() == 0 && second.size() == 0 && third.size() == 1 && last.size() == 1);
3225 REPORTER_ASSERT(reporter, third[0].rect == last[0].rect);
3230 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterParagraph, reporter) {
3268 REPORTER_ASSERT(reporter, result.empty());
3274 REPORTER_ASSERT(reporter, result.size() == 1);
3275 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 203.955f, EPSILON100));
3276 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3277 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 232.373f, EPSILON100));
3278 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3284 REPORTER_ASSERT(reporter, result.size() == 1);
3285 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 260.791f, EPSILON100));
3286 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3287 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 317.626f, EPSILON100));
3288 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3294 REPORTER_ASSERT(reporter, result.size() == 1);
3295 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 317.626f, EPSILON100));
3296 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3297 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 346.044f, EPSILON100));
3298 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3304 REPORTER_ASSERT(reporter, result.size() == 1); // DIFF
3305 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 317.626f, EPSILON100));
3306 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3307 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 358.494f, EPSILON100));
3308 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3314 REPORTER_ASSERT(reporter, result.size() == 1);
3315 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 346.044f, EPSILON100));
3316 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3317 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 358.494f, EPSILON100));
3318 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3323 REPORTER_ASSERT(reporter, result.empty());
3328 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterParagraphNewlineCentered, reporter) {
3359 REPORTER_ASSERT(reporter, impl->lines().size() == 2);
3365 REPORTER_ASSERT(reporter, result.empty());
3371 REPORTER_ASSERT(reporter, result.size() == 1);
3372 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 203.955f, EPSILON100));
3373 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, EPSILON100));
3374 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 232.373f, EPSILON100));
3375 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, EPSILON100));
3381 REPORTER_ASSERT(reporter, result.size() == 1);
3382 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 275.0f, EPSILON100));
3383 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 59.406f, EPSILON100));
3384 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 275.0f, EPSILON100));
3385 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 118, EPSILON100));
3390 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeCenterMultiLineParagraph, reporter) {
3422 REPORTER_ASSERT(reporter, impl->lines().size() == 2);
3429 REPORTER_ASSERT(reporter, result.empty());
3434 REPORTER_ASSERT(reporter, result.size() == 1);
3435 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 203.955f, epsilon));
3436 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, epsilon));
3437 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 232.373f, epsilon));
3438 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, epsilon));
3443 REPORTER_ASSERT(reporter, result.size() == 1);
3444 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 260.791f, epsilon));
3445 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, epsilon));
3446 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 317.626f, epsilon));
3447 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, epsilon));
3452 REPORTER_ASSERT(reporter, result.size() == 1);
3453 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 317.626f, epsilon));
3454 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, epsilon));
3455 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 358.494f, epsilon));
3456 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, epsilon));
3461 REPORTER_ASSERT(reporter, result.size() == 1);
3462 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 346.044f, epsilon));
3463 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 0.40625f, epsilon));
3464 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 358.494f, epsilon));
3465 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 59, epsilon));
3470 REPORTER_ASSERT(reporter, result.size() == 1);
3471 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 218.164f, epsilon));
3472 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 59.40625f, epsilon));
3473 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 275, epsilon));
3474 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 118, epsilon));
3479 REPORTER_ASSERT(reporter, result.size() == 1);
3480 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 331.835f, epsilon));
3481 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 59.40625f, epsilon));
3482 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 419.189f, epsilon));
3483 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 118, epsilon));
3487 REPORTER_ASSERT(reporter, result.empty());
3492 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeStrut, reporter) {
3524 REPORTER_ASSERT(reporter, result.size() == 1);
3530 REPORTER_ASSERT(reporter, result.size() == 1);
3531 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.left(), 0, EPSILON100));
3532 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.top(), 10.611f, EPSILON2));
3533 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.right(), 118.605f, EPSILON50));
3534 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(result[0].rect.bottom(), 27.017f, EPSILON2));
3539 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeStrutFallback, reporter) {
3569 REPORTER_ASSERT(reporter, result1.size() == 1);
3573 REPORTER_ASSERT(reporter, result2.size() == 1);
3575 REPORTER_ASSERT(reporter, result1[0].rect == result2[0].rect);
3579 UNIX_ONLY_TEST(SkParagraph_GetWordBoundaryParagraph, reporter) {
3608 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(0) == SkRange<size_t>(0, 5));
3609 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(1) == SkRange<size_t>(0, 5));
3610 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(2) == SkRange<size_t>(0, 5));
3611 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(3) == SkRange<size_t>(0, 5));
3612 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(4) == SkRange<size_t>(0, 5));
3616 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(5) == SkRange<size_t>(5, 7));
3620 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(6) == SkRange<size_t>(5, 7));
3624 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(7) == SkRange<size_t>(7, 12));
3625 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(8) == SkRange<size_t>(7, 12));
3626 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(9) == SkRange<size_t>(7, 12));
3627 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(10) == SkRange<size_t>(7, 12));
3628 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(11) == SkRange<size_t>(7, 12));
3629 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(12) == SkRange<size_t>(12, 13));
3630 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(13) == SkRange<size_t>(13, 18));
3631 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(30) == SkRange<size_t>(30, 31));
3651 REPORTER_ASSERT(reporter, paragraph->getWordBoundary(outLen - 1) == SkRange<size_t>(outLen - 5, outLen));
3655 UNIX_ONLY_TEST(SkParagraph_SpacingParagraph, reporter) {
3720 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
3727 REPORTER_ASSERT(reporter, index == 4);
3734 REPORTER_ASSERT(reporter, index == 4);
3738 UNIX_ONLY_TEST(SkParagraph_LongWordParagraph, reporter) {
3769 REPORTER_ASSERT(reporter, impl->text().size() == std::string{text}.length());
3770 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
3771 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
3772 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
3773 REPORTER_ASSERT(reporter, impl->lines().size() == 4);
3775 REPORTER_ASSERT(reporter, impl->lines()[0].width() > TestCanvasWidth / 2 - 20);
3776 REPORTER_ASSERT(reporter, impl->lines()[1].width() > TestCanvasWidth / 2 - 20);
3777 REPORTER_ASSERT(reporter, impl->lines()[2].width() > TestCanvasWidth / 2 - 20);
3781 UNIX_ONLY_TEST(SkParagraph_KernScaleParagraph, reporter) {
3817 REPORTER_ASSERT(reporter, impl->lines().size() == 3);
3818 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].width(), 285.858f, EPSILON100));
3819 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[1].width(), 329.709f, EPSILON100));
3820 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[2].width(), 120.619f, EPSILON100));
3821 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[0].height(), 39.00f, EPSILON100));
3822 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[1].height(), 39.00f, EPSILON100));
3823 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->lines()[2].height(), 05.00f, EPSILON100));
3827 UNIX_ONLY_TEST(SkParagraph_NewlineParagraph, reporter) {
3856 REPORTER_ASSERT(reporter, impl->lines().size() == 7);
3858 REPORTER_ASSERT(reporter, impl->lines()[0].offset().fY == 0);
3859 REPORTER_ASSERT(reporter, impl->lines()[1].offset().fY == 70);
3860 REPORTER_ASSERT(reporter, impl->lines()[2].offset().fY == 140);
3861 REPORTER_ASSERT(reporter, impl->lines()[3].offset().fY == 210);
3862 REPORTER_ASSERT(reporter, impl->lines()[4].offset().fY == 280); // Empty line
3863 REPORTER_ASSERT(reporter, impl->lines()[5].offset().fY == 350);
3864 REPORTER_ASSERT(reporter, impl->lines()[6].offset().fY == 420);
3868 UNIX_ONLY_TEST(SkParagraph_EmojiParagraph, reporter) {
3896 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
3900 REPORTER_ASSERT(reporter, impl->lines().size() == 8);
3903 REPORTER_ASSERT(reporter, line.width() == 998.25f);
3905 REPORTER_ASSERT(reporter, line.width() < 998.25f);
3907 REPORTER_ASSERT(reporter, line.height() == 59);
3912 UNIX_ONLY_TEST(SkParagraph_EmojiMultiLineRectsParagraph, reporter) {
3945 REPORTER_ASSERT(reporter, result.size() == 0);
3948 REPORTER_ASSERT(reporter, result.size() == 2);
3952 REPORTER_ASSERT(reporter, result.size() == 0);
3958 REPORTER_ASSERT(reporter, result.size() == 2);
3963 REPORTER_ASSERT(reporter, result.size() == 2);
3968 REPORTER_ASSERT(reporter, result.size() == 2);
3973 UNIX_ONLY_TEST(SkParagraph_RepeatLayoutParagraph, reporter) {
4001 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
4002 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
4003 REPORTER_ASSERT(reporter, impl->lines().size() == 12);
4007 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
4008 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
4009 REPORTER_ASSERT(reporter, impl->lines().size() == 6);
4013 UNIX_ONLY_TEST(SkParagraph_Ellipsize, reporter) {
4045 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
4048 REPORTER_ASSERT(reporter, line.ellipsis() != nullptr);
4049 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
4053 UNIX_ONLY_TEST(SkParagraph_UnderlineShiftParagraph, reporter) {
4096 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
4097 REPORTER_ASSERT(reporter, impl1->lines().size() == 1);
4105 REPORTER_ASSERT(reporter, rect.fLeft == rect1.fLeft);
4106 REPORTER_ASSERT(reporter, rect.fRight == rect1.fRight);
4113 REPORTER_ASSERT(reporter, r1.size() == r2.size());
4115 REPORTER_ASSERT(reporter, r1.front().rect.fLeft == r2.front().rect.fLeft);
4116 REPORTER_ASSERT(reporter, r1.front().rect.fRight == r2.front().rect.fRight);
4122 UNIX_ONLY_TEST(SkParagraph_SimpleShadow, reporter) {
4146 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
4147 REPORTER_ASSERT(reporter, impl->styles().size() == 1);
4152 REPORTER_ASSERT(reporter, index == 0 && style.equals(text_style));
4160 UNIX_ONLY_TEST(SkParagraph_ComplexShadow, reporter) {
4206 REPORTER_ASSERT(reporter, style.getShadowNumber() == 1);
4209 REPORTER_ASSERT(reporter, style.getShadowNumber() == 3);
4212 REPORTER_ASSERT(reporter, style.getShadowNumber() == 1);
4215 REPORTER_ASSERT(reporter, style.getShadowNumber() == 4);
4216 REPORTER_ASSERT(reporter, style.equals(text_style));
4219 REPORTER_ASSERT(reporter, style.getShadowNumber() == 1);
4222 REPORTER_ASSERT(reporter, false);
4230 UNIX_ONLY_TEST(SkParagraph_BaselineParagraph, reporter) {
4270 REPORTER_ASSERT(reporter,
4272 REPORTER_ASSERT(reporter,
4277 UNIX_ONLY_TEST(SkParagraph_FontFallbackParagraph, reporter) {
4335 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == -1); // Not shaped yet
4340 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 2); // From the text1 ("å­—å…¸" - excluding the last space)
4344 REPORTER_ASSERT(reporter, impl->runs().size() == 6 + spaceRun);
4355 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(robotoAdvance, 64.199f, EPSILON50));
4356 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->runs()[2 + spaceRun].advance().fX, 139.125f, EPSILON100));
4357 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->runs()[3 + spaceRun].advance().fX, 27.999f, EPSILON100));
4358 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->runs()[4 + spaceRun].advance().fX, 62.248f, EPSILON100));
4359 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(impl->runs()[5 + spaceRun].advance().fX, 27.999f, EPSILON100));
4362 REPORTER_ASSERT(reporter, impl->runs()[3 + spaceRun].correctAscent() != impl->runs()[5 + spaceRun].correctAscent());
4363 REPORTER_ASSERT(reporter, impl->runs()[3 + spaceRun].correctDescent() != impl->runs()[5 + spaceRun].correctDescent());
4367 UNIX_ONLY_TEST(SkParagraph_StrutParagraph1, reporter) {
4406 REPORTER_ASSERT(reporter, impl->lines().size() == 4);
4413 REPORTER_ASSERT(reporter, boxes.empty());
4418 REPORTER_ASSERT(reporter, boxes.size() == 1);
4419 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4420 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 34.5f, EPSILON100));
4421 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, EPSILON100));
4422 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 84.5f, EPSILON100));
4427 REPORTER_ASSERT(reporter, boxes.size() == 1);
4428 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4429 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
4430 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, EPSILON100));
4431 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 95, EPSILON100));
4436 REPORTER_ASSERT(reporter, boxes.size() == 1);
4437 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, EPSILON100));
4438 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 34.5f, EPSILON100));
4439 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, EPSILON100));
4440 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 84.5f, EPSILON100));
4445 REPORTER_ASSERT(reporter, boxes.size() == 1);
4446 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, EPSILON100));
4447 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
4448 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, EPSILON100));
4449 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 95, EPSILON100));
4454 REPORTER_ASSERT(reporter, boxes.size() == 1);
4455 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4456 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 190, EPSILON100));
4457 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 100, EPSILON100));
4458 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 285, EPSILON100));
4463 REPORTER_ASSERT(reporter, boxes.size() == 1);
4464 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 50, EPSILON100));
4465 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 285, EPSILON100));
4466 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 300, EPSILON100));
4467 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 380, EPSILON100));
4472 UNIX_ONLY_TEST(SkParagraph_StrutParagraph2, reporter) {
4513 REPORTER_ASSERT(reporter, impl->lines().size() == 4);
4520 REPORTER_ASSERT(reporter, boxes.empty());
4525 REPORTER_ASSERT(reporter, boxes.size() == 1);
4526 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4527 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 24, EPSILON100));
4528 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, EPSILON100));
4529 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 74, EPSILON100));
4534 REPORTER_ASSERT(reporter, boxes.size() == 1);
4535 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4536 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
4537 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, EPSILON100));
4538 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 80, EPSILON100));
4543 REPORTER_ASSERT(reporter, boxes.size() == 1);
4544 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, EPSILON100));
4545 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 24, EPSILON100));
4546 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, EPSILON100));
4547 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 74, EPSILON100));
4552 REPORTER_ASSERT(reporter, boxes.size() == 1);
4553 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, EPSILON100));
4554 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, EPSILON100));
4555 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, EPSILON100));
4556 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 80, EPSILON100));
4561 REPORTER_ASSERT(reporter, boxes.size() == 1);
4562 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4563 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 160, EPSILON100));
4564 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 100, EPSILON100));
4565 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 240, EPSILON100));
4570 REPORTER_ASSERT(reporter, boxes.size() == 1);
4571 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 50, EPSILON100));
4572 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 240, EPSILON100));
4573 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 300, EPSILON100));
4574 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 320, EPSILON100));
4579 UNIX_ONLY_TEST(SkParagraph_StrutParagraph3, reporter) {
4620 REPORTER_ASSERT(reporter, impl->lines().size() == 4);
4628 REPORTER_ASSERT(reporter, boxes.empty());
4633 REPORTER_ASSERT(reporter, boxes.size() == 1);
4634 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, epsilon));
4635 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 8, epsilon));
4636 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, epsilon));
4637 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 58, epsilon));
4642 REPORTER_ASSERT(reporter, boxes.size() == 1);
4643 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, epsilon));
4644 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, epsilon));
4645 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 50, epsilon));
4646 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 60, epsilon));
4651 REPORTER_ASSERT(reporter, boxes.size() == 1);
4652 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, epsilon));
4653 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 8, epsilon));
4654 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, epsilon));
4655 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 58, epsilon));
4660 REPORTER_ASSERT(reporter, boxes.size() == 1);
4661 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 300, epsilon));
4662 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 0, epsilon));
4663 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 500, epsilon));
4664 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 60, epsilon));
4669 REPORTER_ASSERT(reporter, boxes.size() == 1);
4670 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, epsilon));
4671 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 120, epsilon));
4672 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 100, epsilon));
4673 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 180, epsilon));
4678 REPORTER_ASSERT(reporter, boxes.size() == 1);
4679 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 50, epsilon));
4680 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 180, epsilon));
4681 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 300, epsilon));
4682 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 240, epsilon));
4687 UNIX_ONLY_TEST(SkParagraph_StrutForceParagraph, reporter) {
4727 REPORTER_ASSERT(reporter, impl->lines().size() == 4);
4734 REPORTER_ASSERT(reporter, boxes1.empty());
4738 REPORTER_ASSERT(reporter, boxes2.size() == 1);
4739 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes2[0].rect.left(), 0, EPSILON100));
4740 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes2[0].rect.top(), 22.5f, EPSILON100));
4741 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes2[0].rect.right(), 50, EPSILON100));
4742 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes2[0].rect.bottom(), 72.5f, EPSILON100));
4746 REPORTER_ASSERT(reporter, boxes3.size() == 1);
4747 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes3[0].rect.left(), 0, EPSILON100));
4748 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes3[0].rect.top(), 0, EPSILON100));
4749 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes3[0].rect.right(), 50, EPSILON100));
4750 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes3[0].rect.bottom(), 80, EPSILON100));
4754 REPORTER_ASSERT(reporter, boxes4.size() == 1);
4755 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes4[0].rect.left(), 300, EPSILON100));
4756 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes4[0].rect.top(), 22.5f, EPSILON100));
4757 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes4[0].rect.right(), 500, EPSILON100));
4758 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes4[0].rect.bottom(), 72.5f, EPSILON100));
4762 REPORTER_ASSERT(reporter, boxes5.size() == 1);
4763 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes5[0].rect.left(), 300, EPSILON100));
4764 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes5[0].rect.top(), 0, EPSILON100));
4765 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes5[0].rect.right(), 500, EPSILON100));
4766 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes5[0].rect.bottom(), 80, EPSILON100));
4770 REPORTER_ASSERT(reporter, boxes6.size() == 1);
4771 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes6[0].rect.left(), 0, EPSILON100));
4772 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes6[0].rect.top(), 160, EPSILON100));
4773 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes6[0].rect.right(), 100, EPSILON100));
4774 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes6[0].rect.bottom(), 240, EPSILON100));
4778 REPORTER_ASSERT(reporter, boxes7.size() == 1);
4779 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes7[0].rect.left(), 50, EPSILON100));
4780 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes7[0].rect.top(), 240, EPSILON100));
4781 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes7[0].rect.right(), 300, EPSILON100));
4782 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes7[0].rect.bottom(), 320, EPSILON100));
4786 UNIX_ONLY_TEST(SkParagraph_StrutDefaultParagraph, reporter) {
4827 REPORTER_ASSERT(reporter, boxes.empty());
4832 REPORTER_ASSERT(reporter, boxes.size() == 1);
4833 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4834 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 26.5f, EPSILON100));
4835 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 20, EPSILON100));
4836 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 46.5f, EPSILON100));
4841 REPORTER_ASSERT(reporter, boxes.size() == 1);
4842 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
4843 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.top(), 2.5f, EPSILON100));
4844 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.right(), 40, EPSILON100));
4845 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.bottom(), 52.5f, EPSILON100));
4849 UNIX_ONLY_TEST(SkParagraph_FontFeaturesParagraph, reporter) {
4884 REPORTER_ASSERT(reporter, paragraph->lineNumber() == 3ull);
4889 REPORTER_ASSERT(reporter, tnum_line.clusters().width() == 4ull);
4890 REPORTER_ASSERT(reporter, pnum_line.clusters().width() == 4ull);
4892 REPORTER_ASSERT(reporter, impl->clusters()[0].width() == impl->clusters()[1].width());
4894 REPORTER_ASSERT(reporter, impl->clusters()[5].width() != impl->clusters()[6].width());
4896 REPORTER_ASSERT(reporter, impl->clusters()[2].width() == impl->clusters()[7].width());
4900 UNIX_ONLY_TEST(SkParagraph_WhitespacesInMultipleFonts, reporter) {
4921 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
4927 REPORTER_ASSERT(reporter, first.end == next.start);
4932 DEF_TEST_DISABLED(SkParagraph_JSON1, reporter) {
4952 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
4967 REPORTER_ASSERT(reporter, cluster <= 2);
4971 DEF_TEST_DISABLED(SkParagraph_JSON2, reporter) {
4993 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
5011 REPORTER_ASSERT(reporter, cluster <= 2);
5014 UNIX_ONLY_TEST(SkParagraph_CacheText, reporter) {
5035 REPORTER_ASSERT(reporter, count == cache.count());
5037 REPORTER_ASSERT(reporter, found == expectedToBeFound);
5039 REPORTER_ASSERT(reporter, added != expectedToBeFound);
5049 UNIX_ONLY_TEST(SkParagraph_CacheFonts, reporter) {
5072 REPORTER_ASSERT(reporter, count == cache.count());
5074 REPORTER_ASSERT(reporter, found == expectedToBeFound);
5076 REPORTER_ASSERT(reporter, added != expectedToBeFound);
5089 UNIX_ONLY_TEST(SkParagraph_CacheFontRanges, reporter) {
5120 REPORTER_ASSERT(reporter, count == cache.count());
5122 REPORTER_ASSERT(reporter, found == expectedToBeFound);
5124 REPORTER_ASSERT(reporter, added != expectedToBeFound);
5134 UNIX_ONLY_TEST(SkParagraph_CacheStyles, reporter) {
5158 REPORTER_ASSERT(reporter, count == cache.count());
5160 REPORTER_ASSERT(reporter, found == expectedToBeFound);
5162 REPORTER_ASSERT(reporter, added != expectedToBeFound);
5174 UNIX_ONLY_TEST(SkParagraph_ParagraphWithLineBreak, reporter) {
5197 REPORTER_ASSERT(reporter, pos.affinity == Affinity::kDownstream && pos.position == 4);
5199 REPORTER_ASSERT(reporter, rect.size() == 1 && rect[0].rect.width() == 0);
5203 UNIX_ONLY_TEST(SkParagraph_NullInMiddleOfText, reporter) {
5220 REPORTER_ASSERT(reporter, SkScalarNearlyZero(paragraph->getHeight()));
5224 UNIX_ONLY_TEST(SkParagraph_PlaceholderOnly, reporter) {
5240 REPORTER_ASSERT(reporter, result.size() == 1);
5243 UNIX_ONLY_TEST(SkParagraph_Fallbacks, reporter) {
5287 UNIX_ONLY_TEST(SkParagraph_Bidi1, reporter) {
5339 UNIX_ONLY_TEST(SkParagraph_Bidi2, reporter) {
5381 UNIX_ONLY_TEST(SkParagraph_NewlineOnly, reporter) {
5398 REPORTER_ASSERT(reporter, paragraph->getHeight() == 28);
5401 UNIX_ONLY_TEST(SkParagraph_FontResolutions, reporter) {
5446 REPORTER_ASSERT(reporter, impl->runs().size() == 2);
5448 REPORTER_ASSERT(reporter, impl->runs().front().size() == 4);
5449 REPORTER_ASSERT(reporter, impl->runs().front().glyphs()[0] == impl->runs().front().glyphs()[2]);
5450 REPORTER_ASSERT(reporter, impl->runs().front().glyphs()[1] == impl->runs().front().glyphs()[3]);
5452 REPORTER_ASSERT(reporter, impl->runs().back().size() == 2);
5453 REPORTER_ASSERT(reporter, impl->runs().back().glyphs()[0] == impl->runs().back().glyphs()[1]);
5458 UNIX_ONLY_TEST(SkParagraph_FontStyle, reporter) {
5496 UNIX_ONLY_TEST(SkParagraph_Shaping, reporter) {
5522 UNIX_ONLY_TEST(SkParagraph_Ellipsis, reporter) {
5583 UNIX_ONLY_TEST(SkParagraph_MemoryLeak, reporter) {
5614 UNIX_ONLY_TEST(SkParagraph_FormattingInfinity, reporter) {
5650 UNIX_ONLY_TEST(SkParagraph_Infinity, reporter) {
5668 UNIX_ONLY_TEST(SkParagraph_LineMetrics, reporter) {
5748 DEF_TEST_DISABLED(SkParagraph_PlaceholderHeightInf, reporter) {
5777 REPORTER_ASSERT(reporter, SkScalarIsFinite(impl->getPicture()->cullRect().height()));
5778 REPORTER_ASSERT(reporter, SkScalarIsFinite(impl->getPicture()->cullRect().width()));
5781 UNIX_ONLY_TEST(SkParagraph_LineMetricsTextAlign, reporter) {
5805 REPORTER_ASSERT(reporter, metrics.size() > 0);
5817 REPORTER_ASSERT(reporter, left[0] == 0); // Starts from 0
5818 REPORTER_ASSERT(reporter, left[1] > left[0]); // Starts from delta / 2
5819 REPORTER_ASSERT(reporter, left[2] > left[1]); // Starts from delta
5820 REPORTER_ASSERT(reporter, left[3] == left[0]); // Starts from 0
5821 REPORTER_ASSERT(reporter, width[1] == width[0]);
5822 REPORTER_ASSERT(reporter, width[2] == width[0]);
5823 REPORTER_ASSERT(reporter, width[3] > width[0]); // delta == 0
5826 UNIX_ONLY_TEST(SkParagraph_FontResolutionInRTL, reporter) {
5853 REPORTER_ASSERT(reporter, impl->runs().size() == (10 + 11));
5856 UNIX_ONLY_TEST(SkParagraph_FontResolutionInLTR, reporter) {
5880 REPORTER_ASSERT(reporter, impl->runs().size() == 5);
5881 REPORTER_ASSERT(reporter, impl->runs()[0].textRange().width() == 4); // "abc "
5882 REPORTER_ASSERT(reporter, impl->runs()[1].textRange().width() == 2); // "{unresolved}"
5883 REPORTER_ASSERT(reporter, impl->runs()[2].textRange().width() == 1); // " "
5884 REPORTER_ASSERT(reporter, impl->runs()[3].textRange().width() == 2); // "{unresolved}"
5885 REPORTER_ASSERT(reporter, impl->runs()[4].textRange().width() == 4); // " def"
5888 UNIX_ONLY_TEST(SkParagraph_Intrinsic, reporter) {
5906 REPORTER_ASSERT(reporter, paragraph->getMinIntrinsicWidth() <= paragraph->getMaxIntrinsicWidth());
5910 UNIX_ONLY_TEST(SkParagraph_NoCache1, reporter) {
5953 REPORTER_ASSERT(reporter, (countBefore == countAfter) == editing);
5974 UNIX_ONLY_TEST(SkParagraph_HeightCalculations, reporter) {
5998 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(paragraph->getHeight(), height));
6006 UNIX_ONLY_TEST(SkParagraph_RTL_With_Styles, reporter) {
6046 UNIX_ONLY_TEST(SkParagraph_PositionInsideEmoji, reporter) {
6096 REPORTER_ASSERT(reporter, i == res2.position && res1.position == j);
6101 UNIX_ONLY_TEST(SkParagraph_SingleLineHeight1, reporter) {
6123 REPORTER_ASSERT(reporter, paragraph->getHeight() == 14.0f);
6130 UNIX_ONLY_TEST(SkParagraph_SingleLineHeight2, reporter) {
6151 REPORTER_ASSERT(reporter, paragraph->getHeight() == 28.0f);
6158 UNIX_ONLY_TEST(SkParagraph_PlaceholderWidth, reporter) {
6198 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(len1, 300.0f, EPSILON100));
6199 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(len2, 250.0f, EPSILON100));
6202 UNIX_ONLY_TEST(SkParagraph_GlyphPositionsInEmptyLines, reporter) {
6223 REPORTER_ASSERT(reporter, res1.position == 1 && res1.affinity == Affinity::kUpstream);
6227 REPORTER_ASSERT(reporter, res2.position == 2 && res2.affinity == Affinity::kDownstream);
6231 REPORTER_ASSERT(reporter, res3.position == 3 && res3.affinity == Affinity::kDownstream);
6234 UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositions, reporter) {
6269 REPORTER_ASSERT(reporter, pos.affinity == check.second.affinity);
6270 REPORTER_ASSERT(reporter, pos.position == check.second.position);
6274 UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositionsInEmptyLines, reporter) {
6298 REPORTER_ASSERT(reporter, res1.position == 4 && res1.affinity == Affinity::kUpstream);
6300 REPORTER_ASSERT(reporter, res2.position == 5 && res2.affinity == Affinity::kDownstream);
6302 REPORTER_ASSERT(reporter, res3.position == 10 && res3.affinity == Affinity::kUpstream);
6305 UNIX_ONLY_TEST(SkParagraph_LTRGlyphPositionsForTrailingSpaces, reporter) {
6336 REPORTER_ASSERT(reporter, res.position == SkToInt(i) + (i > 0 ? 1 : 0));
6338 REPORTER_ASSERT(reporter, res.affinity == (res.position == SkToInt(str.size()) ? Affinity::kUpstream : Affinity::kDownstream));
6346 UNIX_ONLY_TEST(SkParagraph_RTLGlyphPositionsForTrailingSpaces, reporter) {
6395 REPORTER_ASSERT(reporter, (pos.position + i) == SkToInt(str.size()) - (pos.affinity == Affinity::kDownstream ? 1 : 0));
6403 UNIX_ONLY_TEST(SkParagraph_LTRLineMetricsDoesNotIncludeNewLine, reporter) {
6438 REPORTER_ASSERT(reporter, metric.fStartIndex ==std::get<0>(result));
6439 REPORTER_ASSERT(reporter, metric.fEndExcludingWhitespaces == std::get<1>(result));
6440 REPORTER_ASSERT(reporter, metric.fEndIndex == std::get<2>(result));
6441 REPORTER_ASSERT(reporter, metric.fEndIncludingNewline == std::get<3>(result));
6445 UNIX_ONLY_TEST(SkParagraph_RTLLineMetricsDoesNotIncludeNewLine, reporter) {
6513 REPORTER_ASSERT(reporter, metric.fStartIndex == SkToU32(std::get<0>(result)));
6514 REPORTER_ASSERT(reporter, metric.fEndExcludingWhitespaces == SkToU32(std::get<1>(result)));
6515 REPORTER_ASSERT(reporter, metric.fEndIndex == SkToU32(std::get<2>(result)));
6516 REPORTER_ASSERT(reporter, metric.fEndIncludingNewline == SkToU32(std::get<3>(result)));
6520 UNIX_ONLY_TEST(SkParagraph_PlaceholderPosition, reporter) {
6549 REPORTER_ASSERT(reporter, result.position == 4 && result.affinity == Affinity::kDownstream);
6552 UNIX_ONLY_TEST(SkParagraph_LineEnd, reporter) {
6584 REPORTER_ASSERT(reporter, lm[0].fEndExcludingWhitespaces == 05 && lm[0].fEndIndex == 06 && lm[0].fEndIncludingNewline == 06);
6585 REPORTER_ASSERT(reporter, lm[1].fEndExcludingWhitespaces == 11 && lm[1].fEndIndex == 14 && lm[1].fEndIncludingNewline == 14);
6586 REPORTER_ASSERT(reporter, lm[2].fEndExcludingWhitespaces == 19 && lm[2].fEndIndex == 19 && lm[2].fEndIncludingNewline == 20);
6587 REPORTER_ASSERT(reporter, lm[3].fEndExcludingWhitespaces == 25 && lm[3].fEndIndex == 28 && lm[3].fEndIncludingNewline == 29);
6590 UNIX_ONLY_TEST(SkParagraph_Utf16Indexes, reporter) {
6614 REPORTER_ASSERT(reporter, lm[0].fEndExcludingWhitespaces == 05 && lm[0].fEndIndex == 05 && lm[0].fEndIncludingNewline == 06);
6615 REPORTER_ASSERT(reporter, lm[1].fEndExcludingWhitespaces == 10 && lm[1].fEndIndex == 10 && lm[1].fEndIncludingNewline == 10);
6618 UNIX_ONLY_TEST(SkParagraph_RTLFollowedByLTR, reporter) {
6642 REPORTER_ASSERT(reporter, boxes.size() == 2);
6644 reporter,
6646 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fLeft, 0.0f));
6647 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fRight, boxes[1].rect.fLeft));
6648 REPORTER_ASSERT(reporter,
6670 REPORTER_ASSERT(reporter, pos.affinity == check.second.affinity);
6671 REPORTER_ASSERT(reporter, pos.position == check.second.position);
6675 UNIX_ONLY_TEST(SkParagraph_StrutTopLine, reporter) {
6709 REPORTER_ASSERT(reporter, boxes.size() == 4);
6710 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fTop, 38.4f));
6711 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fBottom, 64.0f));
6713 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.fTop, 64.0f));
6714 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.fBottom, 128.0f));
6716 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.fTop, 64.0f));
6717 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.fBottom, 128.0f));
6719 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.fTop, 128.0f));
6720 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.fBottom, 192.0f));
6723 UNIX_ONLY_TEST(SkParagraph_DifferentFontsTopLine, reporter) {
6755 REPORTER_ASSERT(reporter, boxes.size() == 4);
6756 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fTop, 00.0f));
6757 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fBottom, 30.0f));
6759 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.fTop, 00.0f));
6760 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[1].rect.fBottom, 30.0f));
6762 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.fTop, 00.0f));
6763 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[2].rect.fBottom, 30.0f));
6765 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.fTop, 30.0f));
6766 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[3].rect.fBottom, 40.0f));
6769 UNIX_ONLY_TEST(SkParagraph_SimpleParagraphReset, reporter) {
6781 REPORTER_ASSERT(reporter, builder.peekStyle().equals(paragraph_style.getTextStyle()));
6792 REPORTER_ASSERT(reporter, paragraph->unresolvedGlyphs() == 0);
6795 REPORTER_ASSERT(reporter, impl->runs().size() == 1);
6796 REPORTER_ASSERT(reporter, impl->styles().size() == 1); // paragraph style does not count
6797 REPORTER_ASSERT(reporter, impl->styles()[0].fStyle.equals(text_style));
6802 [&index, reporter]
6804 REPORTER_ASSERT(reporter, index == 0);
6805 REPORTER_ASSERT(reporter, style.getColor() == SK_ColorBLACK);
6812 UNIX_ONLY_TEST(SkParagraph_EllipsisGetRectForRange, reporter) {
6844 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
6847 REPORTER_ASSERT(reporter, boxes1.size() == 1);
6850 REPORTER_ASSERT(reporter, boxes2.size() == 1);
6857 UNIX_ONLY_TEST(SkParagraph_StrutAndTextBehavior, reporter) {
6892 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(height1, 24.0f));
6893 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(height2, 24.0f));
6896 UNIX_ONLY_TEST(SkParagraph_NonMonotonicGlyphsLTR, reporter) {
6932 REPORTER_ASSERT(reporter, impl->runs().size() > 1); // It's not the simple case
6944 REPORTER_ASSERT(reporter, hasNonMonotonicPlacement); // There are non-monotonic placement
6945 REPORTER_ASSERT(reporter, impl->lineNumber() == 1); // But it's still one line
6949 UNIX_ONLY_TEST(SkParagraph_NonMonotonicGlyphsRTL, reporter) {
6985 REPORTER_ASSERT(reporter, impl->lineNumber() == 1); // But it's still one line
6989 void performGetRectsForRangeConcurrently(skiatest::Reporter* reporter) {
6992 INFOF(reporter, "No fonts found\n");
7016 REPORTER_ASSERT(reporter, !result.empty());
7020 REPORTER_ASSERT(reporter, !result.empty());
7026 UNIX_ONLY_TEST(SkParagraph_GetRectsForRangeConcurrently, reporter) {
7030 thread = std::thread(performGetRectsForRangeConcurrently, reporter);
7037 UNIX_ONLY_TEST(SkParagraph_TabSubstitution, reporter) {
7067 REPORTER_ASSERT(reporter, ((ParagraphImpl*)paragraph1.get())->runs()[0].glyphs()[15] != 0);
7068 REPORTER_ASSERT(reporter, ((ParagraphImpl*)paragraph2.get())->runs()[0].glyphs()[15] == 0);
7070 REPORTER_ASSERT(reporter, 2 == fontCollection->getParagraphCache()->count());
7073 DEF_TEST(SkParagraph_lineMetricsWithEllipsis, reporter) {
7092 REPORTER_ASSERT(reporter, lm.size() == 1);
7095 DEF_TEST(SkParagraph_lineMetricsAfterUpdate, reporter) {
7113 REPORTER_ASSERT(reporter, lm.size() == 1);
7118 REPORTER_ASSERT(reporter, lm.size() == 2);
7122 UNIX_ONLY_TEST(SkParagraph_MultiStyle_Logo, reporter) {
7199 REPORTER_ASSERT(reporter, impl->lines().size() == 1);
7204 [&index, &left, reporter]
7207 case 0: REPORTER_ASSERT(reporter, context.pos == 0 && context.size == 1);
7208 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7209 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 62.6944885f));
7211 case 1: REPORTER_ASSERT(reporter, context.pos == 0 && context.size == 2);
7212 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7213 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 105.479904f));
7215 case 2: REPORTER_ASSERT(reporter, context.pos == 2 && context.size == 1);
7216 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7217 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 123.3926165f));
7219 case 3: REPORTER_ASSERT(reporter, context.pos == 2 && context.size == 2);
7220 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7221 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 210.959808f));
7223 case 4: REPORTER_ASSERT(reporter, context.pos == 4 && context.size == 1);
7224 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7225 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 291.567017f));
7227 case 5: REPORTER_ASSERT(reporter, context.pos == 4 && context.size == 1); // No space at the end
7228 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fLeft, left));
7229 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(context.clip.fRight, 309.479736f));
7231 default: REPORTER_ASSERT(reporter, false); break;
7239 UNIX_ONLY_TEST(SkParagraph_MultiStyle_FFI, reporter) {
7273 REPORTER_ASSERT(reporter, f1Pos.position == 0 && f1Pos.affinity == Affinity::kDownstream);
7274 REPORTER_ASSERT(reporter, f2Pos.position == 1 && f2Pos.affinity == Affinity::kDownstream);
7275 REPORTER_ASSERT(reporter, iPos.position == 2 && iPos.affinity == Affinity::kDownstream);
7280 REPORTER_ASSERT(reporter, f1.size() == 1);
7281 REPORTER_ASSERT(reporter, f1[0].direction == TextDirection::kLtr);
7282 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f1[0].rect.fLeft, 0.000000f, EPSILON100));
7283 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f1[0].rect.fRight, 17.070000f, EPSILON100));
7287 REPORTER_ASSERT(reporter, f2.size() == 1);
7288 REPORTER_ASSERT(reporter, f2[0].direction == TextDirection::kLtr);
7289 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f2[0].rect.fLeft, 17.070000f, EPSILON100));
7290 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(f2[0].rect.fRight, 34.139999f, EPSILON100));
7294 REPORTER_ASSERT(reporter, fi.size() == 1);
7295 REPORTER_ASSERT(reporter, fi[0].direction == TextDirection::kLtr);
7296 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(fi[0].rect.fLeft, 34.139999f, EPSILON100));
7297 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(fi[0].rect.fRight, 51.209999f, EPSILON100));
7301 UNIX_ONLY_TEST(SkParagraph_MultiStyle_EmojiFamily, reporter) {
7335 REPORTER_ASSERT(reporter, pos00.position == 0 && pos00.affinity == Affinity::kDownstream);
7336 REPORTER_ASSERT(reporter, pos01.position == 0 && pos01.affinity == Affinity::kDownstream);
7337 REPORTER_ASSERT(reporter, pos10.position == 11 && pos10.affinity == Affinity::kUpstream);
7338 REPORTER_ASSERT(reporter, pos11.position == 11 && pos11.affinity == Affinity::kUpstream);
7342 REPORTER_ASSERT(reporter, f1.size() == 0);
7345 REPORTER_ASSERT(reporter, f2.size() == 0);
7348 REPORTER_ASSERT(reporter, f3.size() == 0);
7351 REPORTER_ASSERT(reporter, f4.size() == 0);
7355 UNIX_ONLY_TEST(SkParagraph_MultiStyle_Arabic, reporter) {
7391 REPORTER_ASSERT(reporter, f1Pos.position == 4 && f1Pos.affinity == Affinity::kUpstream);
7392 REPORTER_ASSERT(reporter, f2Pos.position == 1 && f2Pos.affinity == Affinity::kUpstream);
7393 REPORTER_ASSERT(reporter, iPos.position == 0 && iPos.affinity == Affinity::kDownstream);
7397 REPORTER_ASSERT(reporter, f1.size() == 0);
7400 REPORTER_ASSERT(reporter, f2.size() == 0);
7403 REPORTER_ASSERT(reporter, fi.size() == 0);
7407 UNIX_ONLY_TEST(SkParagraph_MultiStyle_Zalgo, reporter) {
7450 REPORTER_ASSERT(reporter, resSK.size() != 0);
7451 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(resSK[0].rect.width(), 10.45f, EPSILON100));
7455 REPORTER_ASSERT(reporter, resKP.size() != 0);
7456 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(resKP[0].rect.width(), 11.22f));
7457 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(resKP[0].rect.width(), 11.22f, EPSILON100));
7461 REPORTER_ASSERT(reporter, resPh.size() != 0);
7462 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(resPh[0].rect.width(), 67.26f, EPSILON20));
7467 REPORTER_ASSERT(reporter, posK.position == 148 && posP.position == 264 && posH.position == 572);
7471 UNIX_ONLY_TEST(SkParagraph_RtlEllipsis1, reporter) {
7496 REPORTER_ASSERT(reporter, paragraph->lineNumber() == 1);
7502 REPORTER_ASSERT(reporter, first == (run->isEllipsis()));
7508 UNIX_ONLY_TEST(SkParagraph_RtlEllipsis2, reporter) {
7533 REPORTER_ASSERT(reporter, paragraph->lineNumber() == 2);
7539 REPORTER_ASSERT(reporter, first == (run->isEllipsis()));
7545 UNIX_ONLY_TEST(SkParagraph_TextEditingFunctionality, reporter) {
7576 REPORTER_ASSERT(reporter, lineNumber == 0);
7578 REPORTER_ASSERT(reporter, lineNumber == 1);
7580 REPORTER_ASSERT(reporter, lineNumber == -1);
7582 REPORTER_ASSERT(reporter, lineNumber == -1);
7586 REPORTER_ASSERT(reporter, foundMetrics && lineMetrics.fLineNumber == 0);
7588 REPORTER_ASSERT(reporter, foundMetrics && lineMetrics.fLineNumber == 1);
7590 REPORTER_ASSERT(reporter, !foundMetrics);
7592 REPORTER_ASSERT(reporter, !foundMetrics);
7597 REPORTER_ASSERT(reporter, actualText.end == metrics[0].fEndExcludingWhitespaces);
7599 REPORTER_ASSERT(reporter, actualText.end == metrics[1].fEndExcludingWhitespaces);
7601 REPORTER_ASSERT(reporter, actualText.end == metrics[2].fEndExcludingWhitespaces);
7605 REPORTER_ASSERT(reporter, foundCluster && glyphInfo.fClusterTextRange.start == 0);
7607 REPORTER_ASSERT(reporter, foundCluster && glyphInfo.fClusterTextRange.start == len / 2);
7609 REPORTER_ASSERT(reporter, !foundCluster);
7612 REPORTER_ASSERT(reporter, foundClosest && glyphInfo.fClusterTextRange.start == 0 &&
7615 REPORTER_ASSERT(reporter, foundClosest && glyphInfo.fClusterTextRange.start == 61 &&
7618 REPORTER_ASSERT(reporter, foundClosest && glyphInfo.fClusterTextRange.start == 230 &&
7622 REPORTER_ASSERT(reporter, font.getTypeface() != nullptr);
7625 REPORTER_ASSERT(reporter, fontFamily.equals("Roboto"));
7628 REPORTER_ASSERT(reporter, fonts.size() == 1);
7629 REPORTER_ASSERT(reporter, fonts[0].fTextRange.start == 0 && fonts[0].fTextRange.end == len);
7630 REPORTER_ASSERT(reporter, fonts[0].fFont.getTypeface() != nullptr);
7632 REPORTER_ASSERT(reporter, fontFamily.equals("Roboto"));
7635 UNIX_ONLY_TEST(SkParagraph_SingleDummyPlaceholder, reporter) {
7655 REPORTER_ASSERT(reporter, impl->placeholders().size() == 1);
7661 [&index, reporter]
7663 REPORTER_ASSERT(reporter, index == 0);
7664 REPORTER_ASSERT(reporter, style.getColor() == SK_ColorBLACK);