Lines Matching refs:boxes
342 auto boxes = paragraph->getRectsForRange(0, 3, rect_height_style, rect_width_style);
343 canvas.drawRects(SK_ColorRED, boxes);
344 REPORTER_ASSERT(reporter, boxes.size() == 1);
346 boxes = paragraph->getRectsForRange(0, 3, rect_height_style, rect_width_style);
347 canvas.drawRects(SK_ColorGREEN, boxes);
348 REPORTER_ASSERT(reporter, boxes.size() == 1);
350 boxes = paragraph->getRectsForPlaceholders();
351 canvas.drawRects(SK_ColorRED, boxes);
353 boxes = paragraph->getRectsForRange(4, 17, rect_height_style, rect_width_style);
354 canvas.drawRects(SK_ColorBLUE, boxes);
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));
413 auto boxes = paragraph->getRectsForPlaceholders();
414 canvas.drawRects(SK_ColorRED, boxes);
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));
425 boxes = paragraph->getRectsForRange(5, 6, rect_height_style, rect_width_style);
426 canvas.drawRects(SK_ColorBLUE, boxes);
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));
469 auto boxes = paragraph->getRectsForPlaceholders();
470 canvas.drawRects(SK_ColorRED, boxes);
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));
481 boxes = paragraph->getRectsForRange(5, 6, rect_height_style, rect_width_style);
482 canvas.drawRects(SK_ColorBLUE, boxes);
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));
525 auto boxes = paragraph->getRectsForPlaceholders();
526 canvas.drawRects(SK_ColorRED, boxes);
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));
537 boxes = paragraph->getRectsForRange(5, 6, rect_height_style, rect_width_style);
538 canvas.drawRects(SK_ColorBLUE, boxes);
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));
584 auto boxes = paragraph->getRectsForPlaceholders();
585 canvas.drawRects(SK_ColorRED, boxes);
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));
592 boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
593 canvas.drawRects(SK_ColorBLUE, boxes);
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));
638 auto boxes = paragraph->getRectsForPlaceholders();
639 canvas.drawRects(SK_ColorRED, boxes);
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));
646 boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
647 canvas.drawRects(SK_ColorBLUE, boxes);
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));
692 auto boxes = paragraph->getRectsForPlaceholders();
693 canvas.drawRects(SK_ColorRED, boxes);
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));
700 boxes = paragraph->getRectsForRange(5, 6, rect_height_style, rect_width_style);
701 canvas.drawRects(SK_ColorBLUE, boxes);
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));
745 auto boxes = paragraph->getRectsForPlaceholders();
746 canvas.drawRects(SK_ColorRED, boxes);
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));
753 boxes = paragraph->getRectsForRange(5, 6, rect_height_style, rect_width_style);
754 canvas.drawRects(SK_ColorBLUE, boxes);
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));
863 auto boxes = paragraph->getRectsForRange(0, 3, rect_height_style, rect_width_style);
864 canvas.drawRects(SK_ColorRED, boxes);
865 REPORTER_ASSERT(reporter, boxes.size() == 1);
867 boxes = paragraph->getRectsForRange(175, 176, rect_height_style, rect_width_style);
868 canvas.drawRects(SK_ColorGREEN, boxes);
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));
875 boxes = paragraph->getRectsForPlaceholders();
876 canvas.drawRects(SK_ColorRED, boxes);
878 boxes = paragraph->getRectsForRange(4, 45, rect_height_style, rect_width_style);
879 canvas.drawRects(SK_ColorBLUE, boxes);
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));
986 auto boxes = paragraph->getRectsForPlaceholders();
987 canvas.drawRects(SK_ColorRED, boxes);
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));
1005 boxes = paragraph->getRectsForRange(30, 50, rect_height_style, rect_width_style);
1006 canvas.drawRects(SK_ColorBLUE, boxes);
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));
1314 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, 0, rect_height_style, rect_width_style);
1315 canvas.drawRects(SK_ColorRED, boxes);
1316 REPORTER_ASSERT(reporter, boxes.size() == 0ull);
1318 boxes = paragraph->getRectsForRange(0, 40, rect_height_style, rect_width_style);
1319 canvas.drawRects(SK_ColorBLUE, boxes);
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));
1366 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, len, RectHeightStyle::kTight, rect_width_style);
1369 canvas.drawRects(SK_ColorBLUE, boxes);
1370 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1371 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1373 const auto line_spacing1 = boxes[1].rect.top() - boxes[0].rect.bottom();
1374 const auto line_spacing2 = boxes[2].rect.top() - boxes[1].rect.bottom();
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));
1435 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, len, RectHeightStyle::kTight, rect_width_style);
1438 canvas.drawRects(SK_ColorBLUE, boxes);
1439 REPORTER_ASSERT(reporter, boxes.size() == 1ull);
1440 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1467 const auto actual_glyphs_top = boxes[0].rect.top() - lineBoxes[0].rect.top();
1468 const auto actual_glyphs_bottom = boxes[0].rect.bottom() - lineBoxes[0].rect.top();
1479 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.left(), 0, EPSILON100));
1527 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, len, RectHeightStyle::kTight, rect_width_style);
1530 canvas.drawRects(SK_ColorBLUE, boxes);
1531 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1532 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1534 const auto line_spacing1 = boxes[1].rect.top() - boxes[0].rect.bottom();
1535 const auto line_spacing2 = boxes[2].rect.top() - boxes[1].rect.bottom();
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));
1584 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, len, RectHeightStyle::kTight, rect_width_style);
1587 canvas.drawRects(SK_ColorBLUE, boxes);
1588 REPORTER_ASSERT(reporter, boxes.size() == 3ull);
1589 REPORTER_ASSERT(reporter, lineBoxes.size() == boxes.size());
1591 const auto line_spacing1 = boxes[1].rect.top() - boxes[0].rect.bottom();
1592 const auto line_spacing2 = boxes[2].rect.top() - boxes[1].rect.bottom();
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()));
1602 const auto halfLeading = lineBoxes[0].rect.bottom() - boxes[0].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));
1920 auto boxes = paragraph->getRectsForRange(0, 100, rect_height_style, rect_width_style);
1921 canvas.drawRects(SK_ColorRED, boxes);
2011 auto boxes = paragraph->getRectsForRange(0, 100, rect_height_style, rect_width_style);
2012 canvas.drawRects(SK_ColorRED, boxes);
2013 REPORTER_ASSERT(reporter, boxes.size() == 3);
2015 boxes = paragraph->getRectsForRange(240, 250, rect_height_style, rect_width_style);
2016 canvas.drawRects(SK_ColorBLUE, boxes);
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));
2065 auto boxes = paragraph->getRectsForRange(0, 30, rect_height_style, rect_width_style);
2066 for (size_t i = 0; i < boxes.size(); ++i) {
2067 canvas.get()->drawRect(boxes[i].rect, paint);
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));
2076 boxes = paragraph->getRectsForRange(240, 250, rect_height_style, rect_width_style);
2077 for (size_t i = 0; i < boxes.size(); ++i) {
2078 canvas.get()->drawRect(boxes[i].rect, paint);
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));
2136 auto boxes = paragraph->getRectsForRange(0, 100, rect_height_style, rect_width_style);
2137 for (size_t i = 0; i < boxes.size(); ++i) {
2138 canvas.get()->drawRect(boxes[i].rect, paint);
2140 REPORTER_ASSERT(reporter, boxes.size() == 2ull);
2421 // Checked: DIFF (2 boxes and each space is a word)
2458 std::vector<TextBox> boxes = paragraph->getRectsForRange(0, 100, rect_height_style, rect_width_style);
2459 canvas.drawRects(SK_ColorRED, boxes);
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));
2470 // This test shows now 2 boxes for [36:40) range:
2510 std::vector<TextBox> boxes = paragraph->getRectsForRange(36, 40, rect_height_style, rect_width_style);
2511 canvas.drawRects(SK_ColorRED, boxes);
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));
2557 std::vector<TextBox> boxes =
2559 canvas.drawRects(SK_ColorRED, boxes);
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));
3613 auto boxes = paragraph->getRectsForRange(5, 6, RectHeightStyle::kMax, RectWidthStyle::kTight);
3614 canvas.drawLines(SK_ColorRED, boxes);
3617 boxes = paragraph->getRectsForRange(6, 7, RectHeightStyle::kMax, RectWidthStyle::kTight);
3618 canvas.drawLines(SK_ColorRED, boxes);
3621 boxes = paragraph->getRectsForRange(7, 8, RectHeightStyle::kMax, RectWidthStyle::kTight);
3622 canvas.drawLines(SK_ColorRED, boxes);
3633 boxes = paragraph->getRectsForRange(12, 13, RectHeightStyle::kMax, RectWidthStyle::kTight);
3634 canvas.drawLines(SK_ColorRED, boxes);
3635 boxes = paragraph->getRectsForRange(13, 14, RectHeightStyle::kMax, RectWidthStyle::kTight);
3636 canvas.drawLines(SK_ColorRED, boxes);
3637 boxes = paragraph->getRectsForRange(18, 19, RectHeightStyle::kMax, RectWidthStyle::kTight);
3638 canvas.drawLines(SK_ColorRED, boxes);
3639 boxes = paragraph->getRectsForRange(19, 20, RectHeightStyle::kMax, RectWidthStyle::kTight);
3640 canvas.drawLines(SK_ColorRED, boxes);
3641 boxes = paragraph->getRectsForRange(24, 25, RectHeightStyle::kMax, RectWidthStyle::kTight);
3642 canvas.drawLines(SK_ColorRED, boxes);
3643 boxes = paragraph->getRectsForRange(25, 26, RectHeightStyle::kMax, RectWidthStyle::kTight);
3644 canvas.drawLines(SK_ColorRED, boxes);
3645 boxes = paragraph->getRectsForRange(30, 31, RectHeightStyle::kMax, RectWidthStyle::kTight);
3646 canvas.drawLines(SK_ColorRED, boxes);
3647 boxes = paragraph->getRectsForRange(31, 32, RectHeightStyle::kMax, RectWidthStyle::kTight);
3648 canvas.drawLines(SK_ColorRED, boxes);
4412 auto boxes = paragraph->getRectsForRange(0, 0, rect_height_style, rect_width_style);
4413 REPORTER_ASSERT(reporter, boxes.empty());
4416 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
4417 canvas.drawRects(SK_ColorRED, boxes);
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));
4425 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_max_style, rect_width_style);
4426 canvas.drawRects(SK_ColorRED, boxes);
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));
4434 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_style, rect_width_style);
4435 canvas.drawRects(SK_ColorRED, boxes);
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));
4443 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_max_style, rect_width_style);
4444 canvas.drawRects(SK_ColorRED, boxes);
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));
4452 auto boxes = paragraph->getRectsForRange(14, 16, rect_height_max_style, rect_width_style);
4453 canvas.drawRects(SK_ColorRED, boxes);
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));
4461 auto boxes = paragraph->getRectsForRange(20, 25, rect_height_max_style, rect_width_style);
4462 canvas.drawRects(SK_ColorRED, boxes);
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));
4519 auto boxes = paragraph->getRectsForRange(0, 0, rect_height_style, rect_width_style);
4520 REPORTER_ASSERT(reporter, boxes.empty());
4523 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
4524 canvas.drawRects(SK_ColorRED, boxes);
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));
4532 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_max_style, rect_width_style);
4533 canvas.drawRects(SK_ColorRED, boxes);
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));
4541 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_style, rect_width_style);
4542 canvas.drawRects(SK_ColorRED, boxes);
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));
4550 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_max_style, rect_width_style);
4551 canvas.drawRects(SK_ColorRED, boxes);
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));
4559 auto boxes = paragraph->getRectsForRange(14, 16, rect_height_max_style, rect_width_style);
4560 canvas.drawRects(SK_ColorRED, boxes);
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));
4568 auto boxes = paragraph->getRectsForRange(20, 25, rect_height_max_style, rect_width_style);
4569 canvas.drawRects(SK_ColorRED, boxes);
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));
4627 auto boxes = paragraph->getRectsForRange(0, 0, rect_height_style, rect_width_style);
4628 REPORTER_ASSERT(reporter, boxes.empty());
4631 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
4632 canvas.drawRects(SK_ColorRED, boxes);
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));
4640 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_max_style, rect_width_style);
4641 canvas.drawRects(SK_ColorRED, boxes);
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));
4649 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_style, rect_width_style);
4650 canvas.drawRects(SK_ColorRED, boxes);
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));
4658 auto boxes = paragraph->getRectsForRange(6, 10, rect_height_max_style, rect_width_style);
4659 canvas.drawRects(SK_ColorRED, boxes);
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));
4667 auto boxes = paragraph->getRectsForRange(14, 16, rect_height_max_style, rect_width_style);
4668 canvas.drawRects(SK_ColorRED, boxes);
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));
4676 auto boxes = paragraph->getRectsForRange(20, 25, rect_height_max_style, rect_width_style);
4677 canvas.drawRects(SK_ColorRED, boxes);
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));
4826 auto boxes = paragraph->getRectsForRange(0, 0, rect_height_style, rect_width_style);
4827 REPORTER_ASSERT(reporter, boxes.empty());
4830 auto boxes = paragraph->getRectsForRange(0, 1, rect_height_style, rect_width_style);
4831 canvas.drawRects(SK_ColorRED, boxes);
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));
4839 auto boxes = paragraph->getRectsForRange(0, 2, rect_height_strut_style, rect_width_style);
4840 canvas.drawRects(SK_ColorRED, boxes);
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));
6488 auto boxes = paragraph->getRectsForRange(0, 100, RectHeightStyle::kTight, RectWidthStyle::kTight);
6490 for (auto& box : boxes) {
6640 auto boxes = paragraph->getRectsForRange(
6642 REPORTER_ASSERT(reporter, boxes.size() == 2);
6645 boxes[0].direction == TextDirection::kRtl && boxes[1].direction == TextDirection::kLtr);
6646 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fLeft, 0.0f));
6647 REPORTER_ASSERT(reporter, SkScalarNearlyEqual(boxes[0].rect.fRight, boxes[1].rect.fLeft));
6649 SkScalarNearlyEqual(boxes[1].rect.fRight, paragraph->getMaxIntrinsicWidth()));
6708 auto boxes = paragraph->getRectsForRange(0, 60, RectHeightStyle::kIncludeLineSpacingTop, RectWidthStyle::kMax);
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));
6754 auto boxes = paragraph->getRectsForRange(0, 60, RectHeightStyle::kIncludeLineSpacingTop, RectWidthStyle::kMax);
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));
7277 // Bounding boxes show the extact position (inside ffi grapheme)
7340 // Bounding boxes around a part of a grapheme are empty
7395 // Bounding boxes around a part of a grapheme are empty