Lines Matching refs:run
180 auto& run = fOwner->run(runIndex);
181 runLevels[runLevelsIndex++] = run.fBidiLevel;
183 InternalLineMetrics(run.correctAscent(), run.correctDescent(), run.fFontMetrics.fLeading));
184 if (run.isPlaceholder()) {
198 if (fOwner->run(runIndex).isPlaceholder()) {
234 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
236 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground,
237 [painter, x, y, run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) {
241 paintRoundRect(painter, x, y, run);
253 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
255 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kShadow,
278 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
280 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange,
297 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
299 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kDecorations,
316 void TextLine::computeRoundRect(int& index, int& preIndex, std::vector<Run*>& groupRuns, Run* run) {
328 // runCount - 1 is the last run index, index + 1 is next run index, -1 is the invalid styleId
330 // index - preIndex > 1 means the left run has no background rect
332 // runCount - 1 is the last run index
336 groupRuns.push_back(run);
341 run->setRoundRectType(RoundRectType::ALL);
343 run->setRoundRectType(RoundRectType::LEFT_ONLY);
345 run->setRoundRectType(RoundRectType::RIGHT_ONLY);
347 run->setRoundRectType(RoundRectType::NONE);
377 [this](const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
379 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground,
380 [run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) {
390 auto run = &this->fOwner->run(runIndex);
391 run->setIndexInLine(static_cast<size_t>(index));
392 computeRoundRect(index, preIndex, groupRuns, run);
404 fOwner->run(fRunsInVisualOrder[0]).placeholderStyle() == nullptr) {
410 const auto& run = fOwner->run(fRunsInVisualOrder[0]);
411 auto clip = SkRect::MakeXYWH(0.0f, this->sizes().runTop(&run, this->fAscentStyle),
413 run.calculateHeight(this->fAscentStyle, this->fDescentStyle));
419 if (run.leftToRight()) {
426 ClipContext context = {/*run=*/&run,
429 /*fTextShift=*/-run.positionX(glyphs.start), // starting position
440 [this](const Run* run,
444 if (run->placeholderStyle() != nullptr) {
445 *runWidthInLine = run->advance().fX;
450 run,
534 const Run* run, SkScalar runOffset, TextRange textRange, SkScalar* width) {
537 run,
557 if (context.run->placeholderStyle() != nullptr) {
569 record.fVisitor_Run = context.run;
580 context.run->copyTo(builder,
588 context.run->copyTo(builder, SkToU32(context.pos), context.size);
601 SkASSERT(nearlyEqual(context.run->baselineShift(), style.getBaselineShift()));
622 this->offset().fY + correctedBaseline - (context.run ? context.run->fCompressionBaselineShift : 0));
676 void TextLine::paintRoundRect(ParagraphPainter* painter, SkScalar x, SkScalar y, const Run* run) const {
677 size_t index = run->getIndexInLine();
691 RoundRectType rType = run->getRoundRectType();
693 ltRadius = std::fmin(attr.roundRectStyle.leftTopRadius, run->getMaxRoundRectRadius());
694 lbRadius = std::fmin(attr.roundRectStyle.leftBottomRadius, run->getMaxRoundRectRadius());
697 rtRadius = std::fmin(attr.roundRectStyle.rightTopRadius, run->getMaxRoundRectRadius());
698 rbRadius = std::fmin(attr.roundRectStyle.rightBottomRadius, run->getMaxRoundRectRadius());
701 SkRect skRect(SkRect::MakeLTRB(attr.rect.left(), run->getTopInGroup(), attr.rect.right(),
702 run->getBottomInGroup()));
725 context.run->copyTo(builder, context.pos, context.size);
823 if (cluster->run().leftToRight()) {
873 auto& run = cluster->run();
877 if (end == run.size()) {
882 if (run.fJustificationShifts.empty()) {
884 run.fJustificationShifts.push_back_n(run.size() + 1, { 0, 0 });
888 run.fJustificationShifts[pos] = { shift, prevShift };
893 auto& run = cluster->run();
896 if (end == run.size()) {
901 if (run.fAutoSpacings.empty()) {
903 run.fAutoSpacings.push_back_n(run.size() + 1, { 0, 0 });
907 run.fAutoSpacings[pos] = { spacing, prevSpacing};
967 // Shape the ellipsis if the run has changed
999 // Get the last run directions after clipping
1001 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight();
1045 // Shape the ellipsis if the run has changed
1060 // Get the last run directions after clipping
1062 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight();
1095 std::unique_ptr<Run> run() & { return std::move(fRun); }
1126 const Run& run = cluster->run();
1130 if (run.leftToRight() && cluster->textRange().end <= block.fRange.end) {
1133 } else if (!run.leftToRight() && cluster->textRange().start <= block.fRange.end) {
1144 ShapeHandler handler(run.heightMultiplier(), run.useHalfLeading(), run.baselineShift(), ellipsis);
1172 auto ellipsisRun = handler.run();
1208 auto ellipsisRun = shaped(run.fFont.refTypeface(), false);
1210 auto ellipsisRun = shaped(const_cast<RSFont&>(run.fFont).GetTypeface(), false);
1237 const Run* run,
1242 ClipContext result = { run, 0, run->size(), 0, SkRect::MakeEmpty(), 0, false };
1244 if (run->fEllipsis) {
1248 sizes().runTop(run, this->fAscentStyle),
1249 run->advance().fX,
1250 run->calculateHeight(this->fAscentStyle,this->fDescentStyle));
1252 } else if (run->isPlaceholder()) {
1254 if (SkScalarIsFinite(run->fFontMetrics.fAscent)) {
1256 sizes().runTop(run, this->fAscentStyle),
1257 run->advance().fX,
1258 run->calculateHeight(this->fAscentStyle,this->fDescentStyle));
1260 result.clip = SkRect::MakeXYWH(runOffsetInLine, run->fFontMetrics.fAscent, run->advance().fX, 0);
1275 run->findLimitingGlyphClusters(textRange);
1287 run->findLimitingGraphemes(updatedTextRange);
1301 if (!run->leftToRight()) {
1306 auto textStartInRun = run->positionX(start->startPos());
1308 if (!run->leftToRight()) {
1312 if (!run->fJustificationShifts.empty()) {
1315 auto j = run->fJustificationShifts[i];
1327 sizes().runTop(run, this->fAscentStyle),
1328 run->calculateWidth(result.pos, result.pos + result.size, false),
1329 run->calculateHeight(this->fAscentStyle,this->fDescentStyle));
1344 if (run->leftToRight()) {
1394 auto run = this->fOwner->run(r);
1395 auto trimmedRange = fClusterRange.intersection(run.clusterRange());
1396 auto trailedRange = fGhostClusterRange.intersection(run.clusterRange());
1401 directional_for_each(trailed, reversed != run.leftToRight(), [&](Cluster& cluster) {
1440 const Run* run,
1449 textRange, run, runOffset, textOffsetInRun, includeGhostSpaces, textAdjustment);
1452 result.clip.fTop = this->sizes().runTop(run, LineMetricStyle::CSS) - run->baselineShift();
1454 run->calculateHeight(LineMetricStyle::CSS, LineMetricStyle::CSS);
1459 if (run->fEllipsis) {
1461 ClipContext clipContext = correctContext(run->textRange(), 0.0f);
1469 return run->advance().fX;
1472 if (block->fRange.start >= run->fClusterStart && block->fRange.end < run->fClusterStart) {
1474 return run->advance().fX;
1485 (run->isPlaceholder() && SkScalarNearlyZero(clipContext.clip.height()))) {
1510 (run->leftToRight() ? fBlockRange.start + index : fBlockRange.end - index - 1);
1559 clipContext.clip.fTop = run->fFontMetrics.fAscent + this->baseline();
1561 clipContext.clip.fTop = run->fFontMetrics.fAscent - run->fCorrectAscent;
1563 clipContext.clip.fBottom = clipContext.clip.fTop + run->fFontMetrics.fDescent -
1564 run->fFontMetrics.fAscent;
1642 const auto run = &this->fOwner->run(runIndex);
1643 auto lineIntersection = intersected(run->textRange(), textRange);
1648 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) {
1650 // that RTL run could start before the line (trailing spaces)
1653 TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange);
1655 auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true,
1661 if (!visitor(run, runOffset, lineIntersection, &width)) {
1695 const auto run = &this->fOwner->run(runIndex);
1696 auto lineIntersection = intersected(run->textRange(), textRange);
1701 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) {
1703 // that RTL run could start before the line (trailing spaces)
1706 TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange);
1708 auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, false).clip.width();
1714 if (!visitor(run, runOffset, lineIntersection, &width)) {
1774 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
1775 if (run->placeholderStyle() != nullptr) {
1776 *runWidthInLine = run->advance().fX;
1780 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kForeground,
1781 [&result, &run](TextRange textRange, const TextStyle& style, const ClipContext& context) {
1784 run->fFont.getMetrics(&fontMetrics);
1787 run->fFont.GetMetrics(&fontMetrics);
1790 auto decompressFont = run->fFont;
1832 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
1834 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone,
1835 [run, runOffsetInLine, textRange0, rectHeightStyle, rectWidthStyle, &boxes, &lastRun, startBox, this]
1845 // Found a run that intersects with the text
1847 intersect, run, runOffsetInLine, 0, true, TextAdjustment::GraphemeGluster);
1902 if (run->fHeightMultiplier <= 0) {
1906 clip.fTop = effectiveBaseline + run->ascent();
1907 clip.fBottom = effectiveBaseline + run->descent();
1916 // in case the run order and the paragraph order don't match
1924 // There are trailing spaces in this run
1929 if(run->leftToRight()) {
1937 !run->leftToRight())
1945 run->leftToRight())
1965 context.run->leftToRight() == lastRun->leftToRight() &&
1967 context.run->placeholderStyle() == nullptr &&
1969 context.run->heightMultiplier()) &&
1971 lastRun->font() == context.run->font())
1973 IsRSFontEquals(lastRun->font(), context.run->font()))
1987 lastRun = context.run;
1992 boxes.emplace_back(clip, context.run->getTextDirection());
2048 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) {
2051 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone,
2052 [this, run, dx, &result, &keepLooking]
2059 if (run->leftToRight()) {
2074 auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos));
2075 if (run->leftToRight()) {
2081 size_t glyphCnt = context.run->glyphs().size();
2082 if ((glyphCnt != 0) && (context.run->fUtf8Range.end() - context.run->fUtf8Range.begin()) /
2089 // If we haven't reached the end of the run we need to keep looking
2093 return !run->leftToRight();
2098 auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos + context.size));
2099 if (run->leftToRight()) {
2105 return run->leftToRight();
2108 // So we found the run that contains our coordinates
2109 // Find the glyph position in the run that is the closest left of our point
2114 auto end = context.run->positionX(index) + context.fTextShift + offsetX;
2120 } else if (end == dx && !context.run->leftToRight()) {
2128 SkScalar glyphemePosLeft = context.run->positionX(found) + context.fTextShift + offsetX;
2129 SkScalar glyphemesWidth = context.run->positionX(found + 1) - context.run->positionX(found);
2132 auto clusterIndex8 = context.run->globalClusterIndex(found);
2133 auto clusterEnd8 = context.run->globalClusterIndex(found + 1);
2147 if ((dx < graphemeCenter) == context.run->leftToRight()) {
2155 } else if ((dx < center) == context.run->leftToRight()) {
2161 size_t glyphCnt = context.run->glyphs().size();
2162 if ((glyphCnt != 0) && !context.run->leftToRight() && (context.run->fUtf8Range.end() -
2163 context.run->fUtf8Range.begin()) / glyphCnt == EMOJI_WIDTH) {
2165 } else if (!context.run->leftToRight()) {
2171 size_t utf16Index = context.run->leftToRight()
2193 [&boxes, this](const Run* run, SkScalar runOffset, TextRange textRange,
2196 textRange, run, runOffset, 0, true, TextAdjustment::GraphemeGluster);
2202 if (!run->isPlaceholder()) {
2215 boxes.emplace_back(clip, run->getTextDirection());
2338 // Belongs to a different run.
2345 // Found a different run.
2352 // All belong to the first run.
2386 auto run = owner->cluster(clusterIndex).runOrNull();
2387 if (run == nullptr) {
2391 SkGlyphID glyphId = run->glyphs()[glyphsIndex];
2394 run->font().getBounds(&glyphId, 1, &glyphBounds, nullptr);
2397 run->font().GetWidths(&glyphId, 1, nullptr, &glyphBounds);