Lines Matching full:run
149 auto& run = fOwner->run(runIndex); in TextLine() local
150 runLevels[runLevelsIndex++] = run.fBidiLevel; in TextLine()
152 … InternalLineMetrics(run.correctAscent(), run.correctDescent(), run.fFontMetrics.fLeading)); in TextLine()
153 if (run.isPlaceholder()) { in TextLine()
167 if (fOwner->run(runIndex).isPlaceholder()) { in TextLine()
176 if (!cluster->run().isPlaceholder()) { in TextLine()
188 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
190 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in paint()
191 …[painter, x, y, run, this](TextRange textRange, const TextStyle& style, const ClipContext& context… in paint()
195 paintRoundRect(painter, x, y, run); in paint()
203 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
205 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kShadow, in paint()
223 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
225 … TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kDecorations, in paint()
239 void TextLine::computeRoundRect(int& index, int& preIndex, std::vector<Run*>& groupRuns, Run* run) { in computeRoundRect() argument
251 … // runCount - 1 is the last run index, index + 1 is next run index, -1 is the invalid styleId in computeRoundRect()
253 // index - preIndex > 1 means the left run has no background rect in computeRoundRect()
255 // runCount - 1 is the last run index in computeRoundRect()
259 groupRuns.push_back(run); in computeRoundRect()
264 run->setRoundRectType(RoundRectType::ALL); in computeRoundRect()
266 run->setRoundRectType(RoundRectType::LEFT_ONLY); in computeRoundRect()
268 run->setRoundRectType(RoundRectType::RIGHT_ONLY); in computeRoundRect()
270 run->setRoundRectType(RoundRectType::NONE); in computeRoundRect()
296 … [this](const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in prepareRoundRect() argument
298 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in prepareRoundRect()
299 [run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) { in prepareRoundRect()
305 std::vector<Run*> groupRuns; in prepareRoundRect()
309 auto run = &this->fOwner->run(runIndex); in prepareRoundRect() local
310 run->setIndexInLine(static_cast<size_t>(index)); in prepareRoundRect()
311 computeRoundRect(index, preIndex, groupRuns, run); in prepareRoundRect()
322 fOwner->run(fRunsInVisualOrder[0]).placeholderStyle() == nullptr) { in ensureTextBlobCachePopulated()
328 const auto& run = fOwner->run(fRunsInVisualOrder[0]); in ensureTextBlobCachePopulated() local
329 auto clip = SkRect::MakeXYWH(0.0f, this->sizes().runTop(&run, this->fAscentStyle), in ensureTextBlobCachePopulated()
331 run.calculateHeight(this->fAscentStyle, this->fDescentStyle)); in ensureTextBlobCachePopulated()
337 if (run.leftToRight()) { in ensureTextBlobCachePopulated()
344 ClipContext context = {/*run=*/&run, in ensureTextBlobCachePopulated()
347 /*fTextShift=*/-run.positionX(glyphs.start), // starting position in ensureTextBlobCachePopulated()
354 [this](const Run* run, in ensureTextBlobCachePopulated()
358 if (run->placeholderStyle() != nullptr) { in ensureTextBlobCachePopulated()
359 *runWidthInLine = run->advance().fX; in ensureTextBlobCachePopulated()
364 run, in ensureTextBlobCachePopulated()
406 const Run* run, SkScalar runOffset, TextRange textRange, SkScalar* width) { in scanStyles() argument
409 run, in scanStyles()
429 if (context.run->placeholderStyle() != nullptr) { in buildTextBlob()
441 record.fVisitor_Run = context.run; in buildTextBlob()
446 context.run->copyTo(builder, SkToU32(context.pos), context.size); in buildTextBlob()
454 SkASSERT(nearlyEqual(context.run->baselineShift(), style.getBaselineShift())); in buildTextBlob()
488 void TextLine::paintRoundRect(ParagraphPainter* painter, SkScalar x, SkScalar y, const Run* run) co… in paintRoundRect()
489 size_t index = run->getIndexInLine(); in paintRoundRect()
503 RoundRectType rType = run->getRoundRectType(); in paintRoundRect()
505 ltRadius = std::fmin(attr.roundRectStyle.leftTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
506 lbRadius = std::fmin(attr.roundRectStyle.leftBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
509 rtRadius = std::fmin(attr.roundRectStyle.rightTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
510 rbRadius = std::fmin(attr.roundRectStyle.rightBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
513 SkRect skRect(SkRect::MakeLTRB(attr.rect.left(), run->getTopInGroup(), attr.rect.right(), in paintRoundRect()
514 run->getBottomInGroup())); in paintRoundRect()
533 context.run->copyTo(builder, context.pos, context.size); in paintShadow()
596 if (cluster->run().leftToRight()) { in justify()
625 auto& run = cluster->run(); in shiftCluster() local
629 if (end == run.size()) { in shiftCluster()
634 if (run.fJustificationShifts.empty()) { in shiftCluster()
636 run.fJustificationShifts.push_back_n(run.size() + 1, { 0, 0 }); in shiftCluster()
640 run.fJustificationShifts[pos] = { shift, prevShift }; in shiftCluster()
650 std::unique_ptr<Run> ellipsisRun; in createEllipsis()
667 // Shape the ellipsis if the run has changed in createEllipsis()
672 // BUT! We can keep scanning in case the next run will give us better results in createEllipsis()
728 std::unique_ptr<Run> ellipsisRun; in createHeadEllipsis()
732 // Shape the ellipsis if the run has changed in createHeadEllipsis()
782 std::unique_ptr<Run> TextLine::shapeEllipsis(const SkString& ellipsis, const Cluster* cluster) { in shapeEllipsis()
788 std::unique_ptr<Run> run() & { return std::move(fRun); } in shapeEllipsis() function in skia::textlayout::TextLine::shapeEllipsis::ShapeHandler
799 …fRun = std::make_unique<Run>(nullptr, info, 0, fLineHeight, fUseHalfLeading, fBaselineShift, 0, 0); in shapeEllipsis()
812 std::unique_ptr<Run> fRun; in shapeEllipsis()
819 const Run& run = cluster->run(); in shapeEllipsis() local
823 if (run.leftToRight() && cluster->textRange().end <= block.fRange.end) { in shapeEllipsis()
826 } else if (!run.leftToRight() && cluster->textRange().start <= block.fRange.end) { in shapeEllipsis()
832 auto shaped = [&](sk_sp<SkTypeface> typeface, bool fallback) -> std::unique_ptr<Run> { in shapeEllipsis()
833 … ShapeHandler handler(run.heightMultiplier(), run.useHalfLeading(), run.baselineShift(), ellipsis); in shapeEllipsis()
848 auto ellipsisRun = handler.run(); in shapeEllipsis()
880 auto ellipsisRun = shaped(run.fFont.refTypeface(), false); in shapeEllipsis()
888 const Run* run, in measureTextInsideOneRun() argument
893 ClipContext result = { run, 0, run->size(), 0, SkRect::MakeEmpty(), 0, false }; in measureTextInsideOneRun()
895 if (run->fEllipsis) { in measureTextInsideOneRun()
899 sizes().runTop(run, this->fAscentStyle), in measureTextInsideOneRun()
900 run->advance().fX, in measureTextInsideOneRun()
901 … run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in measureTextInsideOneRun()
903 } else if (run->isPlaceholder()) { in measureTextInsideOneRun()
905 if (SkScalarIsFinite(run->fFontMetrics.fAscent)) { in measureTextInsideOneRun()
907 sizes().runTop(run, this->fAscentStyle), in measureTextInsideOneRun()
908 run->advance().fX, in measureTextInsideOneRun()
909 … run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in measureTextInsideOneRun()
911 … result.clip = SkRect::MakeXYWH(runOffsetInLine, run->fFontMetrics.fAscent, run->advance().fX, 0); in measureTextInsideOneRun()
926 run->findLimitingGlyphClusters(textRange); in measureTextInsideOneRun()
938 run->findLimitingGraphemes(updatedTextRange); in measureTextInsideOneRun()
952 if (!run->leftToRight()) { in measureTextInsideOneRun()
957 auto textStartInRun = run->positionX(start->startPos()); in measureTextInsideOneRun()
959 if (!run->leftToRight()) { in measureTextInsideOneRun()
963 if (!run->fJustificationShifts.empty()) { in measureTextInsideOneRun()
966 auto j = run->fJustificationShifts[i]; in measureTextInsideOneRun()
978 sizes().runTop(run, this->fAscentStyle), in measureTextInsideOneRun()
979 run->calculateWidth(result.pos, result.pos + result.size, false), in measureTextInsideOneRun()
980 run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in measureTextInsideOneRun()
995 if (run->leftToRight()) { in measureTextInsideOneRun()
1040 auto run = this->fOwner->run(r); in iterateThroughClustersInGlyphsOrder() local
1041 auto trimmedRange = fClusterRange.intersection(run.clusterRange()); in iterateThroughClustersInGlyphsOrder()
1042 auto trailedRange = fGhostClusterRange.intersection(run.clusterRange()); in iterateThroughClustersInGlyphsOrder()
1047 directional_for_each(trailed, reversed != run.leftToRight(), [&](Cluster& cluster) { in iterateThroughClustersInGlyphsOrder()
1062 const Run* run, in iterateThroughSingleRunByStyles() argument
1069 … textRange, run, runOffset, textOffsetInRun, styleType == StyleType::kDecorations, textAdjustment); in iterateThroughSingleRunByStyles()
1072 result.clip.fTop = this->sizes().runTop(run, LineMetricStyle::CSS); in iterateThroughSingleRunByStyles()
1074 run->calculateHeight(LineMetricStyle::CSS, LineMetricStyle::CSS); in iterateThroughSingleRunByStyles()
1079 if (run->fEllipsis) { in iterateThroughSingleRunByStyles()
1081 ClipContext clipContext = correctContext(run->textRange(), 0.0f); in iterateThroughSingleRunByStyles()
1082 TextRange testRange(run->fClusterStart, run->fClusterStart + run->textRange().width()); in iterateThroughSingleRunByStyles()
1088 return run->advance().fX; in iterateThroughSingleRunByStyles()
1116 (run->leftToRight() ? fBlockRange.start + index : fBlockRange.end - index - 1); in iterateThroughSingleRunByStyles()
1195 const auto run = &this->fOwner->run(runIndex); in iterateThroughVisualRuns() local
1196 auto lineIntersection = intersected(run->textRange(), textRange); in iterateThroughVisualRuns()
1201 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) { in iterateThroughVisualRuns()
1203 // that RTL run could start before the line (trailing spaces) in iterateThroughVisualRuns()
1206 … TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange); in iterateThroughVisualRuns()
1208 …auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, TextAdjustment… in iterateThroughVisualRuns()
1214 if (!visitor(run, runOffset, lineIntersection, &width)) { in iterateThroughVisualRuns()
1267 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in getMetrics() argument
1268 if (run->placeholderStyle() != nullptr) { in getMetrics()
1269 *runWidthInLine = run->advance().fX; in getMetrics()
1273 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kForeground, in getMetrics()
1274 [&result, &run](TextRange textRange, const TextStyle& style, const ClipContext& context) { in getMetrics()
1276 run->fFont.getMetrics(&fontMetrics); in getMetrics()
1307 const Run* lastRun = nullptr; in getRectsForRange()
1311 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in getRectsForRange() argument
1313 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in getRectsForRange()
1314 …[run, runOffsetInLine, textRange0, rectHeightStyle, rectWidthStyle, &boxes, &lastRun, startBox, th… in getRectsForRange()
1324 // Found a run that intersects with the text in getRectsForRange()
1326 intersect, run, runOffsetInLine, 0, true, TextAdjustment::GraphemeGluster); in getRectsForRange()
1381 if (run->fHeightMultiplier <= 0) { in getRectsForRange()
1385 clip.fTop = effectiveBaseline + run->ascent(); in getRectsForRange()
1386 clip.fBottom = effectiveBaseline + run->descent(); in getRectsForRange()
1395 // in case the run order and the paragraph order don't match in getRectsForRange()
1403 // There are trailing spaces in this run in getRectsForRange()
1408 if(run->leftToRight()) { in getRectsForRange()
1416 !run->leftToRight()) in getRectsForRange()
1424 run->leftToRight()) in getRectsForRange()
1444 context.run->leftToRight() == lastRun->leftToRight() && in getRectsForRange()
1446 context.run->placeholderStyle() == nullptr && in getRectsForRange()
1448 context.run->heightMultiplier()) && in getRectsForRange()
1449 lastRun->font() == context.run->font()) in getRectsForRange()
1462 lastRun = context.run; in getRectsForRange()
1467 boxes.emplace_back(clip, context.run->getTextDirection()); in getRectsForRange()
1519 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in getGlyphPositionAtCoordinate() argument
1522 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in getGlyphPositionAtCoordinate()
1523 [this, run, dx, &result, &keepLooking] in getGlyphPositionAtCoordinate()
1530 if (run->leftToRight()) { in getGlyphPositionAtCoordinate()
1545 … auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos)); in getGlyphPositionAtCoordinate()
1546 if (run->leftToRight()) { in getGlyphPositionAtCoordinate()
1551 // If we haven't reached the end of the run we need to keep looking in getGlyphPositionAtCoordinate()
1555 return !run->leftToRight(); in getGlyphPositionAtCoordinate()
1560 …auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos + context.size… in getGlyphPositionAtCoordinate()
1561 if (run->leftToRight()) { in getGlyphPositionAtCoordinate()
1567 return run->leftToRight(); in getGlyphPositionAtCoordinate()
1570 // So we found the run that contains our coordinates in getGlyphPositionAtCoordinate()
1571 // Find the glyph position in the run that is the closest left of our point in getGlyphPositionAtCoordinate()
1576 auto end = context.run->positionX(index) + context.fTextShift + offsetX; in getGlyphPositionAtCoordinate()
1582 } else if (end == dx && !context.run->leftToRight()) { in getGlyphPositionAtCoordinate()
1590 … SkScalar glyphemePosLeft = context.run->positionX(found) + context.fTextShift + offsetX; in getGlyphPositionAtCoordinate()
1591 … SkScalar glyphemesWidth = context.run->positionX(found + 1) - context.run->positionX(found); in getGlyphPositionAtCoordinate()
1594 auto clusterIndex8 = context.run->globalClusterIndex(found); in getGlyphPositionAtCoordinate()
1595 auto clusterEnd8 = context.run->globalClusterIndex(found + 1); in getGlyphPositionAtCoordinate()
1609 if ((dx < graphemeCenter) == context.run->leftToRight()) { in getGlyphPositionAtCoordinate()
1617 } else if ((dx < center) == context.run->leftToRight()) { in getGlyphPositionAtCoordinate()
1621 size_t utf16Index = context.run->leftToRight() in getGlyphPositionAtCoordinate()
1639 [&boxes, this](const Run* run, SkScalar runOffset, TextRange textRange, in getRectsForPlaceholders()
1642 textRange, run, runOffset, 0, true, TextAdjustment::GraphemeGluster); in getRectsForPlaceholders()
1648 if (!run->isPlaceholder()) { in getRectsForPlaceholders()
1661 boxes.emplace_back(clip, run->getTextDirection()); in getRectsForPlaceholders()