Lines Matching full:run
27 #include "src/Run.h"
206 auto& run = fOwner->run(runIndex); in TextLine() local
207 runLevels[runLevelsIndex++] = run.fBidiLevel; in TextLine()
209 … InternalLineMetrics(run.correctAscent(), run.correctDescent(), run.fFontMetrics.fLeading)); in TextLine()
210 if (run.isPlaceholder()) { in TextLine()
224 if (fOwner->run(runIndex).isPlaceholder()) { in TextLine()
260 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
262 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in paint()
263 …[painter, x, y, run, this](TextRange textRange, const TextStyle& style, const ClipContext& context… in paint()
267 paintRoundRect(painter, x, y, run); in paint()
279 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
281 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kShadow, in paint()
304 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
306 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, in paint()
323 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
325 … TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kDecorations, in paint()
342 void TextLine::computeRoundRect(int& index, int& preIndex, std::vector<Run*>& groupRuns, Run* run) { in computeRoundRect() argument
354 … // runCount - 1 is the last run index, index + 1 is next run index, -1 is the invalid styleId in computeRoundRect()
356 // index - preIndex > 1 means the left run has no background rect in computeRoundRect()
358 // runCount - 1 is the last run index in computeRoundRect()
362 groupRuns.push_back(run); in computeRoundRect()
367 run->setRoundRectType(RoundRectType::ALL); in computeRoundRect()
369 run->setRoundRectType(RoundRectType::LEFT_ONLY); in computeRoundRect()
371 run->setRoundRectType(RoundRectType::RIGHT_ONLY); in computeRoundRect()
373 run->setRoundRectType(RoundRectType::NONE); in computeRoundRect()
403 … [this](const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in prepareRoundRect() argument
405 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in prepareRoundRect()
406 [run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) { in prepareRoundRect()
412 std::vector<Run*> groupRuns; in prepareRoundRect()
416 auto run = &this->fOwner->run(runIndex); in prepareRoundRect() local
417 run->setIndexInLine(static_cast<size_t>(index)); in prepareRoundRect()
418 computeRoundRect(index, preIndex, groupRuns, run); in prepareRoundRect()
430 fOwner->run(fRunsInVisualOrder[0]).placeholderStyle() == nullptr) { in ensureTextBlobCachePopulated()
436 const auto& run = fOwner->run(fRunsInVisualOrder[0]); in ensureTextBlobCachePopulated() local
437 auto clip = SkRect::MakeXYWH(0.0f, this->sizes().runTop(&run, this->fAscentStyle), in ensureTextBlobCachePopulated()
439 run.calculateHeight(this->fAscentStyle, this->fDescentStyle)); in ensureTextBlobCachePopulated()
445 if (run.leftToRight()) { in ensureTextBlobCachePopulated()
452 ClipContext context = {/*run=*/&run, in ensureTextBlobCachePopulated()
455 /*fTextShift=*/-run.positionX(glyphs.start), // starting position in ensureTextBlobCachePopulated()
466 [this](const Run* run, in ensureTextBlobCachePopulated()
470 if (run->placeholderStyle() != nullptr) { in ensureTextBlobCachePopulated()
471 *runWidthInLine = run->advance().fX; in ensureTextBlobCachePopulated()
476 run, in ensureTextBlobCachePopulated()
567 const Run* run, SkScalar runOffset, TextRange textRange, SkScalar* width) { in scanStyles() argument
570 run, in scanStyles()
590 if (context.run->placeholderStyle() != nullptr) { in buildTextBlob()
602 record.fVisitor_Run = context.run; in buildTextBlob()
613 context.run->copyTo(builder, in buildTextBlob()
621 context.run->copyTo(builder, SkToU32(context.pos), context.size); in buildTextBlob()
634 SkASSERT(nearlyEqual(context.run->baselineShift(), style.getBaselineShift())); in buildTextBlob()
655 …this->offset().fY + correctedBaseline - (context.run ? context.run->fCompressionBaselineShift : 0)… in buildTextBlob()
709 void TextLine::paintRoundRect(ParagraphPainter* painter, SkScalar x, SkScalar y, const Run* run) co… in paintRoundRect()
710 size_t index = run->getIndexInLine(); in paintRoundRect()
724 RoundRectType rType = run->getRoundRectType(); in paintRoundRect()
726 ltRadius = std::fmin(attr.roundRectStyle.leftTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
727 lbRadius = std::fmin(attr.roundRectStyle.leftBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
730 rtRadius = std::fmin(attr.roundRectStyle.rightTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
731 rbRadius = std::fmin(attr.roundRectStyle.rightBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
734 SkRect skRect(SkRect::MakeLTRB(attr.rect.left(), run->getTopInGroup(), attr.rect.right(), in paintRoundRect()
735 run->getBottomInGroup())); in paintRoundRect()
758 context.run->copyTo(builder, context.pos, context.size); in paintShadow()
776 (context.run ? context.run->fCompressionBaselineShift : 0), in paintShadow()
861 if (cluster->run().leftToRight()) { in justify()
911 auto& run = cluster->run(); in shiftCluster() local
915 if (end == run.size()) { in shiftCluster()
920 if (run.fJustificationShifts.empty()) { in shiftCluster()
922 run.fJustificationShifts.push_back_n(run.size() + 1, { 0, 0 }); in shiftCluster()
926 run.fJustificationShifts[pos] = { shift, prevShift }; in shiftCluster()
931 auto& run = cluster->run(); in spacingCluster() local
934 if (end == run.size()) { in spacingCluster()
939 if (run.fAutoSpacings.empty()) { in spacingCluster()
941 run.fAutoSpacings.push_back_n(run.size() + 1, { 0, 0 }); in spacingCluster()
945 run.fAutoSpacings[pos] = { spacing, prevSpacing}; in spacingCluster()
995 std::unique_ptr<Run> ellipsisRun; in createTailEllipsis()
1005 // Shape the ellipsis if the run has changed in createTailEllipsis()
1037 // Get the last run directions after clipping in createTailEllipsis()
1039 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight(); in createTailEllipsis()
1079 std::unique_ptr<Run> ellipsisRun; in createHeadEllipsis()
1083 // Shape the ellipsis if the run has changed in createHeadEllipsis()
1098 // Get the last run directions after clipping in createHeadEllipsis()
1100 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight(); in createHeadEllipsis()
1127 std::unique_ptr<Run> TextLine::shapeEllipsis(const SkString& ellipsis, const Cluster* cluster) { in shapeEllipsis()
1133 std::unique_ptr<Run> run() & { return std::move(fRun); } in shapeEllipsis() function in skia::textlayout::TextLine::shapeEllipsis::ShapeHandler
1144 …fRun = std::make_unique<Run>(nullptr, info, 0, fLineHeight, fUseHalfLeading, fBaselineShift, 0, 0); in shapeEllipsis()
1157 std::unique_ptr<Run> fRun; in shapeEllipsis()
1164 const Run& run = cluster->run(); in shapeEllipsis() local
1168 if (run.leftToRight() && cluster->textRange().end <= block.fRange.end) { in shapeEllipsis()
1171 } else if (!run.leftToRight() && cluster->textRange().start <= block.fRange.end) { in shapeEllipsis()
1178 auto shaped = [&](sk_sp<SkTypeface> typeface, bool fallback) -> std::unique_ptr<Run> { in shapeEllipsis()
1180 auto shaped = [&](std::shared_ptr<RSTypeface> typeface, bool fallback) -> std::unique_ptr<Run> { in shapeEllipsis()
1182 … ShapeHandler handler(run.heightMultiplier(), run.useHalfLeading(), run.baselineShift(), ellipsis); in shapeEllipsis()
1210 auto ellipsisRun = handler.run(); in shapeEllipsis()
1246 auto ellipsisRun = shaped(run.fFont.refTypeface(), false); in shapeEllipsis()
1248 auto ellipsisRun = shaped(const_cast<RSFont&>(run.fFont).GetTypeface(), false); in shapeEllipsis()
1275 const Run* run, in shapeEllipsis() argument
1280 ClipContext result = { run, 0, run->size(), 0, SkRect::MakeEmpty(), 0, false }; in shapeEllipsis()
1282 if (run->fEllipsis) { in shapeEllipsis()
1286 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1287 run->advance().fX, in shapeEllipsis()
1288 … run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1290 } else if (run->isPlaceholder()) { in shapeEllipsis()
1292 if (SkScalarIsFinite(run->fFontMetrics.fAscent)) { in shapeEllipsis()
1294 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1295 run->advance().fX, in shapeEllipsis()
1296 … run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1298 … result.clip = SkRect::MakeXYWH(runOffsetInLine, run->fFontMetrics.fAscent, run->advance().fX, 0); in shapeEllipsis()
1313 run->findLimitingGlyphClusters(textRange); in shapeEllipsis()
1325 run->findLimitingGraphemes(updatedTextRange); in shapeEllipsis()
1339 if (!run->leftToRight()) { in shapeEllipsis()
1344 auto textStartInRun = run->positionX(start->startPos()); in shapeEllipsis()
1346 if (!run->leftToRight()) { in shapeEllipsis()
1350 if (!run->fJustificationShifts.empty()) { in shapeEllipsis()
1353 auto j = run->fJustificationShifts[i]; in shapeEllipsis()
1365 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1366 run->calculateWidth(result.pos, result.pos + result.size, false), in shapeEllipsis()
1367 run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1382 if (run->leftToRight()) { in shapeEllipsis()
1434 auto run = this->fOwner->run(r); in shapeEllipsis() local
1435 auto trimmedRange = fClusterRange.intersection(run.clusterRange()); in shapeEllipsis()
1436 auto trailedRange = fGhostClusterRange.intersection(run.clusterRange()); in shapeEllipsis()
1441 directional_for_each(trailed, reversed != run.leftToRight(), [&](Cluster& cluster) { in shapeEllipsis()
1480 const Run* run, in shapeEllipsis() argument
1489 textRange, run, runOffset, textOffsetInRun, includeGhostSpaces, textAdjustment); in shapeEllipsis()
1492 … result.clip.fTop = this->sizes().runTop(run, LineMetricStyle::CSS) - run->baselineShift(); in shapeEllipsis()
1494 run->calculateHeight(LineMetricStyle::CSS, LineMetricStyle::CSS); in shapeEllipsis()
1499 if (run->fEllipsis) { in shapeEllipsis()
1501 ClipContext clipContext = correctContext(run->textRange(), 0.0f); in shapeEllipsis()
1509 return run->advance().fX; in shapeEllipsis()
1512 … if (block->fRange.start >= run->fClusterStart && block->fRange.end < run->fClusterStart) { in shapeEllipsis()
1514 return run->advance().fX; in shapeEllipsis()
1524 … if (clipContext.clip.height() > 0 || (run->isPlaceholder() && clipContext.clip.height() == 0)) { in shapeEllipsis()
1549 (run->leftToRight() ? fBlockRange.start + index : fBlockRange.end - index - 1); in shapeEllipsis()
1598 clipContext.clip.fTop = run->fFontMetrics.fAscent + this->baseline(); in shapeEllipsis()
1600 clipContext.clip.fTop = run->fFontMetrics.fAscent - run->fCorrectAscent; in shapeEllipsis()
1602 clipContext.clip.fBottom = clipContext.clip.fTop + run->fFontMetrics.fDescent - in shapeEllipsis()
1603 run->fFontMetrics.fAscent; in shapeEllipsis()
1676 const auto run = &this->fOwner->run(runIndex); in shapeEllipsis() local
1677 auto lineIntersection = intersected(run->textRange(), textRange); in shapeEllipsis()
1682 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) { in shapeEllipsis()
1684 // that RTL run could start before the line (trailing spaces) in shapeEllipsis()
1687 … TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange); in shapeEllipsis()
1689 auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, in shapeEllipsis()
1695 if (!visitor(run, runOffset, lineIntersection, &width)) { in shapeEllipsis()
1729 const auto run = &this->fOwner->run(runIndex); in shapeEllipsis() local
1730 auto lineIntersection = intersected(run->textRange(), textRange); in shapeEllipsis()
1734 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) { in shapeEllipsis()
1736 // that RTL run could start before the line (trailing spaces) in shapeEllipsis()
1739 … TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange); in shapeEllipsis()
1741 …auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, false).clip.wi… in shapeEllipsis()
1747 if (!visitor(run, runOffset, lineIntersection, &width)) { in shapeEllipsis()
1807 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
1808 if (run->placeholderStyle() != nullptr) { in shapeEllipsis()
1809 *runWidthInLine = run->advance().fX; in shapeEllipsis()
1813 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kForeground, in shapeEllipsis()
1814 [&result, &run](TextRange textRange, const TextStyle& style, const ClipContext& context) { in shapeEllipsis()
1817 run->fFont.getMetrics(&fontMetrics); in shapeEllipsis()
1820 run->fFont.GetMetrics(&fontMetrics); in shapeEllipsis()
1823 auto decompressFont = run->fFont; in shapeEllipsis()
1857 const Run* lastRun = nullptr; in shapeEllipsis()
1865 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
1867 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in shapeEllipsis()
1868 …[run, runOffsetInLine, textRange0, rectHeightStyle, rectWidthStyle, &boxes, &lastRun, startBox, th… in shapeEllipsis()
1878 // Found a run that intersects with the text in shapeEllipsis()
1880 intersect, run, runOffsetInLine, 0, true, TextAdjustment::GraphemeGluster); in shapeEllipsis()
1935 if (run->fHeightMultiplier <= 0) { in shapeEllipsis()
1939 clip.fTop = effectiveBaseline + run->ascent(); in shapeEllipsis()
1940 clip.fBottom = effectiveBaseline + run->descent(); in shapeEllipsis()
1949 // in case the run order and the paragraph order don't match in shapeEllipsis()
1957 // There are trailing spaces in this run in shapeEllipsis()
1962 if(run->leftToRight()) { in shapeEllipsis()
1970 !run->leftToRight()) in shapeEllipsis()
1978 run->leftToRight()) in shapeEllipsis()
1998 context.run->leftToRight() == lastRun->leftToRight() && in shapeEllipsis()
2000 context.run->placeholderStyle() == nullptr && in shapeEllipsis()
2002 context.run->heightMultiplier()) && in shapeEllipsis()
2004 lastRun->font() == context.run->font()) in shapeEllipsis()
2006 IsRSFontEquals(lastRun->font(), context.run->font())) in shapeEllipsis()
2020 lastRun = context.run; in shapeEllipsis()
2025 boxes.emplace_back(clip, context.run->getTextDirection()); in shapeEllipsis()
2081 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
2084 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in shapeEllipsis()
2085 [this, run, dx, &result, &keepLooking] in shapeEllipsis()
2092 if (run->leftToRight()) { in shapeEllipsis()
2107 … auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos)); in shapeEllipsis()
2108 if (run->leftToRight()) { in shapeEllipsis()
2113 // If we haven't reached the end of the run we need to keep looking in shapeEllipsis()
2117 return !run->leftToRight(); in shapeEllipsis()
2122 …auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos + context.size… in shapeEllipsis()
2123 if (run->leftToRight()) { in shapeEllipsis()
2129 return run->leftToRight(); in shapeEllipsis()
2132 // So we found the run that contains our coordinates in shapeEllipsis()
2133 // Find the glyph position in the run that is the closest left of our point in shapeEllipsis()
2138 auto end = context.run->positionX(index) + context.fTextShift + offsetX; in shapeEllipsis()
2144 } else if (end == dx && !context.run->leftToRight()) { in shapeEllipsis()
2152 … SkScalar glyphemePosLeft = context.run->positionX(found) + context.fTextShift + offsetX; in shapeEllipsis()
2153 … SkScalar glyphemesWidth = context.run->positionX(found + 1) - context.run->positionX(found); in shapeEllipsis()
2156 auto clusterIndex8 = context.run->globalClusterIndex(found); in shapeEllipsis()
2157 auto clusterEnd8 = context.run->globalClusterIndex(found + 1); in shapeEllipsis()
2171 if ((dx < graphemeCenter) == context.run->leftToRight()) { in shapeEllipsis()
2179 } else if ((dx < center) == context.run->leftToRight()) { in shapeEllipsis()
2183 size_t utf16Index = context.run->leftToRight() in shapeEllipsis()
2204 [&boxes, this](const Run* run, SkScalar runOffset, TextRange textRange, in shapeEllipsis()
2207 textRange, run, runOffset, 0, true, TextAdjustment::GraphemeGluster); in shapeEllipsis()
2213 if (!run->isPlaceholder()) { in shapeEllipsis()
2226 boxes.emplace_back(clip, run->getTextDirection()); in shapeEllipsis()
2257 (context.run ? context.run->fCompressionBaselineShift : 0); in shapeEllipsis()
2282 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
2287 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kShadow, in shapeEllipsis()
2334 textLine.fEllipsis = std::make_unique<Run>(*this->fEllipsis); in shapeEllipsis()