• Home
  • Raw
  • Download

Lines Matching full:run

27 #include "src/Run.h"
173 auto& run = fOwner->run(runIndex); in TextLine() local
174 runLevels[runLevelsIndex++] = run.fBidiLevel; in TextLine()
176 … InternalLineMetrics(run.correctAscent(), run.correctDescent(), run.fFontMetrics.fLeading)); in TextLine()
177 if (run.isPlaceholder()) { in TextLine()
191 if (fOwner->run(runIndex).isPlaceholder()) { in TextLine()
227 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
229 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in paint()
230 …[painter, x, y, run, this](TextRange textRange, const TextStyle& style, const ClipContext& context… in paint()
234 paintRoundRect(painter, x, y, run); in paint()
246 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
248 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kShadow, in paint()
271 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
273 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, in paint()
290 … (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in paint() argument
292 … TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kDecorations, in paint()
309 void TextLine::computeRoundRect(int& index, int& preIndex, std::vector<Run*>& groupRuns, Run* run) { in computeRoundRect() argument
321 … // runCount - 1 is the last run index, index + 1 is next run index, -1 is the invalid styleId in computeRoundRect()
323 // index - preIndex > 1 means the left run has no background rect in computeRoundRect()
325 // runCount - 1 is the last run index in computeRoundRect()
329 groupRuns.push_back(run); in computeRoundRect()
334 run->setRoundRectType(RoundRectType::ALL); in computeRoundRect()
336 run->setRoundRectType(RoundRectType::LEFT_ONLY); in computeRoundRect()
338 run->setRoundRectType(RoundRectType::RIGHT_ONLY); in computeRoundRect()
340 run->setRoundRectType(RoundRectType::NONE); in computeRoundRect()
370 … [this](const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in prepareRoundRect() argument
372 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kBackground, in prepareRoundRect()
373 [run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) { in prepareRoundRect()
379 std::vector<Run*> groupRuns; in prepareRoundRect()
383 auto run = &this->fOwner->run(runIndex); in prepareRoundRect() local
384 run->setIndexInLine(static_cast<size_t>(index)); in prepareRoundRect()
385 computeRoundRect(index, preIndex, groupRuns, run); in prepareRoundRect()
397 fOwner->run(fRunsInVisualOrder[0]).placeholderStyle() == nullptr) { in ensureTextBlobCachePopulated()
403 const auto& run = fOwner->run(fRunsInVisualOrder[0]); in ensureTextBlobCachePopulated() local
404 auto clip = SkRect::MakeXYWH(0.0f, this->sizes().runTop(&run, this->fAscentStyle), in ensureTextBlobCachePopulated()
406 run.calculateHeight(this->fAscentStyle, this->fDescentStyle)); in ensureTextBlobCachePopulated()
412 if (run.leftToRight()) { in ensureTextBlobCachePopulated()
419 ClipContext context = {/*run=*/&run, in ensureTextBlobCachePopulated()
422 /*fTextShift=*/-run.positionX(glyphs.start), // starting position in ensureTextBlobCachePopulated()
433 [this](const Run* run, in ensureTextBlobCachePopulated()
437 if (run->placeholderStyle() != nullptr) { in ensureTextBlobCachePopulated()
438 *runWidthInLine = run->advance().fX; in ensureTextBlobCachePopulated()
443 run, in ensureTextBlobCachePopulated()
534 const Run* run, SkScalar runOffset, TextRange textRange, SkScalar* width) { in scanStyles() argument
537 run, in scanStyles()
557 if (context.run->placeholderStyle() != nullptr) { in buildTextBlob()
569 record.fVisitor_Run = context.run; in buildTextBlob()
580 context.run->copyTo(builder, in buildTextBlob()
588 context.run->copyTo(builder, SkToU32(context.pos), context.size); in buildTextBlob()
601 SkASSERT(nearlyEqual(context.run->baselineShift(), style.getBaselineShift())); in buildTextBlob()
622 …this->offset().fY + correctedBaseline - (context.run ? context.run->fCompressionBaselineShift : 0)… in buildTextBlob()
676 void TextLine::paintRoundRect(ParagraphPainter* painter, SkScalar x, SkScalar y, const Run* run) co… in paintRoundRect()
677 size_t index = run->getIndexInLine(); in paintRoundRect()
691 RoundRectType rType = run->getRoundRectType(); in paintRoundRect()
693 ltRadius = std::fmin(attr.roundRectStyle.leftTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
694 lbRadius = std::fmin(attr.roundRectStyle.leftBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
697 rtRadius = std::fmin(attr.roundRectStyle.rightTopRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
698 rbRadius = std::fmin(attr.roundRectStyle.rightBottomRadius, run->getMaxRoundRectRadius()); in paintRoundRect()
701 SkRect skRect(SkRect::MakeLTRB(attr.rect.left(), run->getTopInGroup(), attr.rect.right(), in paintRoundRect()
702 run->getBottomInGroup())); in paintRoundRect()
725 context.run->copyTo(builder, context.pos, context.size); in paintShadow()
823 if (cluster->run().leftToRight()) { in justify()
873 auto& run = cluster->run(); in shiftCluster() local
877 if (end == run.size()) { in shiftCluster()
882 if (run.fJustificationShifts.empty()) { in shiftCluster()
884 run.fJustificationShifts.push_back_n(run.size() + 1, { 0, 0 }); in shiftCluster()
888 run.fJustificationShifts[pos] = { shift, prevShift }; in shiftCluster()
893 auto& run = cluster->run(); in spacingCluster() local
896 if (end == run.size()) { in spacingCluster()
901 if (run.fAutoSpacings.empty()) { in spacingCluster()
903 run.fAutoSpacings.push_back_n(run.size() + 1, { 0, 0 }); in spacingCluster()
907 run.fAutoSpacings[pos] = { spacing, prevSpacing}; in spacingCluster()
957 std::unique_ptr<Run> ellipsisRun; in createTailEllipsis()
967 // Shape the ellipsis if the run has changed in createTailEllipsis()
999 // Get the last run directions after clipping in createTailEllipsis()
1001 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight(); in createTailEllipsis()
1041 std::unique_ptr<Run> ellipsisRun; in createHeadEllipsis()
1045 // Shape the ellipsis if the run has changed in createHeadEllipsis()
1060 // Get the last run directions after clipping in createHeadEllipsis()
1062 fLastClipRunLtr = fOwner->run(fEllipsisIndex).leftToRight(); in createHeadEllipsis()
1089 std::unique_ptr<Run> TextLine::shapeEllipsis(const SkString& ellipsis, const Cluster* cluster) { in shapeEllipsis()
1095 std::unique_ptr<Run> run() & { return std::move(fRun); } in shapeEllipsis() function in skia::textlayout::TextLine::shapeEllipsis::ShapeHandler
1106 …fRun = std::make_unique<Run>(nullptr, info, 0, fLineHeight, fUseHalfLeading, fBaselineShift, 0, 0); in shapeEllipsis()
1119 std::unique_ptr<Run> fRun; in shapeEllipsis()
1126 const Run& run = cluster->run(); in shapeEllipsis() local
1130 if (run.leftToRight() && cluster->textRange().end <= block.fRange.end) { in shapeEllipsis()
1133 } else if (!run.leftToRight() && cluster->textRange().start <= block.fRange.end) { in shapeEllipsis()
1140 auto shaped = [&](sk_sp<SkTypeface> typeface, bool fallback) -> std::unique_ptr<Run> { in shapeEllipsis()
1142 auto shaped = [&](std::shared_ptr<RSTypeface> typeface, bool fallback) -> std::unique_ptr<Run> { in shapeEllipsis()
1144 … ShapeHandler handler(run.heightMultiplier(), run.useHalfLeading(), run.baselineShift(), ellipsis); in shapeEllipsis()
1172 auto ellipsisRun = handler.run(); in shapeEllipsis()
1208 auto ellipsisRun = shaped(run.fFont.refTypeface(), false); in shapeEllipsis()
1210 auto ellipsisRun = shaped(const_cast<RSFont&>(run.fFont).GetTypeface(), false); in shapeEllipsis()
1237 const Run* run, in shapeEllipsis() argument
1242 ClipContext result = { run, 0, run->size(), 0, SkRect::MakeEmpty(), 0, false }; in shapeEllipsis()
1244 if (run->fEllipsis) { in shapeEllipsis()
1248 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1249 run->advance().fX, in shapeEllipsis()
1250run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1252 } else if (run->isPlaceholder()) { in shapeEllipsis()
1254 if (SkScalarIsFinite(run->fFontMetrics.fAscent)) { in shapeEllipsis()
1256 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1257 run->advance().fX, in shapeEllipsis()
1258run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1260 … result.clip = SkRect::MakeXYWH(runOffsetInLine, run->fFontMetrics.fAscent, run->advance().fX, 0); in shapeEllipsis()
1275 run->findLimitingGlyphClusters(textRange); in shapeEllipsis()
1287 run->findLimitingGraphemes(updatedTextRange); in shapeEllipsis()
1301 if (!run->leftToRight()) { in shapeEllipsis()
1306 auto textStartInRun = run->positionX(start->startPos()); in shapeEllipsis()
1308 if (!run->leftToRight()) { in shapeEllipsis()
1312 if (!run->fJustificationShifts.empty()) { in shapeEllipsis()
1315 auto j = run->fJustificationShifts[i]; in shapeEllipsis()
1327 sizes().runTop(run, this->fAscentStyle), in shapeEllipsis()
1328 run->calculateWidth(result.pos, result.pos + result.size, false), in shapeEllipsis()
1329 run->calculateHeight(this->fAscentStyle,this->fDescentStyle)); in shapeEllipsis()
1344 if (run->leftToRight()) { in shapeEllipsis()
1396 auto run = this->fOwner->run(r); in shapeEllipsis() local
1397 auto trimmedRange = fClusterRange.intersection(run.clusterRange()); in shapeEllipsis()
1398 auto trailedRange = fGhostClusterRange.intersection(run.clusterRange()); in shapeEllipsis()
1403 directional_for_each(trailed, reversed != run.leftToRight(), [&](Cluster& cluster) { in shapeEllipsis()
1442 const Run* run, in shapeEllipsis() argument
1451 textRange, run, runOffset, textOffsetInRun, includeGhostSpaces, textAdjustment); in shapeEllipsis()
1454 … result.clip.fTop = this->sizes().runTop(run, LineMetricStyle::CSS) - run->baselineShift(); in shapeEllipsis()
1456 run->calculateHeight(LineMetricStyle::CSS, LineMetricStyle::CSS); in shapeEllipsis()
1461 if (run->fEllipsis) { in shapeEllipsis()
1463 ClipContext clipContext = correctContext(run->textRange(), 0.0f); in shapeEllipsis()
1471 return run->advance().fX; in shapeEllipsis()
1474 … if (block->fRange.start >= run->fClusterStart && block->fRange.end < run->fClusterStart) { in shapeEllipsis()
1476 return run->advance().fX; in shapeEllipsis()
1486 … if (clipContext.clip.height() > 0 || (run->isPlaceholder() && clipContext.clip.height() == 0)) { in shapeEllipsis()
1511 (run->leftToRight() ? fBlockRange.start + index : fBlockRange.end - index - 1); in shapeEllipsis()
1560 clipContext.clip.fTop = run->fFontMetrics.fAscent + this->baseline(); in shapeEllipsis()
1562 clipContext.clip.fTop = run->fFontMetrics.fAscent - run->fCorrectAscent; in shapeEllipsis()
1564 clipContext.clip.fBottom = clipContext.clip.fTop + run->fFontMetrics.fDescent - in shapeEllipsis()
1565 run->fFontMetrics.fAscent; in shapeEllipsis()
1638 const auto run = &this->fOwner->run(runIndex); in shapeEllipsis() local
1639 auto lineIntersection = intersected(run->textRange(), textRange); in shapeEllipsis()
1644 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) { in shapeEllipsis()
1646 // that RTL run could start before the line (trailing spaces) in shapeEllipsis()
1649 … TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange); in shapeEllipsis()
1651 auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, in shapeEllipsis()
1657 if (!visitor(run, runOffset, lineIntersection, &width)) { in shapeEllipsis()
1691 const auto run = &this->fOwner->run(runIndex); in shapeEllipsis() local
1692 auto lineIntersection = intersected(run->textRange(), textRange); in shapeEllipsis()
1696 if (!run->leftToRight() && runOffset == 0 && includingGhostSpaces) { in shapeEllipsis()
1698 // that RTL run could start before the line (trailing spaces) in shapeEllipsis()
1701 … TextRange(fTextExcludingSpaces.end, fTextIncludingNewlines.end), run->fTextRange); in shapeEllipsis()
1703 …auto whitespacesLen = measureTextInsideOneRun(whitespaces, run, runOffset, 0, true, false).clip.wi… in shapeEllipsis()
1709 if (!visitor(run, runOffset, lineIntersection, &width)) { in shapeEllipsis()
1769 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
1770 if (run->placeholderStyle() != nullptr) { in shapeEllipsis()
1771 *runWidthInLine = run->advance().fX; in shapeEllipsis()
1775 TextAdjustment::GlyphCluster, run, runOffsetInLine, textRange, StyleType::kForeground, in shapeEllipsis()
1776 [&result, &run](TextRange textRange, const TextStyle& style, const ClipContext& context) { in shapeEllipsis()
1779 run->fFont.getMetrics(&fontMetrics); in shapeEllipsis()
1782 run->fFont.GetMetrics(&fontMetrics); in shapeEllipsis()
1785 auto decompressFont = run->fFont; in shapeEllipsis()
1819 const Run* lastRun = nullptr; in shapeEllipsis()
1827 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
1829 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in shapeEllipsis()
1830 …[run, runOffsetInLine, textRange0, rectHeightStyle, rectWidthStyle, &boxes, &lastRun, startBox, th… in shapeEllipsis()
1840 // Found a run that intersects with the text in shapeEllipsis()
1842 intersect, run, runOffsetInLine, 0, true, TextAdjustment::GraphemeGluster); in shapeEllipsis()
1897 if (run->fHeightMultiplier <= 0) { in shapeEllipsis()
1901 clip.fTop = effectiveBaseline + run->ascent(); in shapeEllipsis()
1902 clip.fBottom = effectiveBaseline + run->descent(); in shapeEllipsis()
1911 // in case the run order and the paragraph order don't match in shapeEllipsis()
1919 // There are trailing spaces in this run in shapeEllipsis()
1924 if(run->leftToRight()) { in shapeEllipsis()
1932 !run->leftToRight()) in shapeEllipsis()
1940 run->leftToRight()) in shapeEllipsis()
1960 context.run->leftToRight() == lastRun->leftToRight() && in shapeEllipsis()
1962 context.run->placeholderStyle() == nullptr && in shapeEllipsis()
1964 context.run->heightMultiplier()) && in shapeEllipsis()
1966 lastRun->font() == context.run->font()) in shapeEllipsis()
1968 IsRSFontEquals(lastRun->font(), context.run->font())) in shapeEllipsis()
1982 lastRun = context.run; in shapeEllipsis()
1987 boxes.emplace_back(clip, context.run->getTextDirection()); in shapeEllipsis()
2043 (const Run* run, SkScalar runOffsetInLine, TextRange textRange, SkScalar* runWidthInLine) { in shapeEllipsis() argument
2046 TextAdjustment::GraphemeGluster, run, runOffsetInLine, textRange, StyleType::kNone, in shapeEllipsis()
2047 [this, run, dx, &result, &keepLooking] in shapeEllipsis()
2054 if (run->leftToRight()) { in shapeEllipsis()
2069 … auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos)); in shapeEllipsis()
2070 if (run->leftToRight()) { in shapeEllipsis()
2075 // If we haven't reached the end of the run we need to keep looking in shapeEllipsis()
2079 return !run->leftToRight(); in shapeEllipsis()
2084 …auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos + context.size… in shapeEllipsis()
2085 if (run->leftToRight()) { in shapeEllipsis()
2091 return run->leftToRight(); in shapeEllipsis()
2094 // So we found the run that contains our coordinates in shapeEllipsis()
2095 // Find the glyph position in the run that is the closest left of our point in shapeEllipsis()
2100 auto end = context.run->positionX(index) + context.fTextShift + offsetX; in shapeEllipsis()
2106 } else if (end == dx && !context.run->leftToRight()) { in shapeEllipsis()
2114 … SkScalar glyphemePosLeft = context.run->positionX(found) + context.fTextShift + offsetX; in shapeEllipsis()
2115 … SkScalar glyphemesWidth = context.run->positionX(found + 1) - context.run->positionX(found); in shapeEllipsis()
2118 auto clusterIndex8 = context.run->globalClusterIndex(found); in shapeEllipsis()
2119 auto clusterEnd8 = context.run->globalClusterIndex(found + 1); in shapeEllipsis()
2133 if ((dx < graphemeCenter) == context.run->leftToRight()) { in shapeEllipsis()
2141 } else if ((dx < center) == context.run->leftToRight()) { in shapeEllipsis()
2145 size_t utf16Index = context.run->leftToRight() in shapeEllipsis()
2166 [&boxes, this](const Run* run, SkScalar runOffset, TextRange textRange, in shapeEllipsis()
2169 textRange, run, runOffset, 0, true, TextAdjustment::GraphemeGluster); in shapeEllipsis()
2175 if (!run->isPlaceholder()) { in shapeEllipsis()
2188 boxes.emplace_back(clip, run->getTextDirection()); in shapeEllipsis()
2231 textLine.fEllipsis = std::make_unique<Run>(*this->fEllipsis); in shapeEllipsis()