2#ifndef ParagraphImpl_DEFINED
3#define ParagraphImpl_DEFINED
44 return a.size() ==
b.size() &&
a.begin() ==
b.begin();
48 return a.begin() >=
b.begin() &&
a.end() <=
b.end();
51template <
typename TStyle>
133 return SkSpan<Block>(fTextStyles.data(), fTextStyles.size());
150 return fUTF16IndexForUTF8Index[index];
168 auto clusterIndex = this->fClustersIndexFromCodeUnit[textIndex];
174 return fRuns[runIndex];
224 GlyphClusterInfo* glyphInfo)
override;
230 std::vector<FontInfo>
getFonts()
const override;
238 for (
auto&
run : fRuns) {
239 run.resetJustificationShifts();
244 return (fCodeUnitProperties[index] & property) == property;
258 void computeEmptyMetrics();
277 std::vector<size_t> fWords;
278 std::vector<SkUnicode::BidiRegion> fBidiRegions;
283 SkOnce fillUTF16MappingOnce;
284 size_t fUnresolvedGlyphs;
285 std::unordered_set<SkUnichar> fUnresolvedCodepoints;
297 SkScalar fMaxWidthWithTrailingSpaces;
301 bool fHasWhitespacesInside;
constexpr size_t SkToSizeT(S x)
const char * c_str() const
Run & run(RunIndex runIndex)
PositionWithAffinity getGlyphPositionAtCoordinate(SkScalar dx, SkScalar dy) override
bool strutHeightOverride() const
TextLine & addLine(SkVector offset, SkVector advance, TextRange textExcludingSpaces, TextRange text, TextRange textIncludingNewlines, ClusterRange clusters, ClusterRange clustersWithGhosts, SkScalar widthWithSpaces, InternalLineMetrics sizes)
void updateFontSize(size_t from, size_t to, SkScalar fontSize) override
SkSpan< TextLine > lines()
InternalLineMetrics getStrutMetrics() const
void paint(SkCanvas *canvas, SkScalar x, SkScalar y) override
InternalLineMetrics getEmptyMetrics() const
SkFont getFontAtUTF16Offset(size_t codeUnitIndex) override
skia_private::TArray< ResolvedFontDescriptor > resolvedFonts() const
InternalLineMetrics strutMetrics() const
int getLineNumberAt(TextIndex codeUnitIndex) const override
bool computeCodeUnitProperties()
void extendedVisit(const ExtendedVisitor &) override
void applySpacingAndBuildClusterTable()
ClusterIndex clusterIndex(TextIndex textIndex)
SkSpan< Cluster > clusters()
~ParagraphImpl() override
bool codeUnitHasProperty(size_t index, SkUnicode::CodeUnitFlags property) const
sk_sp< FontCollection > fontCollection() const
bool getGlyphClusterAt(TextIndex codeUnitIndex, GlyphClusterInfo *glyphInfo) override
TextIndex findNextGlyphClusterBoundary(TextIndex utf8) const
void visit(const Visitor &) override
Cluster & cluster(ClusterIndex clusterIndex)
std::vector< TextBox > getRectsForPlaceholders() override
SkSpan< const char > text() const
skia_private::TArray< TextIndex > countSurroundingGraphemes(TextRange textRange) const
std::vector< FontInfo > getFonts() const override
bool strutForceHeight() const
bool getApplyRoundingHack() const
bool getClosestUTF16GlyphInfoAt(SkScalar dx, SkScalar dy, GlyphInfo *graphemeInfo) override
SkString getEllipsis() const
const ParagraphStyle & paragraphStyle() const
int getPath(int lineNumber, SkPath *dest) override
bool strutEnabled() const
std::unordered_set< SkUnichar > unresolvedCodepoints() override
void getLineMetrics(std::vector< LineMetrics > &) override
ParagraphImpl(const SkString &text, ParagraphStyle style, skia_private::TArray< Block, true > blocks, skia_private::TArray< Placeholder, true > placeholders, sk_sp< FontCollection > fonts, sk_sp< SkUnicode > unicode)
InternalState state() const
bool containsColorFontOrBitmap(SkTextBlob *textBlob) override
size_t lineNumber() override
bool getLineMetricsAt(int lineNumber, LineMetrics *lineMetrics) const override
SkRange< size_t > getWordBoundary(unsigned offset) override
bool getClosestGlyphClusterAt(SkScalar dx, SkScalar dy, GlyphClusterInfo *glyphInfo) override
Run & runByCluster(ClusterIndex clusterIndex)
SkSpan< Placeholder > placeholders()
bool containsEmoji(SkTextBlob *textBlob) override
TextIndex findPreviousGlyphClusterBoundary(TextIndex utf8) const
size_t getUTF16Index(TextIndex index) const
void breakShapedTextIntoLines(SkScalar maxWidth)
int32_t unresolvedGlyphs() override
SkSpan< Block > blocks(BlockRange blockRange)
sk_sp< SkPicture > getPicture()
void updateTextAlign(TextAlign textAlign) override
void layout(SkScalar width) override
void updateBackgroundPaint(size_t from, size_t to, SkPaint paint) override
bool getGlyphInfoAtUTF16Offset(size_t codeUnitIndex, GlyphInfo *graphemeInfo) override
Block & block(BlockIndex blockIndex)
void addUnresolvedCodepoints(TextRange textRange)
void setState(InternalState state)
BlockRange findAllBlocks(TextRange textRange)
void ensureUTF16Mapping()
void updateForegroundPaint(size_t from, size_t to, SkPaint paint) override
void formatLines(SkScalar maxWidth)
SkFont getFontAt(TextIndex codeUnitIndex) const override
bool shapeTextIntoEndlessLine()
std::vector< TextBox > getRectsForRange(unsigned start, unsigned end, RectHeightStyle rectHeightStyle, RectWidthStyle rectWidthStyle) override
void markDirty() override
SkScalar widthWithTrailingSpaces()
TextIndex findPreviousGraphemeBoundary(TextIndex utf8) const
TextIndex findNextGraphemeBoundary(TextIndex utf8) const
int getLineNumberAtUTF16Offset(size_t codeUnitIndex) override
TextRange getActualTextRange(int lineNumber, bool includeSpaces) const override
sk_sp< SkUnicode > getUnicode()
ParagraphStyle fParagraphStyle
sk_sp< FontCollection > fFontCollection
std::function< void(int lineNumber, const ExtendedVisitorInfo *)> ExtendedVisitor
std::function< void(int lineNumber, const VisitorInfo *)> Visitor
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
it will be possible to load the file into Perfetto s trace viewer disable asset fonts
font
Font Metadata and Metrics.
bool operator==(const FontArguments &a, const FontArguments &b)
const SkRange< size_t > EMPTY_RANGE
SkRange< size_t > TextRange
bool operator<=(const SkSpan< T > &a, const SkSpan< T > &b)
const StrutStyle & getStrutStyle() const
bool getApplyRoundingHack() const
ResolvedFontDescriptor(TextIndex index, SkFont font)
bool getForceStrutHeight() const
bool getStrutEnabled() const
bool getHeightOverride() const
StyleBlock(TextRange textRange, const TStyle &style)
StyleBlock(size_t start, size_t end, const TStyle &style)