Lines Matching defs:context

237             [painter, x, y, run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) {
239 this->paintBackground(painter, x, y, textRange, style, context);
257 (TextRange textRange, const TextStyle& style, const ClipContext& context) {
258 this->paintShadow(painter, x, y, textRange, style, context);
282 (TextRange textRange, const TextStyle& style, const ClipContext& context) {
284 SkScalar tmpThick = this->calculateThickness(style, context);
301 (TextRange textRange, const TextStyle& style, const ClipContext& context) {
305 this->paintDecorations(painter, x, y, textRange, style, context);
380 [run, this](TextRange textRange, const TextStyle& style, const ClipContext& context) {
381 roundRectAttrs.push_back({style.getStyleId(), style.getBackgroundRect(), context.clip});
426 ClipContext context = {/*run=*/&run,
433 this->buildTextBlob(fTextExcludingSpaces, style, context);
454 [this](TextRange textRange, const TextStyle& style, const ClipContext& context) {
455 this->buildTextBlob(textRange, style, context);
543 const ClipContext& context) {
544 visitor(textRange, style, context);
550 SkRect TextLine::extendHeight(const ClipContext& context) const {
551 SkRect result = context.clip;
556 void TextLine::buildTextBlob(TextRange textRange, const TextStyle& style, const ClipContext& context) {
557 if (context.run->placeholderStyle() != nullptr) {
569 record.fVisitor_Run = context.run;
570 record.fVisitor_Pos = context.pos;
571 record.fVisitor_Size = context.size;
580 context.run->copyTo(builder,
584 context.fTextShift,
585 SkToU32(context.pos),
586 context.size);
588 context.run->copyTo(builder, SkToU32(context.pos), context.size);
593 record.fClippingNeeded = context.clippingNeeded;
595 if (context.clippingNeeded) {
596 record.fClipRect = extendHeight(context).makeOffset(this->offset());
598 record.fClipRect = context.clip.makeOffset(this->offset());
601 SkASSERT(nearlyEqual(context.run->baselineShift(), style.getBaselineShift()));
620 record.fOffset = SkPoint::Make(this->offset().fX + context.fTextShift,
622 this->offset().fY + correctedBaseline - (context.run ? context.run->fCompressionBaselineShift : 0));
669 const ClipContext& context) const {
671 painter->drawRect(context.clip.makeOffset(this->offset() + SkPoint::Make(x, y)),
714 const ClipContext& context) const {
725 context.run->copyTo(builder, context.pos, context.size);
727 if (context.clippingNeeded) {
729 SkRect clip = extendHeight(context);
740 x + this->offset().fX + shadow.fOffset.x() + context.fTextShift,
744 if (context.clippingNeeded) {
756 void TextLine::paintDecorations(ParagraphPainter* painter, SkScalar x, SkScalar y, TextRange textRange, const TextStyle& style, const ClipContext& context) const {
762 decorations.paint(painter, style, context, correctedBaseline);
1219 void TextLine::measureTextWithSpacesAtTheEnd(ClipContext& context, bool includeGhostSpaces) const
1221 if (compareRound(context.clip.fRight, fAdvance.fX, fOwner->getApplyRoundingHack()) > 0 && !includeGhostSpaces &&
1228 context.fExcludedTrailingSpaces = std::max(context.clip.fRight - fAdvance.fX, 0.0f);
1229 context.clippingNeeded = true;
1230 context.clip.fRight = fAdvance.fX;
1417 void TextLine::computeNextPaintGlyphRange(ClipContext& context,
1423 TextRange curGlyphRange = TextRange(context.pos, context.pos + context.size);
1434 context.pos = curGlyphRange.start;
1435 context.size = curGlyphRange.width();
1781 [&result, &run](TextRange textRange, const TextStyle& style, const ClipContext& context) {
1846 auto context = this->measureTextInsideOneRun(
1848 SkRect clip = context.clip;
1849 clip.offset(lineContext.fTextShift - context.fTextShift, 0);
1961 auto merge = [&lastRun, &context, &boxes](SkRect clip) {
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());
2056 ClipContext context = context0;
2060 context.clip.fRight += context.fExcludedTrailingSpaces; // extending clip to the right
2065 context.clip.offset(offsetX, 0.0f);
2068 if (SkScalarNearlyEqual(context.clip.fRight, dx, 0.01f)) {
2069 context.clip.fRight = dx;
2072 if (dx <= context.clip.fLeft) {
2074 auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos));
2081 size_t glyphCnt = context.run->glyphs().size();
2082 if ((glyphCnt != 0) && (context.run->fUtf8Range.end() - context.run->fUtf8Range.begin()) /
2090 keepLooking = context.pos != 0;
2096 if (dx >= context.clip.fRight) {
2098 auto utf16Index = fOwner->getUTF16Index(context.run->globalClusterIndex(context.pos + context.size));
2111 size_t found = context.pos;
2112 for (size_t index = context.pos; index < context.pos + context.size; ++index) {
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);
2136 SkScalar center = (context.clip.right() + context.clip.left()) / 2;
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()
2195 auto context = this->measureTextInsideOneRun(
2197 *width = context.clip.width();
2206 SkRect clip = context.clip;